結果

問題 No.144 エラトステネスのざる
ユーザー ciel
提出日時 2015-02-08 18:05:04
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 177 bytes
コンパイル時間 1,228 ms
コンパイル使用メモリ 76,832 KB
実行使用メモリ 259,344 KB
最終ジャッジ日時 2024-06-23 11:03:35
合計ジャッジ時間 6,394 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 TLE * 1 -- * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict as D
N,P=raw_input().split()
h=D(lambda:1)
r=0
for i in range(2,int(N)+1):
	r+=h[i]
	for j in range(i*2,int(N)+1,i):h[j]*=1-float(P)
print(r)
0