Codeforces 284A Cows and Primitive Roots [模拟题]
来源:互联网 发布:mysql 查看表的索引 编辑:程序博客网 时间:2024/06/05 00:08
题目链接:
http://codeforces.com/problemset/problem/284/A
水题水过去了。
#include<iostream>#include<fstream>#include<map>#include<vector>#include<string>#include<memory.h>#include<cmath>#include<algorithm>#include<queue>#define Min(a,b) (a<b?a:b)#define Max(a,b) (a>b?a:b)#define Abs(a) (a>0?(a):-(a))#define llong long long intusing namespace std;const int N=2005,M=100005,inf=0x7fffffff;int n,m;int main(){//freopen("1.txt","r",stdin);while(scanf("%d",&n)!=EOF){int ans=0;for(int i =1;i<n;i++){bool flag =true;int now = 1;for(int j=1;j<n-1;j++){now = (now*i)%n;if(now==1){flag=false;break;}}now = (now*i)%n;if(now != 1){flag=false;}if(flag) ans++;}printf("%d\n",ans);}return 0;}
- Codeforces 284A Cows and Primitive Roots [模拟题]
- 284A. Cows and Primitive Roots
- A. Cows and Primitive Roots
- 校赛 E 题 Cows and Primitive Roots
- codeforces 283A - Cows and Sequence 简单数据结构模拟
- Codeforces 283A Cows and Sequence
- Primitive roots
- Codeforces 284C Cows and Sequence【思维】
- codeforces 283A. Cows and Sequence [线段树-区间更新]
- CodeForces 283A Cows and Sequence 树状数组
- CodeForces 8A Train and Peter (简单模拟题)
- codeforces 414A Mashmokh and Numbers 模拟题
- pku1284 Primitive Roots
- POJ1284 Primitive Roots
- POJ 1284 Primitive Roots
- poj - 1284 - Primitive Roots
- Poj 1284 Primitive Roots
- 【POJ 1284】Primitive Roots
- PHP课堂--实验4
- 简明 Vim 练级攻略
- jquey学习笔记基本过滤选择器
- poj 1860 Currency Exchange
- python定时调度
- Codeforces 284A Cows and Primitive Roots [模拟题]
- ubuntu12.10安装QQ2012
- C# 用GDI在图片上写字实现lable透明背景
- 时序图,协作图,状态图,活动图,对象图 简介
- ORA-01035: ORACLE only available to users with RESTRICTED SESSION privilege
- LA5009——三分求极小值
- MFC对话框程序最大化时控件相应变化
- C++学习笔记-构造函数的理解
- Android 去掉titlebar的最优解决方案