http://codeforces.com/contest/1270
Spicy chicken game ruined my youth
A
Comparison of the biggest card can be
B
To find the absolute value of the difference between two adjacent> = 2 Number
If not, then it can only ± 1 or unchanged, there is no legal necessity interval
C
And for the set s1, s2 of the exclusive OR and
One method is to s2 * 2, then add exclusive or equal to 2 ^ x 2 ^ (x + 1)
From the back to the configuration, because it would not affect the current bit XOR and
A more sb method:
With two numbers, the first one of s2, the second to (s1 + s2)
And then it becomes s1 + s2 + (s1 + s2) = 2 (s1 + s2), and the exclusive OR becomes s2 ^ s2 ^ (s1 + s2) = s1 + s2, to meet the requirements
D
Mutual cross ♂ title
First find twice with two different positions of the operand, i.e., the first time 1 ~ k, the second is 1 ~ k + 1 first finds dug, the first set of x1, the second times as x2
Only until the number ratio x2 small number of second interrogated have to know m
Note that n can only ask once, it must ensure that every time a new number sentence out
x1 and x2 discussed in terms of size, the number of each of the second query into an unknown number x1, is determined according to the size obtained when the number of
The x1 <x2, the ratio x2 To determine the number of small, it will cause the same result of the inquiry, or becomes larger (smaller than x1 and x2 deleted)
E
Forced really Computational Geometry
Kiki xy coordinates as the current set, Parity, even-odd, even-even number of abcd
Abcd ① If only one is not 0, the coordinates of all the points put / 2, the answer is clear that this will not change
② If a + d and b + c is not 0, a + d may be assigned to the A, B assigned to b + c
The square of the distance, the distance between the same group is an even number, the distance of the different groups is odd
③ If a + d and b + c is not 0, there is a (assumed to be a + d), then assigned to a A, B assigned to the d
Then the distance between the same group is a multiple of 4, at a distance of more than 2 different sets of mold 4
Since the D 2 I 1 at 1 or 4 modulo 3 sense, two modulo 2 sum modulo 4 remainder is 1 inevitable 2
F
Set prefix sum, the subject of the request \ (\ sum_ {k = 1 } ^ {n} {\ sum_ {l, r} {[\ frac {r- (l-1)} {sum [r] - sum [l-1]} = k]}} \)
Set \ (T [I] * IK = SUM [I] \) , it may become \ (\ sum_ {k = 1 } ^ {n} {\ sum_ {l, r} {[t [l] = t [r]]}} \)
Balance plan, let T be the threshold
For n <= T, violent enumeration k, calculated using the same number of map the t
For n> T, we can find a number of small, the enumeration L, and then enumerate the number 1, the number r is obtained with a legitimate, you can find r 0 where direct calculation section
G
Can be converted to limit \ (. 1 <= i-a_i <= n-\) , i is connected to an i-ai directed to the side
So there must be a ring, find this ring, set above points were \ (i_1, i_2, i_3 ... i_k \)
Provisions exist \ (I_1-A_ {I1} = I_2, I_2-A_ {I3} = I_3 ... I_k-A_ {Ik} = I_1 \) , immediately \ (a_ {i1} + a_ {i2} + .. . + a_ {ik} = 0 \)