HDU
来源:互联网 发布:加密狗软件安装 编辑:程序博客网 时间:2024/05/01 08:37
欧拉函数应用
百科:https://baike.baidu.com/item/%E6%AC%A7%E6%8B%89%E5%87%BD%E6%95%B0/1944850?fr=aladdin
#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <string>#include <cmath>#include <set>#include <map>#include <stack>#include <queue>#include <ctype.h>#include <vector>#include <algorithm>#include <sstream>#define PI acos(-1.0)#define in freopen("in.txt", "r", stdin)#define out freopen("out.txt", "w", stdout)using namespace std;const int maxn = 500 + 7, INF = 0x3f3f3f3f, mod = 1e9 + 7;int n, x;int ou(int v) { int ans = v; for(int i = 2; i <= v; ++i) { if(v % i == 0) { ans /= i; ans *= (i-1); while(v % i == 0) v /= i; } } return ans;}int main() { scanf("%d", &n); while(n--) { scanf("%d", &x); printf("%d\n", ou(x)); } return 0;}
阅读全文
1 0
- hdu
- hdu
- HDU
- hdu ()
- hdu
- hdu
- HDU
- HDU
- hdu
- hdu
- HDU
- Hdu
- hdu
- hdu-
- hdu
- hdu
- hdu
- HDU
- 计算指数
- VC++动态链接库使用
- Rstudio--R语言学习过程记录
- 招聘面试的套路与原则
- QueryRunner的实用方法及代码演示原理
- HDU
- BufferInputStream&BufferOutputStream
- “大宝剑”的用法:玩玩DEFCON后渗透工具Koadic
- DBC连接数据库经验技巧
- HDU 1213 How Many Tables
- C#_SOCKET通信
- JAVA assert关键字
- python数据结构之字典
- hibernate三