結果

問題 No.106 素数が嫌い!2
ユーザー yomo3yomo3
提出日時 2020-03-07 04:37:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 265 bytes
コンパイル時間 445 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 26,624 KB
最終ジャッジ日時 2024-04-22 11:50:36
合計ジャッジ時間 8,491 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 30 ms
10,752 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 973 ms
26,368 KB
testcase_07 AC 978 ms
26,368 KB
testcase_08 WA -
testcase_09 AC 85 ms
11,904 KB
testcase_10 AC 976 ms
26,624 KB
testcase_11 AC 411 ms
17,664 KB
testcase_12 WA -
testcase_13 AC 30 ms
10,752 KB
testcase_14 AC 29 ms
10,752 KB
testcase_15 AC 30 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())

c = [~x & 1 for x in range(N + 1)]
c[0] = 0

lim = int(N**0.5) + 1
for p in range(3, lim + 1, 2):
    if c[p] == 0:
        for q in range(p, N + 1, p):
            c[q] += 1

ans = sum(c[i] >= K for i in range(2, N+1))

print(ans)
0