結果
| 問題 |
No.210 探し物はどこですか?
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2020-12-18 20:47:03 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 388 bytes |
| コンパイル時間 | 220 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 88,720 KB |
| 最終ジャッジ日時 | 2024-09-21 09:20:04 |
| 合計ジャッジ時間 | 35,260 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 TLE * 25 |
ソースコード
n = int(input())
*p, = map(int,input().split())
*q, = map(int,input().split())
s = 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
for i in range(1,5000000):
prob,idx = heappop(hq)
heappush(hq,(prob*(1.0-q[idx]),idx))
ans -= i*prob
print(ans)
convexineq