結果

問題 No.1514 Squared Matching
ユーザー tamatotamato
提出日時 2021-11-02 10:06:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 3,484 ms / 4,000 ms
コード長 531 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 82,628 KB
実行使用メモリ 467,356 KB
最終ジャッジ日時 2024-04-19 16:11:47
合計ジャッジ時間 81,236 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,661 ms
466,464 KB
testcase_01 AC 3,464 ms
467,092 KB
testcase_02 AC 2,657 ms
466,336 KB
testcase_03 AC 2,679 ms
466,896 KB
testcase_04 AC 2,625 ms
467,040 KB
testcase_05 AC 2,654 ms
467,120 KB
testcase_06 AC 2,662 ms
466,928 KB
testcase_07 AC 2,834 ms
466,604 KB
testcase_08 AC 3,451 ms
467,012 KB
testcase_09 AC 3,334 ms
466,900 KB
testcase_10 AC 3,484 ms
466,968 KB
testcase_11 AC 3,274 ms
467,216 KB
testcase_12 AC 3,068 ms
466,836 KB
testcase_13 AC 3,073 ms
466,620 KB
testcase_14 AC 3,078 ms
467,356 KB
testcase_15 AC 3,076 ms
466,884 KB
testcase_16 AC 3,101 ms
466,988 KB
testcase_17 AC 3,074 ms
466,616 KB
testcase_18 AC 3,056 ms
467,288 KB
testcase_19 AC 3,089 ms
467,216 KB
testcase_20 AC 3,076 ms
467,160 KB
testcase_21 AC 3,059 ms
466,888 KB
testcase_22 AC 2,414 ms
466,772 KB
testcase_23 AC 2,583 ms
467,076 KB
testcase_24 AC 2,719 ms
466,748 KB
testcase_25 AC 2,890 ms
466,948 KB
権限があれば一括ダウンロードができます

ソースコード

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