結果

問題 No.1739 Princess vs. Dragoness (& AoE)
ユーザー puznekopuzneko
提出日時 2021-11-24 23:45:47
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 605 bytes
コンパイル時間 456 ms
コンパイル使用メモリ 86,844 KB
実行使用メモリ 141,180 KB
最終ジャッジ日時 2023-09-09 16:38:07
合計ジャッジ時間 53,725 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,248 KB
testcase_01 AC 76 ms
71,376 KB
testcase_02 AC 75 ms
71,264 KB
testcase_03 AC 88 ms
75,648 KB
testcase_04 AC 1,912 ms
124,068 KB
testcase_05 TLE -
testcase_06 AC 645 ms
120,320 KB
testcase_07 AC 81 ms
75,760 KB
testcase_08 AC 901 ms
104,944 KB
testcase_09 AC 1,054 ms
115,132 KB
testcase_10 AC 985 ms
87,540 KB
testcase_11 AC 628 ms
89,724 KB
testcase_12 AC 134 ms
78,020 KB
testcase_13 AC 1,181 ms
109,404 KB
testcase_14 AC 1,993 ms
116,732 KB
testcase_15 AC 1,701 ms
132,028 KB
testcase_16 AC 1,385 ms
88,308 KB
testcase_17 AC 928 ms
101,980 KB
testcase_18 AC 1,576 ms
92,856 KB
testcase_19 AC 328 ms
84,552 KB
testcase_20 AC 482 ms
84,132 KB
testcase_21 AC 813 ms
99,984 KB
testcase_22 AC 1,610 ms
124,208 KB
testcase_23 AC 1,756 ms
133,556 KB
testcase_24 TLE -
testcase_25 AC 2,869 ms
124,312 KB
testcase_26 AC 1,928 ms
137,464 KB
testcase_27 TLE -
testcase_28 AC 2,011 ms
139,264 KB
testcase_29 TLE -
testcase_30 AC 2,093 ms
130,600 KB
testcase_31 AC 2,200 ms
139,268 KB
testcase_32 TLE -
testcase_33 AC 130 ms
77,728 KB
testcase_34 AC 84 ms
75,660 KB
testcase_35 AC 122 ms
77,684 KB
testcase_36 AC 118 ms
77,024 KB
testcase_37 RE -
testcase_38 AC 136 ms
77,732 KB
testcase_39 AC 125 ms
77,712 KB
testcase_40 AC 111 ms
76,972 KB
testcase_41 AC 131 ms
77,684 KB
testcase_42 AC 120 ms
77,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
from heapq import heappush, heappop

n, a, b, x, y, *h = map(int, stdin.read().split())
left = -1
right = 10**9+1
while right - left >= 2:
    mid = (right + left) // 2
    hq = []
    for i in range(n):
        if h[i] - mid > 0:
            heappush(hq, -(h[i]-mid))
    for i in range(a):
        if hq:
            now = -heappop(hq)
            if now > x:
                kari = now - x
                heappush(hq, -kari)
    kari = 0
    while hq:
        kari += -heappop(hq)
    if kari <= b * y:
        right = mid
    else:
        left = mid

print("{}".format(right))
0