結果

問題 No.144 エラトステネスのざる
ユーザー cielciel
提出日時 2015-02-08 18:05:04
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 177 bytes
コンパイル時間 2,065 ms
コンパイル使用メモリ 77,676 KB
実行使用メモリ 253,916 KB
最終ジャッジ日時 2023-09-05 15:30:57
合計ジャッジ時間 7,149 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
82,176 KB
testcase_01 AC 83 ms
78,092 KB
testcase_02 AC 83 ms
78,032 KB
testcase_03 AC 82 ms
78,032 KB
testcase_04 AC 83 ms
78,300 KB
testcase_05 AC 83 ms
77,828 KB
testcase_06 AC 97 ms
79,908 KB
testcase_07 AC 91 ms
79,816 KB
testcase_08 AC 93 ms
79,848 KB
testcase_09 AC 91 ms
79,744 KB
testcase_10 AC 90 ms
79,900 KB
testcase_11 AC 91 ms
79,764 KB
testcase_12 AC 91 ms
79,816 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

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