Brief explanations of the cattle off the race day + ideas

T1

For the length> = 2 ring directly FLAC victory, as long as the diagonal of escape has been able to just get to play dead alive

If there is a ring, the length of the upper hand those which can give a dyed, this becomes a flip themselves, so both sides must be coated with a mad rush flip, the total number of records on the rings is an odd number to win the upper hand, the even-numbered flip win .

 

T2

Inclusion and exclusion tree count.

The first asked maintenance of order k sub-tree size and the k-th ancestor, simple calculations without brain volume reduction denounced count on the line, complexity O (nk)

The second product asked to maintain order k sub-tree and under, and then found themselves in addition to their ancestors, all contributions can be directly used this product and count, the simple calculations take into multiplication and division addition, visual changes little need to inverse.

For point can not be so considered, since only k 1 Ge can not be so counted points + points counted separately under contribution, and finally take the answers inside the herd, visual O (nk) or O (nk ^ 2), can be accept.

T3

hzhT2 edge was observed even after the base ring = full coverage tree, the tree must have a = not covered.

That is if your straight flutter in the trees on the street.

For every single tree, as to find out the minimum and maximum range, ask if your tree contains a section, it would explode.

Personally I feel that the answer can still double pointer statistical coverage, that is, to maintain the starting point, and each time pushing forward the start time, then push the end. You may want to maintain the data structure? not sure.

This question had put a bipartite graph, in fact, to a reasonable 60 minutes or, put in the past too pulled. But this was not so pull compared to 80 points for the violence T2.

I think this topic out of the good, the point is that the data SB.

Link: https: //ac.nowcoder.com/acm/contest/1100#question

 

Guess you like

Origin www.cnblogs.com/YoOXiii/p/11764159.html