結果

問題 No.106 素数が嫌い!2
ユーザー roiti46roiti46
提出日時 2015-02-10 19:01:39
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 250 bytes
コンパイル時間 59 ms
コンパイル使用メモリ 6,644 KB
実行使用メモリ 61,100 KB
最終ジャッジ日時 2023-09-05 22:57:45
合計ジャッジ時間 6,012 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 11 ms
6,368 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 709 ms
60,620 KB
testcase_07 AC 748 ms
60,848 KB
testcase_08 WA -
testcase_09 AC 52 ms
9,496 KB
testcase_10 AC 727 ms
60,768 KB
testcase_11 AC 287 ms
26,984 KB
testcase_12 WA -
testcase_13 AC 11 ms
6,244 KB
testcase_14 AC 11 ms
6,416 KB
testcase_15 AC 11 ms
6,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,raw_input().split())
R = N+2
p = [1]*R
c = [0]*R
p[0] = p[1] = 0
for i in xrange(2,int(R**0.5)+2):
    if p[i]:
        p[2*i::i] = [0]*len(p[2*i::i])
        c[i::i] = [j+1 for j in c[i::i]]
print sum(c[i] >= K for i in xrange(2,N+1))
0