結果

問題 No.1739 Princess vs. Dragoness (& AoE)
ユーザー brthyyjpbrthyyjp
提出日時 2021-11-14 02:06:10
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 689 bytes
コンパイル時間 549 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 127,496 KB
最終ジャッジ日時 2023-08-19 02:54:46
合計ジャッジ時間 59,000 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,348 KB
testcase_01 AC 72 ms
71,272 KB
testcase_02 AC 72 ms
71,096 KB
testcase_03 AC 80 ms
75,960 KB
testcase_04 AC 2,597 ms
127,476 KB
testcase_05 AC 2,875 ms
127,496 KB
testcase_06 AC 1,434 ms
120,508 KB
testcase_07 AC 80 ms
76,212 KB
testcase_08 AC 852 ms
101,620 KB
testcase_09 AC 1,285 ms
120,192 KB
testcase_10 AC 1,431 ms
94,440 KB
testcase_11 AC 998 ms
88,768 KB
testcase_12 AC 212 ms
78,532 KB
testcase_13 AC 1,682 ms
105,080 KB
testcase_14 AC 1,966 ms
112,100 KB
testcase_15 AC 1,997 ms
125,912 KB
testcase_16 AC 1,465 ms
87,392 KB
testcase_17 AC 1,147 ms
98,568 KB
testcase_18 AC 1,800 ms
97,880 KB
testcase_19 AC 879 ms
98,736 KB
testcase_20 AC 450 ms
85,844 KB
testcase_21 AC 1,478 ms
119,280 KB
testcase_22 AC 1,902 ms
121,504 KB
testcase_23 AC 2,701 ms
127,376 KB
testcase_24 AC 2,867 ms
126,304 KB
testcase_25 TLE -
testcase_26 AC 2,663 ms
125,124 KB
testcase_27 TLE -
testcase_28 AC 2,720 ms
124,312 KB
testcase_29 AC 2,934 ms
126,464 KB
testcase_30 AC 2,786 ms
126,464 KB
testcase_31 AC 2,603 ms
125,840 KB
testcase_32 AC 2,843 ms
127,372 KB
testcase_33 AC 110 ms
77,256 KB
testcase_34 AC 95 ms
77,152 KB
testcase_35 AC 118 ms
77,520 KB
testcase_36 AC 111 ms
77,564 KB
testcase_37 AC 102 ms
77,268 KB
testcase_38 AC 130 ms
78,280 KB
testcase_39 AC 128 ms
77,624 KB
testcase_40 AC 115 ms
77,216 KB
testcase_41 AC 137 ms
77,888 KB
testcase_42 AC 122 ms
77,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():

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

    def is_ok(k):
        q = []
        for h in H:
            q.append(-(h-k))
        heapq.heapify(q)
        for i in range(a):
            v = heapq.heappop(q)
            v = -v
            v -= x
            heapq.heappush(q, -v)
        s = 0
        while  q:
            v = heapq.heappop(q)
            v = -v
            s += max(v, 0)
        return  s <= y*b

    ng = -1
    ok = max(H)
    while ng+1<ok:
        c = (ng+ok)//2
        if is_ok(c):
            ok = c
        else:
            ng = c
    print(ok)

if __name__ == '__main__':
    main()
0