Byteman is going for a car trip around Byteland, but he is unfortunately unable to buy a map of the country. His friends told him about some properties of the bytean road network:
Using information that he managed to collect, Byteman is going to try to reconstruct the road map of Byteland. Byteman would not like to work on it too much, so he would like to know the number of different road network plans satisfying the given conditions. During comparison of plans Byteman does not take exact locations of cities into consideration, but only the plan of connections; moreover, he is not interested in particular city numbers. In other words, Byteman considers two plans the same if and only if there exists a one-to-one mapping from cities of one plan to the cities of the other one, such that if cities and are connected by a road on the first plan then their equivalents and are also connected by a road on the second plan.
Write a program that:
The first and only line of the input contains three integers , and (, , , is a prime number), separated with single spaces.
The first and only line of output should contain a single integer - the remainder of the division by of the number of different plans that are consistent with conditions known to Byteman.
For the input data:
6 3 13
the correct result is:
2
Task author: Jakub Radoszewski.
参考了
acm.sjtu.edu.cn/ppca/w/images/5/58/Graphical_enumeration_-_魏祯.pdf
和
http://www.researchgate.net/publication/224105126_The_Enumeration_of_Trees_by_Height_and_Diameter
公式还打错搞了半天。。
然后还把n^3logn优化到n^3才过
2018年11月28日 16:26
The difficulties of the particular nature have been done for the humans. The section and all ideal parts have been ensured for the use of the edusson reviews for all vital pars or the humans. The change is identified for the vital and all approval themes for the citizens.
2023年7月12日 05:24
Mon activité est le portail principal où vous pouvez voir vos activités Google, y compris les recherches, les sites que vous avez visités et les films que vous avez visionnés. Il est important de noter que lors de l’utilisation des sites, applications et services Google. mon activité android Ils sont conservés indéfiniment dans votre compte Google. Vous pouvez afficher ou supprimer l’historique Google de mon activité en vous rendant dans Mon activité.
2023年12月12日 21:13
Do you know the net worth of your favorite actor, singer or any celebrity? There is a website which contains all information about idol net worth for everyone.