結果

問題 No.210 探し物はどこですか?
ユーザー roiti46
提出日時 2015-10-06 00:25:43
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 435 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 77,072 KB
実行使用メモリ 82,784 KB
最終ジャッジ日時 2024-07-20 01:33:33
合計ジャッジ時間 16,005 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 42 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
n = int(raw_input())
p = map(float, raw_input().split())
q = map(float, raw_input().split())
q = [q[i] / 100. for i in xrange(n)]

que = [[-p[i] * q[i], i] for i in xrange(n)]
heapq.heapify(que)
_ans, ans = -1.0, 0.0
i = 1
while ans - _ans > 1e-2:
    _ans = ans
    pq, j = heapq.heappop(que)
    ans += -i * pq
    p[j] *= (1.0 - q[j])
    heapq.heappush(que, [-p[j] * q[j], j])
    i += 1
print "%.10f" % (ans / 1000.)
0