返回题库

HMMT 十一月 2016 · 冲刺赛 · 第 36 题

HMMT November 2016 — Guts Round — Problem 36

专题
Discrete Math / 离散数学
难度
L3
来源
HMMT

题目详情

  1. [ 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 be X max(0 , 20 − 80 | 1 − | ) rounded to the nearest integer. Y
解析
  1. [ 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 be X max(0 , 20 − 80 | 1 − | ) rounded to the nearest integer. Y Proposed by: Allen Liu Answer: 247548 N = 1000000 s = [0] * N ans = 0 for i in range(1, N): if i <= s[i]: ans += 1 for j in range(i + i, N, i): s[j] += i print(ans)