結果

問題 No.1736 Princess vs. Dragoness
ユーザー ShirotsumeShirotsume
提出日時 2021-10-14 23:03:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 474 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 76,416 KB
最終ジャッジ日時 2024-11-25 10:56:01
合計ジャッジ時間 3,378 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve1(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):
            if h[j] < 0:
                continue
            d = min(h[j], p)
            p -= d
            h[j] -= d
    if max(h) <= 0:
        return 'Yes'
    else:
        return 'No'


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