結果

問題 No.3296 81-like number
コンテスト
ユーザー 学ぶマン
提出日時 2025-11-29 18:56:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 435 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 329 ms
コンパイル使用メモリ 82,444 KB
実行使用メモリ 64,448 KB
最終ジャッジ日時 2025-11-29 18:56:42
合計ジャッジ時間 2,330 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N = int(input())

limit = 10**5
distinct_prime_factor_count = [0]*(limit+1)
primes = []
for i in range(2, limit+1):
    if distinct_prime_factor_count[i] == 0:
        primes.append(i)
        for num in range(i, limit+1, i):
            distinct_prime_factor_count[num] += 1

# 全探索する
ans = 0
for n in range(2, 34):
    for p in primes:
        if p**n > N:
            break
        else:
            ans += p**n

print(ans)
0