結果

問題 No.106 素数が嫌い!2
ユーザー 👑 rin204rin204
提出日時 2020-08-20 01:17:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,718 ms / 5,000 ms
コード長 264 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 26,496 KB
最終ジャッジ日時 2024-04-20 16:39:46
合計ジャッジ時間 13,061 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 898 ms
18,688 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 857 ms
18,688 KB
testcase_05 AC 1,694 ms
26,496 KB
testcase_06 AC 1,718 ms
26,496 KB
testcase_07 AC 1,591 ms
26,368 KB
testcase_08 AC 129 ms
11,904 KB
testcase_09 AC 131 ms
11,776 KB
testcase_10 AC 1,700 ms
26,496 KB
testcase_11 AC 705 ms
17,536 KB
testcase_12 AC 1,696 ms
25,856 KB
testcase_13 AC 31 ms
10,880 KB
testcase_14 AC 31 ms
10,752 KB
testcase_15 AC 31 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
cand = [0 for _ in range(n - 1)]
for i in range(2, n + 1):
    pos = i - 2
    if cand[pos] == 0:
        for j in range(pos, n - 1, i):
            cand[j] += 1
ans = 0
for num in cand:
    if num >= k:
        ans += 1
print(ans)
0