結果

問題 No.106 素数が嫌い!2
ユーザー roiti46roiti46
提出日時 2015-02-10 19:00:45
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 249 bytes
コンパイル時間 1,168 ms
コンパイル使用メモリ 77,808 KB
実行使用メモリ 225,780 KB
最終ジャッジ日時 2023-09-05 22:57:33
合計ジャッジ時間 5,016 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 73 ms
77,056 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 286 ms
225,780 KB
testcase_07 AC 284 ms
225,336 KB
testcase_08 WA -
testcase_09 AC 90 ms
85,972 KB
testcase_10 AC 292 ms
225,656 KB
testcase_11 AC 165 ms
137,880 KB
testcase_12 WA -
testcase_13 AC 71 ms
76,572 KB
testcase_14 AC 72 ms
76,792 KB
testcase_15 AC 73 ms
77,816 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