結果
| 問題 |
No.1739 Princess vs. Dragoness (& AoE)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-12 23:14:55 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 530 bytes |
| コンパイル時間 | 458 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 43,400 KB |
| 最終ジャッジ日時 | 2024-11-25 21:27:18 |
| 合計ジャッジ時間 | 88,231 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 WA * 8 TLE * 19 |
ソースコード
from heapq import heapify, heappop, heappush
n, a, b, x, y = map(int, input().split())
H = list(map(int, input().split()))
left = 0
right = 10**9 + 1
while right - left > 1:
mid = (left + right) // 2
Hc = [0 for _ in range(n)]
for i in range(n):
Hc[i] = min(0, mid - H[i])
heapify(Hc)
for i in range(a):
curr = heappop(Hc)
curr = min(0, curr + x)
heappush(Hc, curr)
if -sum(Hc) <= b * y:
right = mid
else:
left = mid
print(right)