結果
問題 | No.210 探し物はどこですか? |
ユーザー |
![]() |
提出日時 | 2020-03-20 00:25:31 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,674 ms / 2,000 ms |
コード長 | 526 bytes |
コンパイル時間 | 303 ms |
コンパイル使用メモリ | 81,900 KB |
実行使用メモリ | 83,780 KB |
最終ジャッジ日時 | 2024-12-14 03:40:48 |
合計ジャッジ時間 | 15,751 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
#!/usr/bin/ python3.8import sysread = sys.stdin.buffer.readreadline = sys.stdin.buffer.readlinereadlines = sys.stdin.buffer.readlinesfrom heapq import heapify, heappushpopN = int(readline())P = [int(x) / 1000 for x in readline().split()]Q = [int(x) / 100 for x in readline().split()]hq = [(-p*q, p, q) for p, q in zip(P, Q)]heapify(hq)S = 1.0n = 0answer = 0while S > 1e-9:n += 1x, p, q = hq[0]answer += n * (-x)S += xp *= (1 - q)heappushpop(hq, (-p * q, p, q))print(answer)