結果

問題 No.1739 Princess vs. Dragoness (& AoE)
ユーザー lloyzlloyz
提出日時 2021-11-12 23:18:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,117 ms / 3,000 ms
コード長 505 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 104,700 KB
最終ジャッジ日時 2023-08-17 03:53:23
合計ジャッジ時間 38,744 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,116 KB
testcase_01 AC 77 ms
71,236 KB
testcase_02 AC 75 ms
71,252 KB
testcase_03 AC 89 ms
76,500 KB
testcase_04 AC 1,581 ms
104,560 KB
testcase_05 AC 2,024 ms
103,924 KB
testcase_06 AC 1,115 ms
102,444 KB
testcase_07 AC 90 ms
76,488 KB
testcase_08 AC 311 ms
91,940 KB
testcase_09 AC 414 ms
99,392 KB
testcase_10 AC 1,084 ms
89,156 KB
testcase_11 AC 701 ms
85,160 KB
testcase_12 AC 130 ms
78,160 KB
testcase_13 AC 1,036 ms
94,264 KB
testcase_14 AC 1,288 ms
97,764 KB
testcase_15 AC 1,074 ms
104,700 KB
testcase_16 AC 1,250 ms
85,716 KB
testcase_17 AC 654 ms
91,484 KB
testcase_18 AC 1,364 ms
91,088 KB
testcase_19 AC 370 ms
91,764 KB
testcase_20 AC 270 ms
82,812 KB
testcase_21 AC 675 ms
99,676 KB
testcase_22 AC 1,053 ms
101,724 KB
testcase_23 AC 1,692 ms
103,912 KB
testcase_24 AC 1,862 ms
103,860 KB
testcase_25 AC 2,117 ms
103,640 KB
testcase_26 AC 1,667 ms
102,244 KB
testcase_27 AC 2,101 ms
104,420 KB
testcase_28 AC 1,668 ms
102,996 KB
testcase_29 AC 2,066 ms
103,844 KB
testcase_30 AC 1,813 ms
104,604 KB
testcase_31 AC 1,686 ms
103,744 KB
testcase_32 AC 1,917 ms
103,792 KB
testcase_33 AC 109 ms
77,852 KB
testcase_34 AC 91 ms
76,844 KB
testcase_35 AC 120 ms
77,800 KB
testcase_36 AC 120 ms
77,180 KB
testcase_37 AC 103 ms
77,296 KB
testcase_38 AC 117 ms
77,592 KB
testcase_39 AC 111 ms
77,140 KB
testcase_40 AC 107 ms
77,180 KB
testcase_41 AC 120 ms
77,308 KB
testcase_42 AC 113 ms
77,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heapify, heappop, heappush

n, a, b, x, y = map(int, input().split())
H = list(map(int, input().split()))

left = -1
right = 10**9
while right - left > 1:
    mid = (left + right) // 2
    Hc = [0 for _ in range(n)]
    for i in range(n):
        Hc[i] = min(0, mid - H[i])
    heapify(Hc)
    for i in range(a):
        curr = heappop(Hc)
        curr = min(0, curr + x)
        heappush(Hc, curr)
    if -sum(Hc) <= b * y:
        right = mid
    else:
        left = mid
print(right)
0