結果
| 問題 | No.1739 Princess vs. Dragoness (& AoE) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-12 22:40:30 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 594 bytes |
| 記録 | |
| コンパイル時間 | 391 ms |
| コンパイル使用メモリ | 85,504 KB |
| 実行使用メモリ | 101,888 KB |
| 最終ジャッジ日時 | 2026-05-20 10:08:17 |
| 合計ジャッジ時間 | 6,108 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 14 WA * 26 |
ソースコード
def main():
from heapq import heapify,heappush,heappop
n,A,b,x,y = map(int,input().split())
H = list(map(int,input().split()))
ng,ok = -1,1
while ok-ng > 1:
mid = (ok+ng)>>1
a = A
h = list(map(lambda x: (x-mid)*-1,H))
heapify(h)
while a:
v = heappop(h)*-1
if v <= 0:
break
heappush(h,(v-x)*-1)
a -= 1
s = 0
while h:
s += max(0, heappop(h)*-1)
if s <= y*b:
ok = mid
else:
ng = mid
print(ok)
main()