結果

問題 No.106 素数が嫌い!2
ユーザー nbisconbisco
提出日時 2017-01-19 23:03:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 469 bytes
コンパイル時間 855 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 75,648 KB
最終ジャッジ日時 2023-08-24 17:18:26
合計ジャッジ時間 15,368 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,358 ms
39,312 KB
testcase_01 AC 16 ms
7,800 KB
testcase_02 AC 15 ms
7,804 KB
testcase_03 AC 15 ms
7,792 KB
testcase_04 AC 2,393 ms
39,364 KB
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 AC 210 ms
12,776 KB
testcase_09 AC 226 ms
12,680 KB
testcase_10 TLE -
testcase_11 AC 1,953 ms
34,576 KB
testcase_12 TLE -
testcase_13 RE -
testcase_14 AC 15 ms
7,792 KB
testcase_15 AC 16 ms
7,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

primes = [2]
search = [i for i in range(3,N,2)]
while search[0]*search[0] < N:
    primes.append(search[0])
    _search = [i for i in search[1:] if i % search[0] != 0]
    search = _search
[primes.append(i) for i in search]

all_num = [0 for i in range(1,N+1)]


for i in primes:
    cur = i
    while cur <= N:
        all_num[cur-1] += 1
        cur += i
count = 0
for i in all_num:
    if i >= K:
        count += 1

print(count)
0