結果
問題 |
No.106 素数が嫌い!2
|
ユーザー |
![]() |
提出日時 | 2015-09-15 18:11:16 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 288 bytes |
コンパイル時間 | 44 ms |
コンパイル使用メモリ | 6,784 KB |
実行使用メモリ | 68,736 KB |
最終ジャッジ日時 | 2024-07-19 06:37:20 |
合計ジャッジ時間 | 9,550 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 WA * 5 |
ソースコード
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))