企业如何利用HarmonyOS开发工具提升小程序开发效率与合规性
620
2022-10-02
nyoj-Color the necklace(Ploya定理 + 欧拉函数 + 扩展欧几里得(求逆元))
Color the necklace 时间限制:2000 ms | 内存限制:65535 KB 难度:0 描述 As we all know, girls love necklaces, especially nice necklaces. Recently, huicpc229 has fallen in love with a girl; he wants to bring her a necklace as a gift. Now he has n colors, and the necklace is circular and it has n beads, huicpc229 can use his colors to color the necklace. he wants to know how many different kinds of necklaces he can make,he may not use all the n colors. In this problem, the necklace is same when you rotate it around the center of the necklace or turn it over. 输入 First line is the testcase T. Following T lines, each line is an integer n ( 1≤n ≤ 10^9 ) 输出 Output the answer mod 20090531 样例输入 4 1 2 3 4 样例输出 1 3 10 55 来源 3rd Central South China Programming ContestColor the necklace
代码:
#include
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~