結果

問題 No.106 素数が嫌い!2
ユーザー TawaraTawara
提出日時 2015-09-15 18:19:33
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 260 bytes
コンパイル時間 1,346 ms
コンパイル使用メモリ 77,056 KB
実行使用メモリ 119,800 KB
最終ジャッジ日時 2023-09-26 12:05:44
合計ジャッジ時間 4,890 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 194 ms
102,192 KB
testcase_01 WA -
testcase_02 AC 76 ms
76,064 KB
testcase_03 AC 76 ms
76,496 KB
testcase_04 AC 189 ms
101,500 KB
testcase_05 AC 320 ms
111,756 KB
testcase_06 AC 307 ms
110,152 KB
testcase_07 AC 306 ms
109,816 KB
testcase_08 AC 97 ms
81,848 KB
testcase_09 AC 95 ms
80,944 KB
testcase_10 AC 306 ms
109,728 KB
testcase_11 AC 158 ms
92,452 KB
testcase_12 AC 320 ms
119,800 KB
testcase_13 AC 77 ms
75,868 KB
testcase_14 AC 76 ms
76,460 KB
testcase_15 AC 79 ms
77,180 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):
	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