結果

問題 No.210 探し物はどこですか?
ユーザー maspy
提出日時 2020-03-20 00:26:45
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 511 bytes
コンパイル時間 204 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-12-14 03:41:19
合計ジャッジ時間 20,137 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 42 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from heapq import heapify, heappushpop

N = int(readline())
P = [int(x) / 1000 for x in readline().split()]
Q = [int(x) / 100 for x in readline().split()]

hq = [(-p * q, q) for p, q in zip(P, Q)]
heapify(hq)

S = 1.0
n = 0
answer = 0
while S > 1e-9:
    n += 1
    x, q = hq[0]
    answer += n * (-x)
    S += x
    x *= (1 - q)
    heappushpop(hq, (x, q))

print(answer)
0