#P4727. [HNOI2009] 图的同构计数
[HNOI2009] 图的同构计数
Description
After learning the above, Xiaoxue felt that directly challenging the ultimate problem was still quite difficult, so he decided to start with simpler problems. Specifically, he became very interested in the graph isomorphism problem. Graph and graph are considered isomorphic if, after relabeling the vertices of graph in some way, the vertex set and edge set of correspond exactly one-to-one with those of .
Xiaoxue is now focused on how to determine whether two graphs are isomorphic. At the same time, he also wants to know how many pairwise non-isomorphic graphs with vertices there are. It is well known that a simple graph with vertices has at most edges, so there are possible graphs with vertices. Clearly, many of these graphs are isomorphic. What Xiaoxue wants to know is: if we count isomorphic graphs as one, how many different graphs are there? He threw this task to you—solve it quickly before he figures it out!
Input Format
The input contains a non-negative integer , representing the number of vertices of the graph, and .
Output Format
Output one integer, representing the number of graphs with vertices that are non-isomorphic under isomorphism. Since the answer may be very large, output the final result ( is a prime).
1
1
2
2
3
4
5
34
9
493
Hint
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号