結果

問題 No.106 素数が嫌い!2
ユーザー nbisconbisco
提出日時 2017-01-19 23:24:31
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 440 bytes
コンパイル時間 1,115 ms
コンパイル使用メモリ 86,916 KB
実行使用メモリ 273,032 KB
最終ジャッジ日時 2023-08-24 17:18:57
合計ジャッジ時間 17,321 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,074 ms
258,684 KB
testcase_01 AC 72 ms
71,064 KB
testcase_02 AC 71 ms
70,912 KB
testcase_03 AC 74 ms
71,312 KB
testcase_04 AC 980 ms
258,656 KB
testcase_05 AC 2,037 ms
271,964 KB
testcase_06 AC 2,040 ms
271,988 KB
testcase_07 AC 2,034 ms
271,940 KB
testcase_08 AC 157 ms
88,688 KB
testcase_09 AC 149 ms
90,840 KB
testcase_10 AC 2,023 ms
272,116 KB
testcase_11 AC 853 ms
253,116 KB
testcase_12 AC 1,952 ms
273,032 KB
testcase_13 RE -
testcase_14 AC 72 ms
71,160 KB
testcase_15 AC 78 ms
76,024 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 = primes + search


all_num = [0 for i in range(1,N+1)]
for i in primes:
    for j in range(i, N+1, i):
        all_num[j-1] += 1


count = 0
for i in all_num:
    if i >= K:
        count += 1

print(count)
0