結果

問題 No.3296 81-like number
コンテスト
ユーザー cologne
提出日時 2025-11-14 15:24:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 482 bytes
コンパイル時間 374 ms
コンパイル使用メモリ 82,600 KB
実行使用メモリ 75,604 KB
最終ジャッジ日時 2025-11-14 15:24:13
合計ジャッジ時間 2,694 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(2*10**5)


def input(): return sys.stdin.readline().rstrip('\n')


def isp(x):
    i = 2
    while i*i <= x:
        if x % i == 0:
            return False
        i += 1
    return True


def main():
    N = int(input())

    ans = 0
    n = 2
    while 2**n <= N:
        p = 2
        while p**n <= N:
            if isp(p):
                ans += p**n
            p += 1

        n += 1

    print(ans)


if __name__ == '__main__':
    main()
0