結果

問題 No.144 エラトステネスのざる
ユーザー roiti46roiti46
提出日時 2015-02-12 00:50:41
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 167 bytes
コンパイル時間 436 ms
コンパイル使用メモリ 6,644 KB
実行使用メモリ 6,016 KB
最終ジャッジ日時 2023-09-05 23:52:10
合計ジャッジ時間 4,444 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,880 KB
testcase_01 AC 11 ms
5,888 KB
testcase_02 AC 11 ms
5,988 KB
testcase_03 AC 11 ms
5,800 KB
testcase_04 AC 11 ms
5,876 KB
testcase_05 AC 12 ms
5,832 KB
testcase_06 AC 12 ms
5,944 KB
testcase_07 AC 12 ms
5,968 KB
testcase_08 AC 13 ms
5,968 KB
testcase_09 AC 13 ms
5,992 KB
testcase_10 AC 13 ms
5,988 KB
testcase_11 AC 12 ms
6,016 KB
testcase_12 AC 13 ms
5,920 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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