結果

問題 No.106 素数が嫌い!2
ユーザー tnoda_tnoda_
提出日時 2015-08-10 12:37:45
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,166 ms / 5,000 ms
コード長 248 bytes
コンパイル時間 411 ms
コンパイル使用メモリ 6,504 KB
実行使用メモリ 21,420 KB
最終ジャッジ日時 2023-09-25 07:52:06
合計ジャッジ時間 9,811 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 589 ms
13,560 KB
testcase_01 AC 11 ms
5,852 KB
testcase_02 AC 11 ms
5,944 KB
testcase_03 AC 11 ms
5,864 KB
testcase_04 AC 601 ms
13,376 KB
testcase_05 AC 1,141 ms
21,280 KB
testcase_06 AC 1,143 ms
21,420 KB
testcase_07 AC 1,147 ms
21,300 KB
testcase_08 AC 80 ms
6,832 KB
testcase_09 AC 78 ms
6,816 KB
testcase_10 AC 1,158 ms
21,276 KB
testcase_11 AC 490 ms
12,764 KB
testcase_12 AC 1,166 ms
20,556 KB
testcase_13 AC 11 ms
5,948 KB
testcase_14 AC 11 ms
5,944 KB
testcase_15 AC 12 ms
6,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, raw_input().strip().split())
npf = [0] * (N+1)
for i in xrange(2, N+1):
    if npf[i] == 0:
        for j in xrange(i, N+1, i):
            npf[j] += 1
ans = 0
for i in xrange(2, N+1):
    if npf[i] >= K:
        ans += 1
print(ans)
0