結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 648 ms
60,636 KB
testcase_02 AC 646 ms
60,804 KB
testcase_03 AC 614 ms
60,756 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 761 ms
60,592 KB
testcase_07 AC 743 ms
60,896 KB
testcase_08 WA -
testcase_09 AC 625 ms
60,704 KB
testcase_10 AC 758 ms
60,712 KB
testcase_11 AC 653 ms
60,500 KB
testcase_12 WA -
testcase_13 AC 609 ms
60,732 KB
testcase_14 AC 585 ms
60,960 KB
testcase_15 AC 559 ms
60,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

R = 2000002
p = [1]*R
c = [0]*R
p[0] = p[1] = 0
for i in xrange(2,int(R**0.5)):
    if p[i]:
        p[2*i::i] = [0]*len(p[2*i::i])
        c[i::i] = [j+1 for j in c[i::i]]

N,K = map(int,raw_input().split())
print sum(c[i] >= K for i in xrange(2,N+1))
0