标签:sha can case ase names chm efi title size
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 4548 Accepted Submission(s): 1878
1 #include <algorithm> 2 #include <cstdio> 3 4 using namespace std; 5 6 #define LL long long 7 const LL mod(1000000007); 8 const LL N(1000000000+5); 9 LL x; 10 11 LL phi(LL x) 12 { 13 LL ret=1; 14 for(LL i=2;i*i<=x;i++) 15 if(x%i==0) 16 { 17 x/=i; 18 ret*=i-1; 19 for(;x%i==0;) 20 ret*=i,x/=i; 21 } 22 if(x>1) ret*=x-1; 23 return ret; 24 } 25 26 int main() 27 { 28 for(;scanf("%lld",&x)&&x;) 29 { 30 LL zz=(x-1)*x>>1; 31 printf("%lld\n",(zz-(x*phi(x)>>1))%mod); 32 } 33 return 0; 34 }
标签:sha can case ase names chm efi title size
原文地址:http://www.cnblogs.com/Shy-key/p/7305098.html