結果

問題 No.144 エラトステネスのざる
ユーザー gigurururugigurururu
提出日時 2015-02-06 22:43:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 120 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 87,196 KB
実行使用メモリ 84,244 KB
最終ジャッジ日時 2023-09-05 14:47:18
合計ジャッジ時間 3,382 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,120 KB
testcase_01 AC 75 ms
71,260 KB
testcase_02 AC 75 ms
71,280 KB
testcase_03 AC 75 ms
71,216 KB
testcase_04 AC 73 ms
71,360 KB
testcase_05 AC 73 ms
71,112 KB
testcase_06 AC 82 ms
75,928 KB
testcase_07 AC 80 ms
75,912 KB
testcase_08 AC 79 ms
76,092 KB
testcase_09 AC 79 ms
75,776 KB
testcase_10 AC 79 ms
75,884 KB
testcase_11 AC 79 ms
75,776 KB
testcase_12 AC 79 ms
75,744 KB
testcase_13 AC 156 ms
83,844 KB
testcase_14 AC 149 ms
83,912 KB
testcase_15 AC 153 ms
83,976 KB
testcase_16 AC 155 ms
84,244 KB
testcase_17 AC 161 ms
84,064 KB
testcase_18 AC 161 ms
83,964 KB
testcase_19 AC 150 ms
83,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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