結果
問題 |
No.210 探し物はどこですか?
|
ユーザー |
![]() |
提出日時 | 2015-04-07 19:56:20 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 885 bytes |
コンパイル時間 | 135 ms |
コンパイル使用メモリ | 7,168 KB |
実行使用メモリ | 7,552 KB |
最終ジャッジ日時 | 2024-07-04 10:52:26 |
合計ジャッジ時間 | 18,503 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 WA * 12 |
ソースコード
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() for i in xrange(N): P[i] /= 1000 Q[i] /= 100 que = PriorityQueue(N) for i in xrange(N): que.put((-P[i]*Q[i],i)) times = 1 ans = 0.0 e = 0.1 ** 16 while not(que.empty()): t = que.get() p = t[0] now = t[1] if times >= 100000: 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()