結果

問題 No.1736 Princess vs. Dragoness
ユーザー ShirotsumeShirotsume
提出日時 2021-10-13 00:22:20
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 741 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 82,216 KB
実行使用メモリ 76,444 KB
最終ジャッジ日時 2024-05-04 04:05:53
合計ジャッジ時間 3,545 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
53,896 KB
testcase_01 AC 46 ms
53,624 KB
testcase_02 AC 43 ms
52,828 KB
testcase_03 WA -
testcase_04 AC 69 ms
66,044 KB
testcase_05 AC 58 ms
62,132 KB
testcase_06 AC 65 ms
68,232 KB
testcase_07 AC 86 ms
76,444 KB
testcase_08 AC 69 ms
70,144 KB
testcase_09 AC 78 ms
74,808 KB
testcase_10 AC 53 ms
62,448 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 66 ms
68,788 KB
testcase_14 WA -
testcase_15 AC 52 ms
62,232 KB
testcase_16 AC 61 ms
67,104 KB
testcase_17 WA -
testcase_18 AC 57 ms
64,664 KB
testcase_19 AC 56 ms
64,476 KB
testcase_20 AC 51 ms
60,440 KB
testcase_21 WA -
testcase_22 AC 74 ms
72,804 KB
testcase_23 AC 67 ms
67,288 KB
testcase_24 AC 42 ms
54,668 KB
testcase_25 AC 70 ms
70,028 KB
testcase_26 AC 71 ms
72,544 KB
testcase_27 AC 68 ms
70,688 KB
testcase_28 AC 58 ms
65,356 KB
testcase_29 AC 52 ms
62,908 KB
testcase_30 AC 60 ms
66,840 KB
testcase_31 AC 73 ms
74,052 KB
testcase_32 AC 74 ms
74,000 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 40 ms
52,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solveac(n, a, b, x, y, h):
    for i in range(a):
        target = h.index(max(h))
        h[target] -= x
    for i in range(b):
        p = y
        for j in range(n):
            d = min(h[j], p)
            p -= d
            h[j] -= d
    if max(h) <= 0:
        return 'Yes'
    else:
        return 'No'

def solveNlogN(n, a, b, x, y, h):
    import heapq
    hm = [-x for x in h]
    heapq.heapify(hm)
    for i in range(a):
        target = heapq.heappop(hm)
        target += x
        heapq.heappush(hm, target)
    h = [-x for x in hm]
    if sum(h) <= b * y:
        return 'Yes'
    else:
        return 'No'

n, a, b, x, y = map(int,input().split())
h = list(map(int,input().split()))
print(solveNlogN(n, a, b, x, y, h))

0