結果

問題 No.1737 One to N
ユーザー suosuo
提出日時 2021-11-12 21:28:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 86,820 KB
実行使用メモリ 78,284 KB
最終ジャッジ日時 2023-08-16 21:33:39
合計ジャッジ時間 4,254 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
78,284 KB
testcase_01 AC 68 ms
71,332 KB
testcase_02 AC 82 ms
76,336 KB
testcase_03 AC 68 ms
71,140 KB
testcase_04 AC 80 ms
76,392 KB
testcase_05 AC 85 ms
78,220 KB
testcase_06 AC 85 ms
78,228 KB
testcase_07 AC 85 ms
78,044 KB
testcase_08 AC 79 ms
76,216 KB
testcase_09 AC 79 ms
76,076 KB
testcase_10 AC 82 ms
76,932 KB
testcase_11 AC 79 ms
76,140 KB
testcase_12 AC 80 ms
76,352 KB
testcase_13 AC 81 ms
76,884 KB
testcase_14 AC 83 ms
77,724 KB
testcase_15 AC 84 ms
77,640 KB
testcase_16 AC 79 ms
76,676 KB
testcase_17 AC 81 ms
76,748 KB
testcase_18 AC 82 ms
76,816 KB
testcase_19 AC 78 ms
75,940 KB
testcase_20 AC 80 ms
76,172 KB
testcase_21 AC 81 ms
77,264 KB
testcase_22 AC 79 ms
76,396 KB
testcase_23 AC 83 ms
77,496 KB
testcase_24 AC 81 ms
76,964 KB
testcase_25 AC 80 ms
76,488 KB
testcase_26 AC 78 ms
76,408 KB
testcase_27 AC 70 ms
71,264 KB
testcase_28 AC 82 ms
76,768 KB
testcase_29 AC 71 ms
71,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x = int(input())
floor = [-1 for i in range(x+1)]
for i in range(2,x+1):
  if floor[i] != -1:
    continue
  j = i
  while j <= x:
    if floor[j] == -1:
      floor[j] = i
    j += i
ans = 0
while x != 1:
  ans += floor[x]
  x //= floor[x]
print(ans)
0