結果

問題 No.1739 Princess vs. Dragoness (& AoE)
ユーザー googol_S0googol_S0
提出日時 2021-11-12 21:41:39
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 421 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 147,364 KB
最終ジャッジ日時 2023-08-17 00:35:28
合計ジャッジ時間 56,361 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,420 KB
testcase_01 AC 75 ms
71,524 KB
testcase_02 AC 76 ms
71,156 KB
testcase_03 AC 85 ms
76,100 KB
testcase_04 AC 2,277 ms
140,820 KB
testcase_05 TLE -
testcase_06 AC 1,450 ms
122,792 KB
testcase_07 AC 88 ms
76,188 KB
testcase_08 AC 928 ms
107,388 KB
testcase_09 AC 1,319 ms
133,060 KB
testcase_10 AC 1,194 ms
96,348 KB
testcase_11 AC 814 ms
89,764 KB
testcase_12 AC 168 ms
78,336 KB
testcase_13 AC 1,350 ms
109,444 KB
testcase_14 AC 2,051 ms
127,796 KB
testcase_15 AC 2,133 ms
145,304 KB
testcase_16 AC 1,411 ms
91,116 KB
testcase_17 AC 995 ms
105,460 KB
testcase_18 AC 1,680 ms
100,980 KB
testcase_19 AC 541 ms
97,576 KB
testcase_20 AC 462 ms
85,444 KB
testcase_21 AC 1,450 ms
133,096 KB
testcase_22 AC 1,780 ms
132,628 KB
testcase_23 AC 2,795 ms
147,364 KB
testcase_24 AC 2,967 ms
147,352 KB
testcase_25 TLE -
testcase_26 AC 2,329 ms
138,948 KB
testcase_27 TLE -
testcase_28 AC 2,326 ms
136,916 KB
testcase_29 TLE -
testcase_30 AC 2,450 ms
141,224 KB
testcase_31 AC 2,418 ms
136,972 KB
testcase_32 AC 2,908 ms
143,320 KB
testcase_33 AC 122 ms
77,856 KB
testcase_34 AC 89 ms
76,980 KB
testcase_35 AC 124 ms
78,116 KB
testcase_36 AC 114 ms
77,424 KB
testcase_37 AC 104 ms
77,148 KB
testcase_38 AC 128 ms
78,140 KB
testcase_39 AC 129 ms
77,816 KB
testcase_40 AC 111 ms
77,608 KB
testcase_41 AC 131 ms
77,876 KB
testcase_42 AC 119 ms
77,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,A,B,X,Y=map(int,input().split())
H=list(map(int,input().split()))
L,R=0,10**9
from heapq import *
def f(m):
  Q=[]
  heapify(Q)
  for i in range(N):
    heappush(Q,-max(0,H[i]-m))
  for i in range(A):
    x=heappop(Q)
    x=-x
    heappush(Q,-max(0,x-X))
  s=0
  while len(Q):
    s-=heappop(Q)
  if s<=B*Y:
    return 1
  else:
    return 0

while L<R:
  M=(L+R)>>1
  if f(M):
    R=M
  else:
    L=max(L+1,M)
print(L)
0