結果

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

ソースコード

diff #

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

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