POJ 1284 Primitive Roots 欧拉函数模板题
来源:互联网 发布:lg洗衣机选购 知乎 编辑:程序博客网 时间:2024/05/19 10:35
#include <algorithm>#include <iostream>#include <cstring>#include <cstdlib>#include <cstdio>#include <queue>#include <cmath>#include <stack>#include <map>#include <ctime>#include <iomanip>#pragma comment(linker, "/STACK:1024000000");#define EPS (1e-6)#define LL long long#define ULL unsigned long long#define _LL __int64#define INF 0x3f3f3f3f#define Mod 1000000007using namespace std;int p;unsigned euler(unsigned x){ unsigned i,res=x; for(i=2;i<(int)sqrt(x*1.0)+1;i++) if(x%i==0) { res=res/i*(i-1); while(x % i==0) x/=i; } if(x>1) res=res/x*(x-1); return res;}int main(){ while(scanf("%d",&p)!=EOF) { printf("%d\n",euler(p-1)); } return 0;}
0 0
- POJ 1284 Primitive Roots 欧拉函数模板题
- POJ 1284 Primitive Roots(欧拉函数)
- POJ 1284 Primitive Roots【欧拉函数】
- POJ-1284 Primitive Roots 欧拉函数
- POJ 1284 Primitive Roots (原根,欧拉函数)
- POJ 1284 Primitive Roots 原根(欧拉函数)
- POJ 1284 Primitive Roots (欧拉函数&原根定理)
- poj-1284(Primitive Roots)(欧拉函数运用)
- POJ 1284 Primitive Roots 解题报告(欧拉函数)
- poj 1284 Primitive Roots(欧拉函数,原根定理)
- poj 1284 Primitive Roots(原根+欧拉函数)
- poj 1284 Primitive Roots(数论:欧拉函数)
- POJ 1284 : Primitive Roots - 欧拉函数,原根
- POJ 1284-Primitive Roots(欧拉函数求原根个数)
- POJ 1284 Primitive Roots(欧拉函数)
- POJ 1284 Primitive Roots (欧拉函数--求原根数量)
- POJ 1284 Primitive Roots(原根个数与欧拉函数)
- Primitive Roots +欧拉函数+原根
- Oracle Connect By的用法
- BASE64 编码原理
- Linux一些常用命令
- 欢迎大家关注我的微信公众帐号小q机器人(xiaoqrobot)
- 万维网发布服务(W3SVC)已经停止
- POJ 1284 Primitive Roots 欧拉函数模板题
- 编程观点和人生观点,其实是息息相关的
- QuotePrintable编码原理
- Android平台的信息推送实现
- sql练习汇总(oracle和sqlserver两个版本的答案)
- JIT 编译 LUA常见库和工具
- 汉字区位码
- URI概念在项目中的体会
- CSDN-Code平台使用过程中的5点经验教训