結果

問題 No.1736 Princess vs. Dragoness
ユーザー shinichishinichi
提出日時 2021-11-13 19:21:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 87,248 KB
実行使用メモリ 78,232 KB
最終ジャッジ日時 2023-08-18 13:48:31
合計ジャッジ時間 4,896 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,240 KB
testcase_01 AC 63 ms
71,208 KB
testcase_02 AC 63 ms
71,284 KB
testcase_03 AC 69 ms
75,248 KB
testcase_04 AC 116 ms
76,752 KB
testcase_05 AC 73 ms
75,604 KB
testcase_06 AC 83 ms
76,352 KB
testcase_07 AC 98 ms
77,724 KB
testcase_08 AC 91 ms
78,232 KB
testcase_09 AC 100 ms
77,536 KB
testcase_10 AC 72 ms
75,892 KB
testcase_11 AC 99 ms
77,448 KB
testcase_12 AC 81 ms
76,928 KB
testcase_13 AC 80 ms
76,616 KB
testcase_14 AC 87 ms
77,372 KB
testcase_15 AC 70 ms
76,028 KB
testcase_16 AC 68 ms
75,444 KB
testcase_17 AC 90 ms
77,220 KB
testcase_18 AC 93 ms
76,552 KB
testcase_19 AC 80 ms
76,852 KB
testcase_20 AC 66 ms
74,788 KB
testcase_21 AC 91 ms
77,480 KB
testcase_22 AC 94 ms
77,856 KB
testcase_23 AC 75 ms
76,468 KB
testcase_24 AC 66 ms
71,228 KB
testcase_25 AC 81 ms
76,580 KB
testcase_26 AC 72 ms
76,388 KB
testcase_27 AC 74 ms
76,508 KB
testcase_28 AC 78 ms
76,268 KB
testcase_29 AC 80 ms
76,444 KB
testcase_30 AC 75 ms
76,488 KB
testcase_31 AC 76 ms
75,836 KB
testcase_32 AC 78 ms
76,504 KB
testcase_33 AC 64 ms
71,236 KB
testcase_34 AC 63 ms
71,100 KB
testcase_35 AC 64 ms
70,968 KB
権限があれば一括ダウンロードができます

ソースコード

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