結果

問題 No.1739 Princess vs. Dragoness (& AoE)
ユーザー kohei2019kohei2019
提出日時 2023-06-12 00:12:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 675 bytes
コンパイル時間 1,230 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 130,900 KB
最終ジャッジ日時 2023-09-01 03:57:09
合計ジャッジ時間 11,306 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
71,276 KB
testcase_01 AC 76 ms
71,548 KB
testcase_02 AC 76 ms
71,212 KB
testcase_03 WA -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 494 ms
105,852 KB
testcase_09 AC 718 ms
118,740 KB
testcase_10 AC 2,026 ms
96,808 KB
testcase_11 WA -
testcase_12 AC 161 ms
78,320 KB
testcase_13 WA -
testcase_14 AC 2,406 ms
113,852 KB
testcase_15 AC 1,886 ms
126,748 KB
testcase_16 AC 2,250 ms
91,680 KB
testcase_17 AC 1,053 ms
102,200 KB
testcase_18 AC 2,533 ms
101,824 KB
testcase_19 AC 595 ms
101,980 KB
testcase_20 WA -
testcase_21 AC 1,109 ms
117,920 KB
testcase_22 AC 1,914 ms
121,500 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 AC 117 ms
77,452 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 126 ms
77,872 KB
testcase_39 AC 127 ms
77,764 KB
testcase_40 AC 114 ms
77,176 KB
testcase_41 AC 137 ms
77,572 KB
testcase_42 AC 115 ms
77,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
N,A,B,X,Y = map(int,input().split())
lsH0 = list(map(int,input().split()))

def is_ok(arg):
    lsH = [-(lsH0[i]-arg) for i in range(N)]
    heapq.heapify(lsH)
    for i in range(A):
        hp = heapq.heappop(lsH)
        v = hp + X
        heapq.heappush(lsH, v)

    vsum = 0
    for j in lsH:
        if j >= 0:
            continue
        else:
            vsum -= j

    if vsum > B*Y:
        return False
    else:
        return True
 
 
def meguru_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok
print(meguru_bisect(0,10**18+1))


0