結果

問題 No.1514 Squared Matching
ユーザー convexineqconvexineq
提出日時 2021-05-21 23:44:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,378 ms / 4,000 ms
コード長 215 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,416 KB
実行使用メモリ 466,152 KB
最終ジャッジ日時 2024-04-18 17:01:15
合計ジャッジ時間 24,548 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,824 KB
testcase_01 AC 1,378 ms
465,808 KB
testcase_02 AC 34 ms
52,820 KB
testcase_03 AC 36 ms
51,824 KB
testcase_04 AC 35 ms
53,256 KB
testcase_05 AC 48 ms
62,260 KB
testcase_06 AC 68 ms
81,864 KB
testcase_07 AC 276 ms
150,164 KB
testcase_08 AC 1,320 ms
451,904 KB
testcase_09 AC 1,133 ms
404,416 KB
testcase_10 AC 1,238 ms
431,832 KB
testcase_11 AC 1,290 ms
447,000 KB
testcase_12 AC 1,320 ms
457,532 KB
testcase_13 AC 1,345 ms
462,632 KB
testcase_14 AC 1,355 ms
464,480 KB
testcase_15 AC 1,354 ms
465,536 KB
testcase_16 AC 1,341 ms
466,060 KB
testcase_17 AC 1,359 ms
465,612 KB
testcase_18 AC 1,353 ms
465,668 KB
testcase_19 AC 1,346 ms
466,152 KB
testcase_20 AC 1,362 ms
466,152 KB
testcase_21 AC 1,354 ms
465,548 KB
testcase_22 AC 295 ms
153,756 KB
testcase_23 AC 548 ms
232,064 KB
testcase_24 AC 813 ms
309,816 KB
testcase_25 AC 1,084 ms
388,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
r = [1]*(n+1)
ans = 0
for i in range(1,n+1):
    if r[i] == 0: continue
    c = 0
    for j in range(1,n+1):
        if i*j*j > n: break
        c += 1
        r[i*j*j] = 0
    ans += c*c
print(ans)
0