結果
| 問題 |
No.210 探し物はどこですか?
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2020-12-18 20:49:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 675 ms / 2,000 ms |
| コード長 | 392 bytes |
| コンパイル時間 | 157 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 80,304 KB |
| 最終ジャッジ日時 | 2024-09-21 09:21:50 |
| 合計ジャッジ時間 | 24,677 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 43 |
ソースコード
n = int(input())
*p, = map(int,input().split())
*q, = map(int,input().split())
s = 0.0
for i in range(n):
p[i] /= 1000
q[i] /= 100
s += p[i]*q[i]
from heapq import *
hq = [(-pi*qi,i) for i,(pi,qi) in enumerate(zip(p,q))]
heapify(hq)
ans = 0.0
for i in range(1,1000000):
prob,idx = heappop(hq)
heappush(hq,(prob*(1.0-q[idx]),idx))
ans -= i*prob
print(ans)
convexineq