转载请注明出处:http://blog.csdn.net/u012860063 题目链接:http://codeforces.com/problemset/problem/52/C You are given circular array a0, a1, ..., an - 1. There are two types of operations with it: inc(lf, rg, v) - this operation increases each element on the segm…
Periodic RMQ Problem 动态开点线段树直接搞, 我把它分成两部分, 一部分是原来树上的, 一部分是后来染上去的,两个部分取最小值. 感觉有点难写.. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PLL pair<LL, LL> #define PLI pair<LL, int> #…
C. Vasily the Bear and Sequence time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasily the bear has got a sequence of positive integers a1, a2, ..., *a**n*. Vasily the Bear wants to write o…
两个二分 枚举位数 #include <bits/stdc++.h> #define MOD 1000000007 using namespace std; typedef long long ll; ll ten[]; ll check1(ll x) { ll ans = ; ll l, r; ; i <= ; i++) { l = ten[i], r = ten[i + ] - ; if (r < x) { ans += i * ( * x - l - r) * (r - l…