結果
問題 | No.1739 Princess vs. Dragoness (& AoE) |
ユーザー |
|
提出日時 | 2021-11-13 16:10:41 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 377 bytes |
コンパイル時間 | 77 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 43,140 KB |
最終ジャッジ日時 | 2024-11-27 12:56:02 |
合計ジャッジ時間 | 80,105 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 TLE * 13 |
ソースコード
from heapq import * n, a, b, x, y = map(int, input().split()) h = list(map(int, input().split())) def ok(X): h2 = [min(0, X - h[i]) for i in range(n)] heapify(h2) for i in range(a): ma = min(0, heappop(h2) + x) heappush(h2, ma) return True if sum(h2) * -1 <= b * y else False l, r = -1, 10 ** 9 while r - l > 1: m = (l + r) // 2 if ok(m): r = m else: l = m print(r)