
欧拉函数
不要再见
年轻且优秀,积极且颓废
展开
-
HDU - 2824 The Euler function
The Euler functionTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8389 Accepted Submission(s): 3516Problem DescriptionThe Euler function phi ...原创 2018-03-03 23:31:48 · 207 阅读 · 0 评论 -
欧拉函数的三种基本写法
概念梳理: 欧拉函数是少于或等于n的数中与n互质的数的数目。 欧拉函数的性质:它在整数n上的值等于对n进行素因子分解后,所有的素数幂上的欧拉函数之积。 欧拉函数的值 通式:φ(x)=x(1-1/p1)(1-1/p2)(1-1/p3)(1-1/p4)…..(1-1/pn),其中p1, p2……pn为x的所有质因数,x是不为0的整数。φ(1)=1(唯一和1...原创 2018-08-06 18:27:03 · 5074 阅读 · 2 评论 -
POJ 2048 Longge's problem (欧拉函数 积性函数)
Longge's problem Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7550 Accepted: 2500 Description Longge is good at mathematics and he likes to think about hard mathema...原创 2018-08-06 17:50:36 · 182 阅读 · 0 评论 -
POJ - 2407 Relatives
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 16494 Accepted: 8368 Description Given n, a positive integer, how many positive integers less than n are relatively prim...原创 2018-08-06 18:50:05 · 247 阅读 · 0 评论 -
POJ - 2478 Farey Sequence
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 18768 Accepted: 7554 Description The Farey Sequence Fn for any integer n with n >= 2 is the set of irreducible ration...原创 2018-08-06 18:58:16 · 281 阅读 · 0 评论 -
UVA - 11426 - GCD - Extreme (II)
题目请点击链接 题解: 大意:给定正整数N,求出G的值。 for(i=1;i<N;i++) for(j=i+1;j<=N;j++) G+=gcd(i,j); 我们可以,对N素因子分解,然后用得到的素因子去计算所有n的公约数贡献值。 比如,p=3,n=3, ans+=phi(3)*1;n=3*2, ans+=phi(3)*2;n=3*3, ans+=...原创 2018-08-20 09:21:52 · 173 阅读 · 0 评论