結果
問題 |
No.210 探し物はどこですか?
|
ユーザー |
|
提出日時 | 2015-10-06 00:41:03 |
言語 | PyPy2 (7.3.15) |
結果 |
AC
|
実行時間 | 651 ms / 2,000 ms |
コード長 | 410 bytes |
コンパイル時間 | 176 ms |
コンパイル使用メモリ | 76,920 KB |
実行使用メモリ | 82,572 KB |
最終ジャッジ日時 | 2024-07-20 01:37:16 |
合計ジャッジ時間 | 12,093 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
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 > 5e-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