結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,348 KB
testcase_01 AC 75 ms
70,972 KB
testcase_02 AC 75 ms
71,204 KB
testcase_03 AC 80 ms
71,088 KB
testcase_04 AC 77 ms
71,136 KB
testcase_05 AC 74 ms
71,100 KB
testcase_06 AC 79 ms
76,504 KB
testcase_07 AC 79 ms
76,704 KB
testcase_08 AC 78 ms
76,484 KB
testcase_09 AC 77 ms
76,488 KB
testcase_10 AC 78 ms
76,408 KB
testcase_11 AC 79 ms
76,408 KB
testcase_12 AC 77 ms
76,348 KB
testcase_13 AC 148 ms
84,884 KB
testcase_14 AC 152 ms
84,728 KB
testcase_15 AC 153 ms
84,944 KB
testcase_16 AC 166 ms
84,948 KB
testcase_17 AC 156 ms
84,820 KB
testcase_18 AC 161 ms
84,924 KB
testcase_19 AC 157 ms
84,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,P=[float(e)for e in 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