fork(1) download
  1. def count_divisors(n) :
  2. result = 1
  3. i = 1
  4. while i**2 < n :
  5. i += 1
  6. temp = 1
  7. while n%i == 0 :
  8. n /= i
  9. temp += 1
  10. result *= temp
  11. if n != 1 :
  12. result *= 2
  13. return result
  14.  
  15. def solve(n) :
  16. last_max = 1
  17. for i in range(2, n+1) :
  18. temp = count_divisors(i)
  19. if temp > last_max :
  20. print i
  21. last_max = temp
  22.  
  23. solve(1000000)
Success #stdin #stdout #stderr 4.45s 43456KB
stdin
Standard input is empty
stdout
2
4
6
12
24
36
48
60
120
180
240
360
720
840
1260
1680
2520
5040
7560
10080
15120
20160
25200
27720
45360
50400
55440
83160
110880
166320
221760
277200
332640
498960
554400
665280
720720
stderr
Warning: cannot find your CPU L2 cache size in /proc/cpuinfo