【CF1173D】NanuuAndCircle

Topic links: http://codeforces.com/contest/1173/problem/D
the game weak burst of chicken dishes (I), did not think how this road looks similar to the immortal Count / generator function is so positive solution of problem concise.
Provided that an apparently have to want to understand the nature of that sub-tree on the circle will be a period of continuous intervals. This painting a drawing can want to understand.
The answer need not consider the rotation symmetry (carefully read the title !!!)! Then converted into the root is fixed in position on the circle, and then find a tree sequence motif approximately dfn how many (approximately here that, in the root of the subtree is not necessarily the most distal section because of the continuous subtree only this point is different from conventional dfn order). We loved that the answer is to find the degree of the tree all the points of the factorial (understood as the roots take the number of * his son down the order number of positions in each sub) multiplied together, then multiply that circle (where the root n the number of positions).

Obviously this question is too simple codes that do not need to impress qwq ......

Guess you like

Origin www.cnblogs.com/Sinuok/p/11005803.html