結果

問題 No.106 素数が嫌い!2
ユーザー matsu7874matsu7874
提出日時 2015-11-29 20:07:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,055 ms / 5,000 ms
コード長 318 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 23,596 KB
最終ジャッジ日時 2023-10-12 05:49:14
合計ジャッジ時間 15,365 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,049 ms
15,956 KB
testcase_01 AC 16 ms
7,752 KB
testcase_02 AC 16 ms
7,820 KB
testcase_03 AC 16 ms
7,736 KB
testcase_04 AC 1,038 ms
15,992 KB
testcase_05 AC 1,989 ms
23,596 KB
testcase_06 AC 1,998 ms
23,552 KB
testcase_07 AC 1,980 ms
23,568 KB
testcase_08 AC 134 ms
9,164 KB
testcase_09 AC 136 ms
9,312 KB
testcase_10 AC 1,956 ms
23,552 KB
testcase_11 AC 875 ms
15,080 KB
testcase_12 AC 2,055 ms
23,112 KB
testcase_13 AC 16 ms
7,824 KB
testcase_14 AC 16 ms
7,804 KB
testcase_15 AC 17 ms
7,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = [0 for i in range(N + 1)]
for i in range(2, N + 1, 2):
    A[i] += 1
for i in range(3, N + 1, 2):
    if A[i] > 0:
        continue
    j = 1
    while i * j <= N:
        A[i * j] += 1
        j += 1
cnt = 0
for i in range(2, N + 1):
    if A[i] >= K:
        cnt += 1
print(cnt)
0