結果

問題 No.1736 Princess vs. Dragoness
ユーザー ntuda
提出日時 2025-01-14 21:07:26
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 470 bytes
コンパイル時間 2,504 ms
コンパイル使用メモリ 82,364 KB
実行使用メモリ 67,380 KB
最終ジャッジ日時 2025-01-14 21:07:32
合計ジャッジ時間 4,088 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

from sortedcontainers import SortedList
N,A,B,X,Y = map(int,input().split())
H = list(map(int,input().split()))
S = SortedList(H)
while S and S[-1] >= X and A > 0:
    tmp = S[-1]
    S.pop(-1)
    if tmp > X:
        S.add(tmp - X)
    A -= 1
while S and B > 0:
    y = Y
    B -= 1
    while S and y >= S[0]:
        y -= S[0]
        S.pop(0)
    if S:
        tmp = S[0]
        S.pop(0)
        S.add(tmp - y)
if len(S) <= A:
    print("Yes")
else:
    print("No")
0