标签:blog class code int com cti
加群看见的
但是计算好慢,谁有更优的算法,麻烦说一下。
1
2
3
4
5
6
7
8
9
10 |
factor = [] for x in
xrange ( 1 , 987654 / / 2 + 1 ): if
987654 % x = = 0 : factor.append(x) sum = 0 for y in
xrange ( 1 , 1000000000 ): for
z in
factor: if
y % z = =
0 : sum + = y print
sum |
510904124706116762
python 求10亿以内和987654互质正整数的和,布布扣,bubuko.com
标签:blog class code int com cti
原文地址:http://www.cnblogs.com/zhangjiaxing/p/3704421.html