結果

問題 No.1736 Princess vs. Dragoness
ユーザー kaeru82433413kaeru82433413
提出日時 2021-11-12 21:28:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 76,928 KB
最終ジャッジ日時 2024-05-04 04:53:57
合計ジャッジ時間 2,804 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,608 KB
testcase_01 AC 36 ms
52,096 KB
testcase_02 AC 33 ms
52,480 KB
testcase_03 AC 42 ms
59,648 KB
testcase_04 AC 50 ms
65,920 KB
testcase_05 AC 42 ms
61,440 KB
testcase_06 AC 50 ms
67,840 KB
testcase_07 AC 72 ms
76,928 KB
testcase_08 AC 57 ms
69,760 KB
testcase_09 AC 66 ms
75,008 KB
testcase_10 AC 44 ms
61,440 KB
testcase_11 AC 75 ms
76,408 KB
testcase_12 AC 52 ms
64,768 KB
testcase_13 AC 54 ms
68,096 KB
testcase_14 AC 54 ms
68,608 KB
testcase_15 AC 43 ms
62,080 KB
testcase_16 AC 51 ms
65,408 KB
testcase_17 AC 55 ms
67,712 KB
testcase_18 AC 45 ms
64,000 KB
testcase_19 AC 47 ms
64,384 KB
testcase_20 AC 40 ms
59,648 KB
testcase_21 AC 56 ms
70,144 KB
testcase_22 AC 63 ms
72,704 KB
testcase_23 AC 55 ms
68,352 KB
testcase_24 AC 35 ms
52,608 KB
testcase_25 AC 58 ms
69,504 KB
testcase_26 AC 58 ms
72,192 KB
testcase_27 AC 55 ms
69,888 KB
testcase_28 AC 49 ms
64,640 KB
testcase_29 AC 43 ms
62,336 KB
testcase_30 AC 50 ms
66,432 KB
testcase_31 AC 63 ms
73,216 KB
testcase_32 AC 65 ms
74,496 KB
testcase_33 AC 34 ms
52,096 KB
testcase_34 AC 34 ms
52,480 KB
testcase_35 AC 34 ms
52,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappop as pop, heappush as push, heapify

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

hh = list(map(lambda x: -x, H))
heapify(hh)

for _ in range(A):
    h = -pop(hh)
    h -= X
    push(hh, -h)

sum_ = 0
for h in hh:
    sum_ += max(0, -h)

if sum_ <= Y*B:
    print("Yes")
else:
    print("No")
0