結果

問題 No.1736 Princess vs. Dragoness
ユーザー gr1msl3ygr1msl3y
提出日時 2021-11-12 22:17:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 78,092 KB
最終ジャッジ日時 2023-08-17 02:00:37
合計ジャッジ時間 5,072 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,376 KB
testcase_01 AC 77 ms
71,308 KB
testcase_02 AC 76 ms
71,076 KB
testcase_03 AC 85 ms
75,572 KB
testcase_04 AC 93 ms
76,208 KB
testcase_05 AC 87 ms
75,880 KB
testcase_06 AC 101 ms
76,820 KB
testcase_07 AC 107 ms
77,888 KB
testcase_08 AC 107 ms
77,800 KB
testcase_09 AC 104 ms
77,372 KB
testcase_10 AC 86 ms
75,888 KB
testcase_11 AC 115 ms
77,704 KB
testcase_12 AC 91 ms
76,384 KB
testcase_13 AC 92 ms
76,380 KB
testcase_14 AC 90 ms
76,296 KB
testcase_15 AC 85 ms
76,168 KB
testcase_16 AC 95 ms
76,688 KB
testcase_17 AC 93 ms
76,300 KB
testcase_18 AC 88 ms
76,288 KB
testcase_19 AC 89 ms
76,384 KB
testcase_20 AC 85 ms
75,792 KB
testcase_21 AC 100 ms
76,992 KB
testcase_22 AC 103 ms
77,320 KB
testcase_23 AC 88 ms
76,224 KB
testcase_24 AC 78 ms
71,448 KB
testcase_25 AC 108 ms
77,656 KB
testcase_26 AC 103 ms
77,532 KB
testcase_27 AC 98 ms
76,840 KB
testcase_28 AC 87 ms
76,176 KB
testcase_29 AC 82 ms
76,200 KB
testcase_30 AC 92 ms
76,488 KB
testcase_31 AC 112 ms
77,592 KB
testcase_32 AC 110 ms
78,092 KB
testcase_33 AC 76 ms
71,400 KB
testcase_34 AC 77 ms
71,408 KB
testcase_35 AC 77 ms
71,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq as hq
N, A, B, X, Y = map(int, input().split())
H = list(map(int, input().split()))
S = sum(H)
task = [-h for h in H]
task.sort()
for _ in range(A):
    v = -hq.heappop(task)
    if v >= X:
        S -= X
        v -= X
    else:
        S -= v
        v = 0
    hq.heappush(task, -v)

print('Yes' if S <= B*Y else 'No')
0