XOJ Divisor counting
摘要:
Divisor countingLetσ(n)denote the number of divisors ofn.Computeσ(1)+σ(2)+⋯+σ(n).InputAn integern.(1≤n≤10^14)OutputThe sum.Sample input5Sample output10直接枚举,枚举技巧:只要枚举到sqrt(n),另一半可以根据(n/i+n/(i+1))*i得出。。View Code 1 #include<iostream> 2 #include<cstdio> 3 #include<cmath> 4 using namesp 阅读全文
posted @ 2013-02-05 20:37 acoderworld 阅读(73) 评论(0) 推荐(0)
浙公网安备 33010602011771号