結果

問題 No.1736 Princess vs. Dragoness
ユーザー 👑 H20H20
提出日時 2021-11-12 21:44:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 446 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 82,136 KB
実行使用メモリ 77,152 KB
最終ジャッジ日時 2024-05-04 08:00:05
合計ジャッジ時間 3,199 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,760 KB
testcase_01 AC 36 ms
53,348 KB
testcase_02 AC 35 ms
54,024 KB
testcase_03 AC 46 ms
63,656 KB
testcase_04 AC 58 ms
70,340 KB
testcase_05 AC 50 ms
64,644 KB
testcase_06 AC 81 ms
77,152 KB
testcase_07 AC 94 ms
77,020 KB
testcase_08 AC 73 ms
74,252 KB
testcase_09 AC 89 ms
76,492 KB
testcase_10 AC 44 ms
63,684 KB
testcase_11 AC 78 ms
76,860 KB
testcase_12 AC 60 ms
72,104 KB
testcase_13 AC 67 ms
74,292 KB
testcase_14 AC 66 ms
74,412 KB
testcase_15 AC 49 ms
66,428 KB
testcase_16 AC 63 ms
72,956 KB
testcase_17 AC 72 ms
74,748 KB
testcase_18 AC 67 ms
72,500 KB
testcase_19 AC 67 ms
70,712 KB
testcase_20 AC 52 ms
65,000 KB
testcase_21 AC 68 ms
74,924 KB
testcase_22 AC 93 ms
77,024 KB
testcase_23 AC 56 ms
70,192 KB
testcase_24 AC 44 ms
62,376 KB
testcase_25 AC 66 ms
74,332 KB
testcase_26 AC 70 ms
76,524 KB
testcase_27 AC 58 ms
71,564 KB
testcase_28 AC 57 ms
71,212 KB
testcase_29 AC 55 ms
69,416 KB
testcase_30 AC 62 ms
73,316 KB
testcase_31 AC 75 ms
76,944 KB
testcase_32 AC 78 ms
76,400 KB
testcase_33 AC 35 ms
53,564 KB
testcase_34 AC 34 ms
53,424 KB
testcase_35 AC 33 ms
53,196 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