結果

問題 No.210 探し物はどこですか?
ユーザー autotaker1984
提出日時 2015-04-07 19:49:28
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 877 bytes
コンパイル時間 47 ms
コンパイル使用メモリ 7,168 KB
実行使用メモリ 7,424 KB
最終ジャッジ日時 2024-07-04 10:50:42
合計ジャッジ時間 3,990 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other WA * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

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 ** 8
    while not(que.empty()):
        t = que.get()
        p = t[0]
        now = t[1]
        if times >= 10000:
            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()
    


0