結果

問題 No.1736 Princess vs. Dragoness
ユーザー 👑 H20H20
提出日時 2021-11-12 21:44:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 446 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 78,336 KB
最終ジャッジ日時 2023-08-17 00:40:38
合計ジャッジ時間 5,375 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,408 KB
testcase_01 AC 72 ms
71,472 KB
testcase_02 AC 72 ms
71,264 KB
testcase_03 AC 88 ms
75,900 KB
testcase_04 AC 103 ms
77,688 KB
testcase_05 AC 90 ms
76,260 KB
testcase_06 AC 123 ms
78,088 KB
testcase_07 AC 138 ms
78,232 KB
testcase_08 AC 119 ms
78,304 KB
testcase_09 AC 132 ms
78,172 KB
testcase_10 AC 86 ms
76,264 KB
testcase_11 AC 121 ms
78,260 KB
testcase_12 AC 106 ms
77,756 KB
testcase_13 AC 114 ms
77,632 KB
testcase_14 AC 115 ms
77,704 KB
testcase_15 AC 91 ms
76,788 KB
testcase_16 AC 109 ms
77,576 KB
testcase_17 AC 117 ms
77,868 KB
testcase_18 AC 112 ms
77,816 KB
testcase_19 AC 111 ms
77,764 KB
testcase_20 AC 89 ms
76,256 KB
testcase_21 AC 111 ms
78,292 KB
testcase_22 AC 135 ms
77,968 KB
testcase_23 AC 98 ms
77,060 KB
testcase_24 AC 85 ms
76,028 KB
testcase_25 AC 109 ms
77,768 KB
testcase_26 AC 109 ms
77,916 KB
testcase_27 AC 101 ms
77,704 KB
testcase_28 AC 98 ms
77,068 KB
testcase_29 AC 98 ms
76,700 KB
testcase_30 AC 107 ms
77,824 KB
testcase_31 AC 115 ms
77,824 KB
testcase_32 AC 115 ms
78,336 KB
testcase_33 AC 73 ms
71,120 KB
testcase_34 AC 72 ms
71,328 KB
testcase_35 AC 73 ms
71,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq

N,A,B,X,Y = map(int, input().split())
H = list(map(int, input().split()))
HQ = []
for i in range(N):
    heapq.heappush(HQ,(-H[i],i))
for _ in range(A):
    hi,i = heapq.heappop(HQ)
    H[i]-=X
    heapq.heappush(HQ,(-H[i],i))

for i in range(B):
    y = Y
    j = 0
    while y>0 and j<N:
        d = min(y,H[j])
        if d>0:
            H[j]-=d
            y-=d
        j+=1
if max(H)<=0:
    print('Yes')
else:
    print('No')
0