結果

問題 No.1736 Princess vs. Dragoness
ユーザー brthyyjpbrthyyjp
提出日時 2021-11-13 02:27:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 443 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 78,012 KB
最終ジャッジ日時 2023-08-17 12:22:12
合計ジャッジ時間 5,081 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,240 KB
testcase_01 AC 75 ms
71,132 KB
testcase_02 AC 73 ms
71,244 KB
testcase_03 AC 87 ms
75,804 KB
testcase_04 AC 93 ms
76,396 KB
testcase_05 AC 74 ms
71,164 KB
testcase_06 AC 108 ms
77,940 KB
testcase_07 AC 113 ms
77,924 KB
testcase_08 AC 99 ms
76,548 KB
testcase_09 AC 109 ms
77,400 KB
testcase_10 AC 72 ms
71,328 KB
testcase_11 AC 120 ms
77,672 KB
testcase_12 AC 95 ms
76,568 KB
testcase_13 AC 109 ms
77,340 KB
testcase_14 AC 106 ms
77,764 KB
testcase_15 AC 89 ms
76,572 KB
testcase_16 AC 94 ms
76,476 KB
testcase_17 AC 102 ms
77,776 KB
testcase_18 AC 98 ms
77,852 KB
testcase_19 AC 102 ms
77,656 KB
testcase_20 AC 86 ms
75,788 KB
testcase_21 AC 102 ms
77,568 KB
testcase_22 AC 102 ms
77,808 KB
testcase_23 AC 107 ms
78,012 KB
testcase_24 AC 78 ms
75,460 KB
testcase_25 AC 99 ms
76,560 KB
testcase_26 AC 114 ms
77,636 KB
testcase_27 AC 113 ms
77,880 KB
testcase_28 AC 100 ms
77,512 KB
testcase_29 AC 97 ms
76,780 KB
testcase_30 AC 107 ms
77,840 KB
testcase_31 AC 109 ms
77,212 KB
testcase_32 AC 117 ms
77,716 KB
testcase_33 AC 74 ms
71,136 KB
testcase_34 AC 71 ms
70,988 KB
testcase_35 AC 72 ms
71,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, a, b, x, y = map(int, input().split())
H = list(map(int, input().split()))

q = []
for h in H:
    q.append(-h)

import heapq
heapq.heapify(q)
for i in range(a):
    if q:
        v = heapq.heappop(q)
        v = -v
        if v > x:
            v -= x
            heapq.heappush(q, -v)
if not q:
    print('Yes')
    exit()
s = 0
while  q:
    v = heapq.heappop(q)
    v = -v
    s += v
if s <= y*b:
    print('Yes')
else:
    print('No')
0