22 provincial election simulation

T1 computational geometry problem is to see, I think the fear was once dominated, and finally decided to put
then T2 differential wrong, understanding is not deep, spent a long, long, long time, very desperate way, but fortunately finally filmed.
T3 left more than 40 minutes, the idea began to fight to the last output sample or not, still do not check the error, despair. Afternoon found to be empty and no variable assignment on the input front (several times orz)

B. triples

The meaning of problems: the given string S, seeking to satisfy 1 <= i <= j < k <= | S | , and S [i ~ j] S [ j + 1 ~ K] are palindromic substrings triple ( i, j, k) of \ (\ SUM \ Limits {I \ K} Times \) . | S | <= 1e6, T <= 5
enumeration j, so the answer is \ (\ SUM palindromic sequence at the left end point j \ times \ sum j + 1 to the start point of the right palindromic sequence \)
considered manacher deal out on the endpoint information into the midpoint of the practice is a difference.
It found that the contribution of the array is the tolerance for the arithmetic sequence -1, how difference
a difference and can add a constant prefix, then the prefix and the number of secondary difference then you can add +1 ax form, so you can continue to get a prefix and a polynomial.
Therefore, the difference components are recorded on the two dimensions, and the array element do two prefixes.

C. Best Value

Meaning of the title:
the n-<= 100
is too long do not want to repeat. . .
Looking at the data range and a bunch of restrictions, expenditure and revenue, segment expense, the maximum weight is not difficult to think of a closed subgraph.
Then this map was built relatively simple, there is no card points.
Means the revenue of w (i, j) opening point, then get this income must choose ij, even side
if the choice of site i, then the time will pay a \ (a_i \) price.
There characters are selected constants B, similar sushi dinner open point, is directed to a position corresponding to the character, because of (k-1), consideration of \ (b_i-a_i \)

Guess you like

Origin www.cnblogs.com/hzoi-yzh/p/12288937.html