結果

問題 No.1514 Squared Matching
ユーザー だれだれ
提出日時 2021-05-15 16:12:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 596 bytes
コンパイル時間 211 ms
コンパイル使用メモリ 82,920 KB
実行使用メモリ 450,516 KB
最終ジャッジ日時 2024-04-14 06:51:10
合計ジャッジ時間 33,641 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2,179 ms
450,292 KB
testcase_02 AC 38 ms
53,764 KB
testcase_03 AC 38 ms
53,004 KB
testcase_04 AC 38 ms
52,524 KB
testcase_05 AC 44 ms
59,948 KB
testcase_06 AC 71 ms
67,400 KB
testcase_07 AC 383 ms
136,956 KB
testcase_08 AC 1,888 ms
435,644 KB
testcase_09 AC 1,640 ms
388,520 KB
testcase_10 AC 1,675 ms
416,632 KB
testcase_11 AC 1,727 ms
430,448 KB
testcase_12 AC 1,770 ms
440,720 KB
testcase_13 AC 1,805 ms
445,732 KB
testcase_14 AC 1,818 ms
448,592 KB
testcase_15 AC 1,820 ms
449,820 KB
testcase_16 AC 1,854 ms
449,216 KB
testcase_17 AC 1,827 ms
450,292 KB
testcase_18 AC 1,820 ms
449,796 KB
testcase_19 AC 1,808 ms
450,516 KB
testcase_20 AC 1,818 ms
450,332 KB
testcase_21 AC 1,830 ms
450,020 KB
testcase_22 AC 403 ms
141,180 KB
testcase_23 AC 760 ms
219,092 KB
testcase_24 AC 1,111 ms
293,788 KB
testcase_25 AC 1,466 ms
372,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import floor, sqrt

def main(n):
    ans = 0
    prime = [True] * (7500)
    x = [i for i in range(n + 1)]
    i = 2
    while i * i < n:
        if prime[i]:
            w = i * i
            j = w

            while j * j <= n:
                prime[j] = False
                j += i

            j = w
            while j <= n:
                k = j
                while k <= n:
                    x[k] //= w
                    k += j
                j *= w
        i += 1
    for i in range(1, n + 1):
        ans += floor(sqrt(n / x[i]))
    print(ans)

n = int(input())
main(n)
0