結果

問題 No.1739 Princess vs. Dragoness (& AoE)
ユーザー 河野竜也河野竜也
提出日時 2022-06-22 16:12:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,029 ms / 3,000 ms
コード長 445 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 108,024 KB
最終ジャッジ日時 2024-04-23 19:30:43
合計ジャッジ時間 33,315 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,736 KB
testcase_01 AC 46 ms
52,736 KB
testcase_02 AC 44 ms
52,480 KB
testcase_03 AC 59 ms
62,336 KB
testcase_04 AC 1,594 ms
107,804 KB
testcase_05 AC 2,029 ms
107,508 KB
testcase_06 AC 1,118 ms
106,608 KB
testcase_07 AC 58 ms
62,208 KB
testcase_08 AC 303 ms
93,404 KB
testcase_09 AC 421 ms
103,280 KB
testcase_10 AC 1,071 ms
89,088 KB
testcase_11 AC 694 ms
84,864 KB
testcase_12 AC 112 ms
76,276 KB
testcase_13 AC 1,029 ms
95,192 KB
testcase_14 AC 1,122 ms
100,404 KB
testcase_15 AC 858 ms
107,628 KB
testcase_16 AC 1,001 ms
84,864 KB
testcase_17 AC 515 ms
92,784 KB
testcase_18 AC 1,081 ms
91,444 KB
testcase_19 AC 295 ms
91,976 KB
testcase_20 AC 219 ms
82,848 KB
testcase_21 AC 547 ms
102,144 KB
testcase_22 AC 845 ms
104,348 KB
testcase_23 AC 1,342 ms
107,788 KB
testcase_24 AC 1,463 ms
107,392 KB
testcase_25 AC 1,592 ms
107,700 KB
testcase_26 AC 1,322 ms
106,976 KB
testcase_27 AC 1,585 ms
107,660 KB
testcase_28 AC 1,350 ms
106,864 KB
testcase_29 AC 1,576 ms
108,024 KB
testcase_30 AC 1,415 ms
107,804 KB
testcase_31 AC 1,641 ms
107,120 KB
testcase_32 AC 1,503 ms
106,752 KB
testcase_33 AC 79 ms
71,492 KB
testcase_34 AC 66 ms
75,520 KB
testcase_35 AC 100 ms
76,160 KB
testcase_36 AC 82 ms
75,776 KB
testcase_37 AC 73 ms
75,776 KB
testcase_38 AC 89 ms
75,904 KB
testcase_39 AC 81 ms
75,520 KB
testcase_40 AC 74 ms
73,472 KB
testcase_41 AC 90 ms
76,416 KB
testcase_42 AC 79 ms
74,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
n,a,b,x,y=map(int,input().split())
h=list(map(int,input().split()))
def check(k):
  c=[]
  for i in range(n):
    c.append(min(0,k-h[i]))
  heapq.heapify(c)

  for i in range(a):
    target=heapq.heappop(c)
    target=min(0,x+target)
    heapq.heappush(c,target)

  if (-1)*sum(c)<=b*y:
    return True
  else:
    return False

ub=10**9
lb=-1
while ub-lb>1:
  mid=(ub+lb)//2
  if check(mid):
    ub=mid
  else:
    lb=mid
print(ub)
0