题目链接: https://cn.vjudge.net/problem/POJ-1284 题目大意: 就是给出一个奇素数,求出他的原根的个数. 解题思路: 由于是m是奇素数,m的欧拉函数值为m - 1,所以直接求出ϕ(m - 1)即可 #include<iostream> #include<cmath> using namespace std; typedef long long ll; int euler_phi(int n)//求单个 { int m = (int)sqrt(n…
一个欧拉函数的应用,当时也没有太搞清,这里直接用的当时的模板 #include<iostream> #include<cstdlib> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> using namespace std; ]; int main() { int i , j ; ; i <= ; i ++ ) phi[i]=; phi…
Primitive Roots Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 4505 Accepted: 2652 Description We say that integer x, 0 < x < p, is a primitive root modulo odd prime p if and only if the set { (xi mod p) | 1 <= i <= p-1 } is eq…
Primitive Roots Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 4775 Accepted: 2827 Description We say that integer x, 0 < x < p, is a primitive root modulo odd prime p if and only if the set { (xi mod p) | 1 <= i <= p-1 } is eq…
题目传送门 Primitive Roots Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 5434 Accepted: 3072 Description We say that integer x, 0 < x < p, is a primitive root modulo odd prime p if and only if the set { (xi mod p) | 1 <= i <= p-1 }…