"Exam" 35 provincial election

T1
the limits into the title:
\ (X \) in the subtree and son \ (Y \) is not in the subtree son.
\ (Y \) in the subtree and son \ (X \) subtree of not son.
Segment tree node maintains \ (DFS \) sequence in all nodes interval \ (X \) or \ (Y \) .
Of course, the red and blue open two segments of each tree.
According to \ (dfs \) Order Intervals query and violence scanning \ (vector \) you can know what points you want to delete.
Code is hard to write.
Time and space complexity are \ (O (nlogn) \)

T2
bracket sequence matching.
It can be split into two paths before \ (lca \) statistics.
This can be a simple dotted ruled.
Each partition in the center of gravity maintains two arrays.
\ [fr [i] [j ], se [i] [j] \] respectively can be divided into \ (J \) a legal sequence, preceded by (I \) \ th left / right parenthesis not match the program number .
Then the statistical part of this thing directly \ (dfs \) can be.
The answer statistics on the use of \ (FFT \) out on the line.
Complexity is \ (O (nlog n-2 ^) \) .

T3
80 points violence can practice with a sushi dinner.
Considered separately below and above the \ (\ sqrt {n} \ ) conditions.
With greater than \ (\ sqrt {n} \ ) as the initial value by less than the \ (DP \) is achieved.
Since \ (n-800 = \) , it can be pressed like this state, only 2 ^ 10 states.
Can easily write off complexity.

I do not know where to conclusions.
\ (S \) is the point at most two different prime factors.
And these prime factors of less than \ (\ sqrt {n} \ ) greater than \ (\ sqrt {n} \
) so that the contribution of each of the first quality factor plus.
Then run the greatest cost feasible flow.
See if there is a contribution of two prime factors of greater than two separate contributions.
The number of sides so few run very fast.
The complexity of the unknown.

Guess you like

Origin www.cnblogs.com/Lrefrain/p/12395980.html