欧拉函数
ZJLORD
这个作者很懒,什么都没留下…
展开
-
指数循环节 处理A^B 问题 Super A^B mod C + Calculation
指数循环节:用于计算 A^B ;例子:http://acm.fzu.edu.cn/problem.php?pid=1759Given A,B,C, You should quickly calculate the result of A^B mod C. (1A和B都贼大,所以就需要用一个公式来减少计算;需要注意的是这个公式有个原创 2017-08-01 20:57:26 · 965 阅读 · 0 评论 -
机器人的项链 HDU - 2239 欧拉函数 Polya定理
刚开始做欧拉函数的题目,先说一下欧拉函数吧。euler(x)就是计算1~n中有多少个与n互质的个数;公式:euler(x)=x(1-1/p1)(1-1/p2)(1-1/p3)(1-1/p4)…(1-1/pn);具体实现两种:1.int euler(int n){ //返回euler(n) int res=n,a=n; for(int i=2;i*i<=a原创 2017-07-30 10:52:32 · 675 阅读 · 0 评论 -
Description has only two Sentences HDU - 3307 欧拉定理
Description has only two Sentences HDU - 3307题目:a n = X*a n-1 + Y and Y mod (X-1) = 0. Your task is to calculate the smallest positive integer k that a k mod a0 = 0. InputEach line原创 2017-08-02 10:59:51 · 268 阅读 · 0 评论 -
Help Hanzo
Help Hanzo Amakusa, the evil spiritual leader has captured the beautiful princess Nakururu. The reason behind this is he had a little problem with Hanzo Hattori, the best n原创 2017-08-03 23:34:57 · 272 阅读 · 0 评论