結果

問題 No.210 探し物はどこですか?
ユーザー Yukino DX.
提出日時 2023-10-27 15:56:47
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,933 ms / 2,000 ms
コード長 388 bytes
コンパイル時間 381 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-09-25 13:04:12
合計ジャッジ時間 92,578 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq, time

n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))

pq = []
for i in range(n):
    heapq.heappush(pq, (-p[i] * q[i] / 100000, i))

start = time.time()
ans, cnt = 0, 1
while time.time() - start < 1.9:
    pp, id = heapq.heappop(pq)
    ans += -cnt * pp
    cnt += 1
    heapq.heappush(pq, (pp * (1 - q[id] / 100), id))

print(ans)
0