欧拉函数
煦--晨
菜鸟起飞
展开
-
poj 2478 Farey Sequence
本题也是欧拉回路题型; 题意是: The Farey Sequence Fn for any integer n with n >= 2 is the set of irreducible rational numbers a/b with 0 < a < b <= n and gcd(a,b) = 1 arranged in increasing order. The first原创 2013-11-14 10:11:30 · 741 阅读 · 0 评论 -
poj 2407
欧拉函数纯模板题 #include"stdio.h" #include"math.h" int fun(int k) { int sum=k,i; for(i=2;i { if(k%i==0) { sum=sum/i*(i-1); while(k%i==0) k=k/i; } } if(k>=2) sum=sum/原创 2013-11-11 21:51:27 · 507 阅读 · 0 评论