結果

問題 No.1739 Princess vs. Dragoness (& AoE)
コンテスト
ユーザー shinichi
提出日時 2021-11-13 19:22:05
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 430 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 241 ms
コンパイル使用メモリ 85,504 KB
実行使用メモリ 102,528 KB
最終ジャッジ日時 2026-05-22 00:32:19
合計ジャッジ時間 5,969 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 40
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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