結果
問題 |
No.1739 Princess vs. Dragoness (& AoE)
|
ユーザー |
|
提出日時 | 2021-11-12 22:40:30 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 594 bytes |
コンパイル時間 | 277 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 97,024 KB |
最終ジャッジ日時 | 2024-11-25 20:14:51 |
合計ジャッジ時間 | 7,616 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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()