結果

問題 No.1514 Squared Matching
ユーザー ayaoniayaoni
提出日時 2021-05-22 00:35:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,674 ms / 4,000 ms
コード長 718 bytes
コンパイル時間 204 ms
コンパイル使用メモリ 81,964 KB
実行使用メモリ 466,996 KB
最終ジャッジ日時 2024-04-18 17:11:18
合計ジャッジ時間 45,073 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,764 KB
testcase_01 AC 2,626 ms
466,776 KB
testcase_02 AC 38 ms
52,940 KB
testcase_03 AC 37 ms
52,868 KB
testcase_04 AC 37 ms
53,092 KB
testcase_05 AC 54 ms
65,392 KB
testcase_06 AC 95 ms
81,976 KB
testcase_07 AC 519 ms
150,564 KB
testcase_08 AC 2,517 ms
452,912 KB
testcase_09 AC 2,197 ms
405,648 KB
testcase_10 AC 2,359 ms
432,740 KB
testcase_11 AC 2,471 ms
447,688 KB
testcase_12 AC 2,508 ms
457,884 KB
testcase_13 AC 2,548 ms
462,932 KB
testcase_14 AC 2,674 ms
465,248 KB
testcase_15 AC 2,556 ms
465,844 KB
testcase_16 AC 2,583 ms
466,420 KB
testcase_17 AC 2,578 ms
466,652 KB
testcase_18 AC 2,600 ms
466,744 KB
testcase_19 AC 2,586 ms
466,996 KB
testcase_20 AC 2,582 ms
466,908 KB
testcase_21 AC 2,572 ms
466,908 KB
testcase_22 AC 540 ms
154,620 KB
testcase_23 AC 1,034 ms
232,440 KB
testcase_24 AC 1,524 ms
310,924 KB
testcase_25 AC 2,070 ms
388,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


N = I()

flag = [0]*(N+1)
ans = 0
for i in range(1,N+1):
    if flag[i]:
        continue

    count = 0
    for j in range(1,10000):
        if i*j**2 > N:
            break
        count += 1
        flag[i*j**2] = 1

    ans += count*int((N//i)**0.5)

print(ans)
0