結果

問題 No.3296 81-like number
コンテスト
ユーザー sepa38
提出日時 2025-09-06 15:18:13
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 41 ms / 2,000 ms
+ 359µs
コード長 263 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 84 ms
コンパイル使用メモリ 64,632 KB
実行使用メモリ 59,276 KB
最終ジャッジ日時 2026-11-12 16:35:11
合計ジャッジ時間 2,393 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

l = 10 ** 5
isp = [1] * l
for i in range(2, l):
  if not isp[i]:
    continue
  for j in range(i*i, l, i):
    isp[j] = 0

n = int(input())
ans = 0
for p in range(2, l):
  if not isp[p]:
    continue
  x = p ** 2
  while x <= n:
    ans += x
    x *= p
print(ans)
0