結果

問題 No.1739 Princess vs. Dragoness (& AoE)
ユーザー Eki1009Eki1009
提出日時 2021-11-12 21:37:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 685 ms / 3,000 ms
コード長 464 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 198,752 KB
最終ジャッジ日時 2023-08-17 00:21:27
合計ジャッジ時間 16,656 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,168 KB
testcase_01 AC 74 ms
71,312 KB
testcase_02 AC 69 ms
71,368 KB
testcase_03 AC 70 ms
71,432 KB
testcase_04 AC 588 ms
106,544 KB
testcase_05 AC 685 ms
126,912 KB
testcase_06 AC 292 ms
198,752 KB
testcase_07 AC 69 ms
71,420 KB
testcase_08 AC 392 ms
110,112 KB
testcase_09 AC 469 ms
114,624 KB
testcase_10 AC 220 ms
87,456 KB
testcase_11 AC 237 ms
86,528 KB
testcase_12 AC 81 ms
76,240 KB
testcase_13 AC 448 ms
136,284 KB
testcase_14 AC 495 ms
112,672 KB
testcase_15 AC 632 ms
172,376 KB
testcase_16 AC 230 ms
89,472 KB
testcase_17 AC 366 ms
116,948 KB
testcase_18 AC 278 ms
93,572 KB
testcase_19 AC 155 ms
85,740 KB
testcase_20 AC 205 ms
84,748 KB
testcase_21 AC 376 ms
112,752 KB
testcase_22 AC 555 ms
154,484 KB
testcase_23 AC 665 ms
177,712 KB
testcase_24 AC 679 ms
164,920 KB
testcase_25 AC 567 ms
110,184 KB
testcase_26 AC 683 ms
184,240 KB
testcase_27 AC 640 ms
113,776 KB
testcase_28 AC 683 ms
180,440 KB
testcase_29 AC 636 ms
110,956 KB
testcase_30 AC 643 ms
167,388 KB
testcase_31 AC 679 ms
183,800 KB
testcase_32 AC 647 ms
123,076 KB
testcase_33 AC 75 ms
76,120 KB
testcase_34 AC 69 ms
71,372 KB
testcase_35 AC 75 ms
76,200 KB
testcase_36 AC 71 ms
71,468 KB
testcase_37 AC 70 ms
71,368 KB
testcase_38 AC 77 ms
76,340 KB
testcase_39 AC 77 ms
76,056 KB
testcase_40 AC 77 ms
76,180 KB
testcase_41 AC 77 ms
76,300 KB
testcase_42 AC 76 ms
76,340 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