結果

問題 No.144 エラトステネスのざる
ユーザー gigurururugigurururu
提出日時 2015-02-06 01:28:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 184 ms / 2,000 ms
コード長 132 bytes
コンパイル時間 715 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 92,964 KB
最終ジャッジ日時 2023-09-05 14:18:22
合計ジャッジ時間 3,921 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,168 KB
testcase_01 AC 77 ms
71,448 KB
testcase_02 AC 78 ms
71,224 KB
testcase_03 AC 76 ms
71,512 KB
testcase_04 AC 75 ms
71,256 KB
testcase_05 AC 75 ms
71,444 KB
testcase_06 AC 81 ms
76,536 KB
testcase_07 AC 81 ms
76,612 KB
testcase_08 AC 81 ms
76,500 KB
testcase_09 AC 81 ms
76,684 KB
testcase_10 AC 81 ms
76,520 KB
testcase_11 AC 80 ms
76,608 KB
testcase_12 AC 82 ms
76,568 KB
testcase_13 AC 175 ms
92,732 KB
testcase_14 AC 180 ms
92,916 KB
testcase_15 AC 174 ms
92,816 KB
testcase_16 AC 184 ms
92,876 KB
testcase_17 AC 183 ms
92,860 KB
testcase_18 AC 183 ms
92,964 KB
testcase_19 AC 178 ms
92,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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