結果
問題 | No.210 探し物はどこですか? |
ユーザー |
|
提出日時 | 2015-05-18 01:27:47 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 865 ms / 2,000 ms |
コード長 | 298 bytes |
コンパイル時間 | 283 ms |
コンパイル使用メモリ | 82,424 KB |
実行使用メモリ | 80,976 KB |
最終ジャッジ日時 | 2024-12-23 14:13:18 |
合計ジャッジ時間 | 9,307 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
import heapq _ = input() P = map(int, input().split()) Q = map(int, input().split()) PQ = [(-p*q*10**-5, p/1000.0, 1-q/100.0) for p, q in zip(P, Q) if p] PQ.sort() c = f = s = 1 while f > 10**-5: pq, p, q = PQ[0] f *= 1 + pq/s c += f s += pq heapq.heapreplace(PQ, (pq*q, p*q, q)) print(c)