HMMT 十一月 2016 · 冲刺赛 · 第 36 题
HMMT November 2016 — Guts Round — Problem 36
题目详情
英文原题
- [ 20 ] Find the number of positive integers less than 1000000 which are less than or equal to the sum of their proper divisors. If your answer is X and the actual value is Y , your score will bemax(0 , 20 − 80 | 1 − | ) rounded to the nearest integer.X Y
解析
英文解析
- [ 20 ] Find the number of positive integers less than 1000000 which are less than or equal to the sum of their proper divisors. If your answer is X and the actual value is Y , your score will bemax(0 , 20 − 80 | 1 − | ) rounded to the nearest integer.X
Proposed by: Allen Liu y
Answer: 247548
N = 1000000
s = [0] * Nans = 0
for i in range(1, N):
if i <= s[i]:
ans += 1
for j in range(i + i, N, i):
s[j] += iprint(ans)