結果

問題 No.106 素数が嫌い!2
ユーザー TawaraTawara
提出日時 2015-09-15 18:20:16
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,910 ms / 5,000 ms
コード長 262 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 6,656 KB
実行使用メモリ 68,300 KB
最終ジャッジ日時 2023-09-26 12:05:59
合計ジャッジ時間 14,529 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 926 ms
29,056 KB
testcase_01 AC 11 ms
5,996 KB
testcase_02 AC 12 ms
5,856 KB
testcase_03 AC 11 ms
5,996 KB
testcase_04 AC 933 ms
29,652 KB
testcase_05 AC 1,898 ms
67,260 KB
testcase_06 AC 1,900 ms
68,300 KB
testcase_07 AC 1,886 ms
52,684 KB
testcase_08 AC 104 ms
9,016 KB
testcase_09 AC 112 ms
9,124 KB
testcase_10 AC 1,910 ms
52,584 KB
testcase_11 AC 819 ms
33,292 KB
testcase_12 AC 1,837 ms
55,952 KB
testcase_13 AC 11 ms
5,920 KB
testcase_14 AC 12 ms
5,936 KB
testcase_15 AC 12 ms
5,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,raw_input().split())
fn = [1]*(N+1)
fn[0] = fn[1] = 0
is_p = [True]*(N+1)
for f in xrange(2,N/2+1):
	if not is_p[f]:continue
	d = f*2
	while d <= N:
		if is_p[d]:
			is_p[d] = False
		else:
			fn[d] += 1
		d += f
print len(filter(lambda x:x>=K,fn))
0