結果

問題 No.1736 Princess vs. Dragoness
ユーザー 👑 H20H20
提出日時 2021-11-12 21:42:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 512 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 76,800 KB
最終ジャッジ日時 2024-05-04 07:53:19
合計ジャッジ時間 3,616 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,736 KB
testcase_01 AC 37 ms
52,224 KB
testcase_02 AC 34 ms
52,224 KB
testcase_03 WA -
testcase_04 AC 60 ms
70,144 KB
testcase_05 AC 49 ms
64,128 KB
testcase_06 AC 82 ms
76,544 KB
testcase_07 AC 102 ms
76,800 KB
testcase_08 AC 75 ms
74,368 KB
testcase_09 AC 88 ms
76,672 KB
testcase_10 AC 46 ms
62,464 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 76 ms
73,344 KB
testcase_14 WA -
testcase_15 AC 56 ms
65,792 KB
testcase_16 AC 68 ms
71,680 KB
testcase_17 WA -
testcase_18 AC 68 ms
71,040 KB
testcase_19 AC 65 ms
70,016 KB
testcase_20 AC 48 ms
64,384 KB
testcase_21 WA -
testcase_22 AC 95 ms
76,416 KB
testcase_23 AC 56 ms
69,504 KB
testcase_24 AC 43 ms
61,440 KB
testcase_25 AC 64 ms
74,240 KB
testcase_26 AC 71 ms
76,416 KB
testcase_27 AC 59 ms
70,272 KB
testcase_28 AC 57 ms
69,888 KB
testcase_29 AC 60 ms
68,352 KB
testcase_30 AC 63 ms
72,960 KB
testcase_31 AC 75 ms
76,288 KB
testcase_32 AC 76 ms
76,648 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 33 ms
52,608 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 i 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
cnt = 0
for i in range(N):
    if H[i]>0:
        cnt += -(-H[i]//X)
if cnt<=A:
    print('Yes')
else:
    print('No')
0