9.13 summary

9.13 summary

Scores

35+30+100=165 Rank2

The second question is SPFA card! !

T1

dp on DFS sequence.

Set F [i] [j] denotes the i-th current discharge points, where x is the position of the largest order that a DFS root go to x j steps.

So there are two transfers, add a left son is x (where j + 1), or to find a maximum dfs order, but did not have left his son the right to add a node son of the right son (this time j-1). Both the new node metastasis DFS DFS order are necessarily the order +1 x.

Therefore transferred from f [i] [j] to f [i + 1] [j-1] or f [i + 1] [j + 1]

There are x number of leaf nodes when the total number of nodes must be 2 * x-1, so f [2 * x-1] [0] is the legal answer.

T2

Push the right side of the equation detect changes every three will cycle, namely x -> (1 / (1-x)) -> ((x-1) / x). Therefore, the point is split into three, the shortest direct enough.

T3

Conclusions title

When the game want to do partition, and then found the conclusion there is a problem, then find correction look like a

Suppose now seeking interval [l, r] is the maximum value and the minimum length value of the subsequence S (with transfer), it has been determined a [l, mid] and [mid + 1, r] answers.

Assume a left election S1, S2 choose the right one can make the best answer.

Now we ask for the length of the answer to S + 1, selected from the left is assumed S1 'a right election S2' one can make the best answer.

Found S1 'and S1; S2' and S2 are some links. Their difference is not more than three.

The fastest run

Guess you like

Origin www.cnblogs.com/leason-lyx/p/11517066.html