結果

問題 No.1514 Squared Matching
ユーザー tamato
提出日時 2021-05-21 22:20:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 3,937 ms / 4,000 ms
コード長 531 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 467,452 KB
最終ジャッジ日時 2024-10-10 09:09:18
合計ジャッジ時間 95,983 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
NN = 5*10**7
eps = 10**-9


def main():
    import sys
    from math import sqrt, floor
    input = sys.stdin.readline

    P_list = [1] * (NN+1)
    for p in range(2, NN+1):
        if P_list[p] == 1:
            for d in range(1, NN+1):
                if p*d > NN:
                    break
                P_list[p*d] *= p

    N = int(input())
    ans = 0
    for a in range(1, N+1):
        if P_list[a] == a:
            ans += floor(sqrt(N // a)) ** 2
    print(ans)


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