Provincial election simulation 9

A. Surprise me

  The question which the formula with $ \ varphi (ij) = \ frac {\ varphi (i) \ varphi (j) gcd (i, j)} {\ varphi (gcd (i, j))} $ unfold it, then Mobius sets and found a virtual tree very formula template, is to generate contributions lca between points, find the total sum of the contributions, so the build out virtual tree dp on the line. Note that after dp can only use the original point, the new virtual tree at the point at lca not provide contributions.

B. river

  There are bound to find a magic pig is included in all programs, so first come across this pig to throw, then you need to determine whether there is a legitimate program so that the next process will not conflict.

  For the rest of the pigs from one of them even a side to the other, then the legal conditions that this figure is a bipartite graph. That can be the same color bipartite graphs transported to the opposite point, and then shipped over to the magical pig, then all the other pigs shipped in the past.

  Special, contradictory and does not happen in two pigs before and after the magical pig.

  So long as a determination whether to remove two points into FIG bipartite graph violent means determines an enumeration two points violence.

  Positive Solutions enumeration approach is a point, a determination can then remove FIG point into a bipartite graph. First, find the original of a dfs tree, if a throwback bar across the side edges of the even less known side of this edge is odd, or even edge.

  So the point is to remove the legal conditions:

  1. All of the odd edge across it.

  2. do not exist across it (using it as an endpoint is not) and even the odd side edge.

  Draw a map can understand. So long as the dfs again on it.

C. NPIO 10-in

  Too lazy to write. The examination room basically thought.

Guess you like

Origin www.cnblogs.com/hzoi-cbx/p/12204049.html