結果

問題 No.1739 Princess vs. Dragoness (& AoE)
ユーザー Eki1009Eki1009
提出日時 2021-11-12 21:37:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 648 ms / 3,000 ms
コード長 464 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 82,668 KB
実行使用メモリ 190,920 KB
最終ジャッジ日時 2024-05-04 07:43:18
合計ジャッジ時間 13,878 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
54,100 KB
testcase_01 AC 34 ms
52,836 KB
testcase_02 AC 34 ms
52,064 KB
testcase_03 AC 33 ms
54,148 KB
testcase_04 AC 510 ms
105,024 KB
testcase_05 AC 616 ms
125,804 KB
testcase_06 AC 255 ms
190,920 KB
testcase_07 AC 36 ms
52,824 KB
testcase_08 AC 338 ms
108,796 KB
testcase_09 AC 434 ms
113,368 KB
testcase_10 AC 181 ms
85,868 KB
testcase_11 AC 197 ms
85,512 KB
testcase_12 AC 47 ms
65,892 KB
testcase_13 AC 397 ms
138,756 KB
testcase_14 AC 424 ms
111,552 KB
testcase_15 AC 564 ms
170,896 KB
testcase_16 AC 183 ms
89,460 KB
testcase_17 AC 297 ms
118,176 KB
testcase_18 AC 230 ms
90,672 KB
testcase_19 AC 119 ms
84,488 KB
testcase_20 AC 167 ms
83,400 KB
testcase_21 AC 329 ms
112,344 KB
testcase_22 AC 489 ms
152,512 KB
testcase_23 AC 618 ms
169,000 KB
testcase_24 AC 636 ms
162,476 KB
testcase_25 AC 505 ms
109,464 KB
testcase_26 AC 648 ms
183,636 KB
testcase_27 AC 565 ms
111,548 KB
testcase_28 AC 600 ms
177,904 KB
testcase_29 AC 553 ms
111,132 KB
testcase_30 AC 574 ms
169,228 KB
testcase_31 AC 643 ms
184,008 KB
testcase_32 AC 574 ms
123,224 KB
testcase_33 AC 39 ms
60,992 KB
testcase_34 AC 33 ms
52,612 KB
testcase_35 AC 38 ms
61,192 KB
testcase_36 AC 33 ms
52,976 KB
testcase_37 AC 34 ms
52,824 KB
testcase_38 AC 43 ms
61,936 KB
testcase_39 AC 42 ms
61,528 KB
testcase_40 AC 40 ms
60,452 KB
testcase_41 AC 41 ms
61,412 KB
testcase_42 AC 40 ms
61,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

_n,_a,_b,_x,_y,*H = map(int,open(0).read().split())
def f(k):
    n,a,b,x,y = _n,_a,_b,_x,_y
    y *= b
    L = []
    for h in H:
        h -= k
        if h <= 0:
            continue
        m = min(a,h//x)
        h -= x*m
        a -= m
        L.append(h)
    L.sort()
    while L and a:
        L.pop()
        a -= 1
    return sum(L) <= y
ng,ok = -1,max(H)
while ok-ng > 1:
    k = (ok+ng)//2
    if f(k):
        ok = k
    else:
        ng = k
print(ok)
0