結果

問題 No.106 素数が嫌い!2
ユーザー threepipes_sthreepipes_s
提出日時 2016-01-03 03:40:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,968 ms / 5,000 ms
コード長 216 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 11,784 KB
実行使用メモリ 34,816 KB
最終ジャッジ日時 2023-10-19 14:35:12
合計ジャッジ時間 14,713 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 918 ms
25,524 KB
testcase_01 AC 29 ms
10,044 KB
testcase_02 AC 28 ms
10,044 KB
testcase_03 AC 28 ms
10,044 KB
testcase_04 AC 940 ms
24,996 KB
testcase_05 AC 1,965 ms
26,576 KB
testcase_06 AC 1,946 ms
25,512 KB
testcase_07 AC 1,968 ms
25,512 KB
testcase_08 AC 132 ms
12,060 KB
testcase_09 AC 145 ms
11,128 KB
testcase_10 AC 1,948 ms
25,512 KB
testcase_11 AC 806 ms
16,844 KB
testcase_12 AC 1,874 ms
34,816 KB
testcase_13 AC 27 ms
10,044 KB
testcase_14 AC 27 ms
10,044 KB
testcase_15 AC 28 ms
10,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
p = [0 for i in range(n+1)]
for i in range(2, n+1):
    if p[i]>0: continue
    j = i*2
    while j<=n:
        p[j] += 1
        j+=i
    p[i] = 1
print(len([x for x in p if x>=k]))
0