結果

問題 No.144 エラトステネスのざる
ユーザー gigurururugigurururu
提出日時 2015-02-06 21:50:51
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 1,275 ms / 2,000 ms
コード長 118 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 85,208 KB
最終ジャッジ日時 2023-09-05 14:52:35
合計ジャッジ時間 11,257 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,312 KB
testcase_01 AC 75 ms
71,064 KB
testcase_02 AC 76 ms
71,128 KB
testcase_03 AC 75 ms
71,296 KB
testcase_04 AC 76 ms
71,336 KB
testcase_05 AC 76 ms
71,144 KB
testcase_06 AC 83 ms
76,472 KB
testcase_07 AC 82 ms
76,512 KB
testcase_08 AC 82 ms
76,608 KB
testcase_09 AC 84 ms
76,616 KB
testcase_10 AC 82 ms
76,440 KB
testcase_11 AC 83 ms
76,588 KB
testcase_12 AC 84 ms
76,732 KB
testcase_13 AC 1,148 ms
84,964 KB
testcase_14 AC 1,226 ms
85,200 KB
testcase_15 AC 1,275 ms
84,908 KB
testcase_16 AC 1,254 ms
85,012 KB
testcase_17 AC 1,258 ms
84,964 KB
testcase_18 AC 1,263 ms
84,824 KB
testcase_19 AC 1,244 ms
85,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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