結果
問題 |
No.210 探し物はどこですか?
|
ユーザー |
![]() |
提出日時 | 2015-04-07 19:45:31 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 813 bytes |
コンパイル時間 | 39 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 7,552 KB |
最終ジャッジ日時 | 2024-07-04 10:50:28 |
合計ジャッジ時間 | 2,329 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 43 |
ソースコード
from Queue import * # Queue, LifoQueue, PriorityQueue from bisect import * #bisect, insort from collections import * #deque, Counter,OrderedDict,defaultdict #set([]) import math import copy import itertools import string import sys myread = lambda : map(float,raw_input().split()) def solver(): N = int(raw_input()) P = myread() Q = myread() que = PriorityQueue(N) for i in xrange(N): que.put((P[i]*Q[i],i)) times = 0 ans = 0.0 e = 0.1 ** 8 while not(que.empty()): t = que.get() p = t[0] now = t[1] if times >= 1000000: break ans += p * times times += 1 if p * (1- Q[now]) > e: que.put((p*(1-Q[now]),now)) print "%.8f" % ans if __name__ == "__main__": solver()