結果

問題 No.210 探し物はどこですか?
ユーザー roiti46
提出日時 2015-10-06 00:24:52
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 435 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 77,056 KB
実行使用メモリ 89,388 KB
最終ジャッジ日時 2024-07-20 01:31:23
合計ジャッジ時間 20,661 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 42 TLE * 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-3:
    _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