結果

問題 No.144 エラトステネスのざる
ユーザー gigurururugigurururu
提出日時 2015-02-06 22:43:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 120 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 82,180 KB
実行使用メモリ 69,500 KB
最終ジャッジ日時 2024-06-23 10:24:41
合計ジャッジ時間 2,247 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,160 KB
testcase_01 AC 34 ms
52,192 KB
testcase_02 AC 34 ms
52,800 KB
testcase_03 AC 34 ms
53,304 KB
testcase_04 AC 35 ms
53,356 KB
testcase_05 AC 35 ms
52,420 KB
testcase_06 AC 40 ms
58,316 KB
testcase_07 AC 39 ms
59,648 KB
testcase_08 AC 39 ms
58,444 KB
testcase_09 AC 38 ms
58,732 KB
testcase_10 AC 38 ms
58,556 KB
testcase_11 AC 40 ms
59,736 KB
testcase_12 AC 40 ms
58,532 KB
testcase_13 AC 103 ms
68,668 KB
testcase_14 AC 104 ms
69,004 KB
testcase_15 AC 103 ms
69,500 KB
testcase_16 AC 107 ms
67,876 KB
testcase_17 AC 104 ms
67,668 KB
testcase_18 AC 107 ms
68,284 KB
testcase_19 AC 103 ms
69,392 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