摘要:
地址:http://acm.hdu.edu.cn/showproblem.php?pid=1286题意:中文。mark:看似很绕其实就是求欧拉函数Phi(n)。对于所有n的素因子Pi,欧拉函数Phi(n) = n * (P1-1)/P1 * (P2-1)/P2 * (P3-1)/P3 ...。对于每一个Pi,因为n总是Pi的倍数,所以可以先除再乘,不会溢出。代码:# include <stdio.h>int Primes[40000] = {2, 3} ;int PrimeNum = 2 ;int dp[40000] ;int calc(int nn){ int ans = nn, 阅读全文
posted @ 2012-01-11 01:21
Seraph2012
阅读(165)
评论(0)
推荐(0)

浙公网安备 33010602011771号