結果

問題 No.144 エラトステネスのざる
ユーザー cielciel
提出日時 2015-02-08 18:09:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 217 ms / 2,000 ms
コード長 145 bytes
コンパイル時間 629 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 92,588 KB
最終ジャッジ日時 2023-09-05 10:59:33
合計ジャッジ時間 4,257 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,352 KB
testcase_01 AC 72 ms
71,184 KB
testcase_02 AC 73 ms
71,412 KB
testcase_03 AC 72 ms
71,288 KB
testcase_04 AC 74 ms
71,100 KB
testcase_05 AC 73 ms
71,152 KB
testcase_06 AC 80 ms
76,424 KB
testcase_07 AC 80 ms
76,572 KB
testcase_08 AC 80 ms
76,384 KB
testcase_09 AC 80 ms
76,468 KB
testcase_10 AC 80 ms
76,568 KB
testcase_11 AC 80 ms
76,384 KB
testcase_12 AC 78 ms
76,512 KB
testcase_13 AC 195 ms
92,552 KB
testcase_14 AC 207 ms
92,588 KB
testcase_15 AC 216 ms
92,588 KB
testcase_16 AC 203 ms
92,364 KB
testcase_17 AC 204 ms
92,568 KB
testcase_18 AC 217 ms
92,480 KB
testcase_19 AC 212 ms
92,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,P=[float(e)for e in input().split()]
h=[1]*int(N+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-P
print(r)
0