POJ 2047 Relatives 欧拉函数
2012-02-26 21:08
309 查看
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<ctime> #include<algorithm> using namespace std; #define lint __int64 lint Euler ( lint n ) { lint i, ret = n; for ( i = 2; i * i <= n; i++ ) { if ( n % i == 0 ) { n /= i; ret = ret - ret / i; while ( n % i == 0 ) n = n / i; } } if ( n > 1 ) ret = ret - ret / n; return ret; } int main() { lint n; while ( scanf("%I64d",&n) && n ) printf("%I64d\n",Euler(n)); return 0; }
相关文章推荐
- POJ 2407 Relatives (欧拉函数)
- POJ 2407 Relatives 欧拉函数题解
- (Relax 数论1.7)POJ 2407 Relatives(使用欧拉函数来求[1,n]中与n互质的整数的个数)
- POJ 2407 Relatives 欧拉函数
- POJ 2407 : Relatives - 欧拉函数
- POJ 2407-Relatives (欧拉函数)
- poj 2407 Relatives(欧拉函数模板)
- 【POJ 2407】Relatives(欧拉函数-水题)
- POJ 2407 Relatives(欧拉函数)
- POJ 2407 Relatives(欧拉函数)
- poj 2407 Relatives(简单欧拉函数)
- 欧拉函数 POJ 2407 Relatives&&POJ 2478 Farey Sequence
- poj 2407 Relatives(欧拉函数)
- POJ 2407-Relatives-欧拉函数
- poj 2407Relatives(数论:欧拉函数)
- HDU 1787 简单的求欧拉函数 POJ 2047 裸欧拉函数
- POJ_2407_Relatives(欧拉函数)
- POJ 2407 Relatives(欧拉函数的应用)
- poj 2407 小白算法练习 Relatives 数论 欧拉函数
- POJ 2407 Relatives(欧拉函数)