結果

問題 No.1739 Princess vs. Dragoness (& AoE)
ユーザー googol_S0googol_S0
提出日時 2021-11-12 21:41:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,468 ms / 3,000 ms
コード長 421 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 144,400 KB
最終ジャッジ日時 2024-05-04 07:54:55
合計ジャッジ時間 44,586 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,608 KB
testcase_01 AC 35 ms
52,992 KB
testcase_02 AC 36 ms
53,632 KB
testcase_03 AC 44 ms
62,464 KB
testcase_04 AC 1,777 ms
139,840 KB
testcase_05 AC 2,468 ms
143,944 KB
testcase_06 AC 1,159 ms
120,880 KB
testcase_07 AC 46 ms
61,952 KB
testcase_08 AC 747 ms
106,008 KB
testcase_09 AC 1,087 ms
131,864 KB
testcase_10 AC 988 ms
92,928 KB
testcase_11 AC 644 ms
88,448 KB
testcase_12 AC 118 ms
76,844 KB
testcase_13 AC 1,073 ms
108,056 KB
testcase_14 AC 1,726 ms
123,988 KB
testcase_15 AC 1,730 ms
143,644 KB
testcase_16 AC 1,218 ms
89,216 KB
testcase_17 AC 807 ms
98,712 KB
testcase_18 AC 1,354 ms
100,100 KB
testcase_19 AC 417 ms
97,292 KB
testcase_20 AC 361 ms
83,968 KB
testcase_21 AC 1,142 ms
128,908 KB
testcase_22 AC 1,510 ms
132,064 KB
testcase_23 AC 2,280 ms
142,796 KB
testcase_24 AC 2,403 ms
141,644 KB
testcase_25 AC 2,398 ms
144,080 KB
testcase_26 AC 1,823 ms
137,288 KB
testcase_27 AC 2,402 ms
144,192 KB
testcase_28 AC 1,849 ms
138,564 KB
testcase_29 AC 2,419 ms
144,400 KB
testcase_30 AC 1,963 ms
142,016 KB
testcase_31 AC 1,909 ms
142,084 KB
testcase_32 AC 2,388 ms
141,520 KB
testcase_33 AC 78 ms
76,288 KB
testcase_34 AC 53 ms
75,392 KB
testcase_35 AC 81 ms
76,328 KB
testcase_36 AC 76 ms
76,416 KB
testcase_37 AC 65 ms
75,648 KB
testcase_38 AC 84 ms
76,160 KB
testcase_39 AC 89 ms
76,228 KB
testcase_40 AC 71 ms
75,648 KB
testcase_41 AC 87 ms
76,544 KB
testcase_42 AC 74 ms
75,776 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