結果

問題 No.1736 Princess vs. Dragoness
ユーザー shinichishinichi
提出日時 2021-11-13 19:21:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 82,524 KB
実行使用メモリ 76,856 KB
最終ジャッジ日時 2024-11-27 19:14:29
合計ジャッジ時間 3,434 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq


N, A, B, X, Y = map(int, input().split())
H = list(map(int, input().split()))
total = sum(H)

heap = []
for h in H:
    heapq.heappush(heap, -h)

while A > 0:
    d = -heapq.heappop(heap)
    if d < X:
        A -= 1
        d -= X
    else:
        A -= d // X
        d -= (d // X) * X
    heapq.heappush(heap, -d)

total = sum([-min(a, 0) for a in heap])

if total > Y*B:
    print("No")
else:
    print("Yes")

0