結果

問題 No.106 素数が嫌い!2
ユーザー TawaraTawara
提出日時 2015-09-15 18:11:16
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 288 bytes
コンパイル時間 758 ms
コンパイル使用メモリ 7,124 KB
実行使用メモリ 68,248 KB
最終ジャッジ日時 2023-09-26 12:05:27
合計ジャッジ時間 11,617 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 680 ms
29,136 KB
testcase_01 WA -
testcase_02 AC 12 ms
5,976 KB
testcase_03 AC 12 ms
6,024 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1,393 ms
68,248 KB
testcase_07 AC 1,383 ms
52,488 KB
testcase_08 WA -
testcase_09 AC 88 ms
9,056 KB
testcase_10 AC 1,379 ms
52,564 KB
testcase_11 AC 593 ms
33,248 KB
testcase_12 WA -
testcase_13 AC 12 ms
5,952 KB
testcase_14 AC 11 ms
5,904 KB
testcase_15 AC 12 ms
6,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
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,int(math.sqrt(N))+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