标签:style class blog code http tar
题解:
代码:
1 var i:longint; 2 n,k,ans:int64; 3 procedure main; 4 begin 5 readln(n); 6 ans:=n; 7 for i:=2 to trunc(sqrt(n)) do 8 if n mod i=0 then 9 begin 10 k:=0; 11 while n mod i=0 do 12 begin 13 inc(k); 14 n:=n div i; 15 end; 16 inc(ans,ans*(i-1)*k div i); 17 end; 18 if n<>1 then inc(ans,ans*(n-1)*1 div n); 19 writeln(ans); 20 end; 21 begin 22 main; 23 end.
SDOI2012Longge的问题,布布扣,bubuko.com
标签:style class blog code http tar
原文地址:http://www.cnblogs.com/zyfzyf/p/3806364.html