50 provincial election simulation solution to a problem

A. A small tree in

Super piano, XOR dumplings, XOR of the few questions that are routine.

For each point of constantly looking for the right interval optimal solution, then the original range is divided into two sections.

With a heap moment to find the maximum.

Therefore, the maximum distance at all points of the problem to be solved is a point and interval.

Set of points and issues, to engage in a direct line to maintain the diameter of the tree just fine.

 

B. Small sequence of B

Some consider the nature of bit operation, may be considered by bit.

For each, if different intervals, after executing $ or \ 1 $ or $ and \ 0 $ operation will make the same throughout the range.

So this actually means operating range bulldozed.

When the memory section in a segment tree to meet current bit uneven, and this operation can be bulldozed, then recursion violence.

Determining the presence or absence directly or through the maintenance interval $ $ $ and $, and then implemented by bit operation.

Otherwise, a direct hit to the section labeled to indicate overall execution and $ or $ $ and $ operation.

For every potential case of binary analysis, that complexity can be of two $ log $.

So the question is how to maintain two marks to represent a range of execution and $ or $ $ and $ operation.

Imperial be a sequence, the operation is performed on the first section after $ and $ $ or $.

那么$a \ and \ b \ or \ c \ or \ d =a \ and \ b \ or \ (c \ or \ d)$

$a \ and \ b \ or \ c \ and \ d = a \ and \ (b \ and \ d) \ or \ (c \ and \ d)$

And then maintaining it maximum support queries like.

 

C. Lee is a small C

We must first think of the original problem can be solved determinant.

Since the definition of the enumeration is arranged in a determinant, then the contribution to the weight of the product $ * (- 1) ^ {num} $.

Because there is an addition, so it is up mentioned index, a polynomial like configuration.

Because there is a $ (- 1) ^ {num} $ coefficients, in order to prevent the need to give the card a random by each polynomial coefficients.

Find the final answer is clearly no more than $ nk $ times, so violent evaluated interpolation, the complexity is probably the fifth power level.

Then we found only concerned with whether or not a multiple of $ k $ th at has a value, almost can be transformed into coefficient $ k $ multiples and power.

It is possible to set up a unit root inversion.

So long as to find a $ k $ th Root presence prime number to, and are substituted into $ x in this modular nature Significance = w_k ^ i $ $ 0 \ leq i <k $ to the determinant and.

The resulting answer is a multiple of $ k $ coefficients and power.

If this value is not $ 0 $, the solution method that is a combination must exist, otherwise a high probability no solution.

Guess you like

Origin www.cnblogs.com/skyh/p/12533267.html