結果

問題 No.106 素数が嫌い!2
ユーザー gorugo30gorugo30
提出日時 2021-02-26 20:41:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 253 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 82,516 KB
実行使用メモリ 83,444 KB
最終ジャッジ日時 2024-04-10 11:12:08
合計ジャッジ時間 2,371 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 41 ms
52,752 KB
testcase_02 AC 39 ms
53,080 KB
testcase_03 WA -
testcase_04 AC 82 ms
73,892 KB
testcase_05 AC 139 ms
83,112 KB
testcase_06 AC 137 ms
83,444 KB
testcase_07 AC 131 ms
82,708 KB
testcase_08 AC 55 ms
64,420 KB
testcase_09 AC 56 ms
64,220 KB
testcase_10 AC 137 ms
83,236 KB
testcase_11 AC 78 ms
71,876 KB
testcase_12 AC 140 ms
83,304 KB
testcase_13 WA -
testcase_14 AC 39 ms
52,688 KB
testcase_15 AC 43 ms
57,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
sieve = [0] * (N + 1)
for i in range(2, N + 1):
    if sieve[i] == 0:
        for j in range(2 * i, N + 1, i):
            sieve[j] += 1
ans = 0
for i in range(2, N + 1):
    if sieve[i] >= K:
        ans += 1
print(ans)
0