結果

問題 No.106 素数が嫌い!2
ユーザー yomo3
提出日時 2020-03-07 04:37:13
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 265 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 26,496 KB
最終ジャッジ日時 2024-10-14 11:11:25
合計ジャッジ時間 7,705 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 7
権限があれば一括ダウンロードができます

ソースコード

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