結果

問題 No.144 エラトステネスのざる
ユーザー cielciel
提出日時 2015-02-08 18:13:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 128 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 84,904 KB
最終ジャッジ日時 2023-09-05 11:01:01
合計ジャッジ時間 3,274 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,264 KB
testcase_01 AC 72 ms
71,168 KB
testcase_02 AC 74 ms
71,440 KB
testcase_03 AC 73 ms
71,164 KB
testcase_04 AC 74 ms
70,972 KB
testcase_05 AC 73 ms
71,128 KB
testcase_06 AC 78 ms
76,428 KB
testcase_07 AC 78 ms
76,408 KB
testcase_08 AC 77 ms
76,240 KB
testcase_09 AC 78 ms
76,620 KB
testcase_10 AC 77 ms
76,380 KB
testcase_11 AC 76 ms
76,352 KB
testcase_12 AC 78 ms
76,556 KB
testcase_13 AC 149 ms
84,884 KB
testcase_14 AC 155 ms
84,688 KB
testcase_15 AC 154 ms
84,720 KB
testcase_16 AC 153 ms
84,904 KB
testcase_17 AC 153 ms
84,748 KB
testcase_18 AC 162 ms
84,852 KB
testcase_19 AC 154 ms
84,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,P=map(float,input().split())
M=int(N)+1
h=[1.]*M
r=0
for i in range(2,M):
	r+=h[i]
	for j in range(i*2,M,i):h[j]*=1-P
print(r)
0