結果
| 問題 | No.210 探し物はどこですか? |
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-03-20 00:26:45 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1,852 ms / 2,000 ms |
| + 616µs | |
| コード長 | 511 bytes |
| 記録 | |
| コンパイル時間 | 53 ms |
| コンパイル使用メモリ | 14,592 KB |
| 実行使用メモリ | 11,648 KB |
| 最終ジャッジ日時 | 2026-10-19 15:48:24 |
| 合計ジャッジ時間 | 14,687 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 44 |
ソースコード
#!/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)
maspy