Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

100题贴代码

Posted by zhjou at 2014-06-08 23:43:00 on Problem 2480
main()
{
    long long s,n,x,r,i;
    while(scanf("%I64d",&n)+1){
    s=1;
    for(i=2;i*i<=n;i++){
             if(n%i==0){
             x=1;r=0;
             while(n%i==0){
             n/=i;x*=i;
             r++;
             } 
             s*=(r+1)*x-r*x/i;         
             }
             }
             if(n>1)s*=2*n-1;
           printf("%I64d\n",s);
             }
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator