結果

問題 No.1736 Princess vs. Dragoness
ユーザー U SU S
提出日時 2021-11-12 22:40:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 1,099 bytes
コンパイル時間 815 ms
コンパイル使用メモリ 86,768 KB
実行使用メモリ 81,724 KB
最終ジャッジ日時 2023-08-17 02:54:40
合計ジャッジ時間 7,040 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
73,592 KB
testcase_01 AC 112 ms
73,940 KB
testcase_02 AC 111 ms
73,980 KB
testcase_03 AC 125 ms
78,108 KB
testcase_04 AC 136 ms
79,268 KB
testcase_05 AC 125 ms
78,592 KB
testcase_06 AC 150 ms
81,032 KB
testcase_07 AC 163 ms
81,384 KB
testcase_08 AC 145 ms
81,208 KB
testcase_09 AC 157 ms
81,624 KB
testcase_10 AC 126 ms
78,452 KB
testcase_11 AC 168 ms
81,724 KB
testcase_12 AC 134 ms
79,312 KB
testcase_13 AC 149 ms
81,140 KB
testcase_14 AC 149 ms
80,828 KB
testcase_15 AC 129 ms
79,060 KB
testcase_16 AC 141 ms
79,324 KB
testcase_17 AC 148 ms
80,980 KB
testcase_18 AC 132 ms
79,048 KB
testcase_19 AC 134 ms
79,328 KB
testcase_20 AC 125 ms
78,900 KB
testcase_21 AC 146 ms
81,280 KB
testcase_22 AC 152 ms
81,156 KB
testcase_23 AC 139 ms
79,796 KB
testcase_24 AC 121 ms
78,456 KB
testcase_25 AC 146 ms
80,888 KB
testcase_26 AC 151 ms
81,688 KB
testcase_27 AC 148 ms
81,148 KB
testcase_28 AC 133 ms
79,208 KB
testcase_29 AC 130 ms
78,784 KB
testcase_30 AC 137 ms
79,736 KB
testcase_31 AC 152 ms
80,872 KB
testcase_32 AC 154 ms
81,644 KB
testcase_33 AC 112 ms
74,192 KB
testcase_34 AC 114 ms
73,576 KB
testcase_35 AC 110 ms
74,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import sys
# input = sys.stdin.readline
def mp():return map(int,input().split())
def lmp():return list(map(int,input().split()))
def mps(A):return [tuple(map(int, input().split())) for _ in range(A)]
import math
import bisect
import heapq
from copy import deepcopy as dc
from itertools import accumulate
from collections import Counter, defaultdict, deque
def ceil(U,V):return (U+V-1)//V
def modf1(N,MOD):return (N-1)%MOD+1
inf = int(1e20)
mod = int(1e9+7)
import time
import copy

n,a,b,x,y = mp()
h = lmp()
hq = [(-h[i],i) for i in range(n)]
heapq.heapify(hq)
while a != 0:
    here,num = heapq.heappop(hq)
    #print(here,num)
    heapq.heappush(hq, (here+x, num))
    a -= 1
hq.sort(key=lambda x:x[1])
hq = deque(hq)
while b != 0:
    now = y
    while now != 0 and hq:
        u = hq.popleft()
        if u[0] >= 0:continue
        if -now <= u[0]:
            now += u[0]
        else:
            hq.appendleft((u[0]+now,u[1]))
            now = 0
    b -= 1
    if b == 0 or not hq:
        break
#print(hq)
f = True
for i,j in hq:
    if i < 0:f = False
if f:print("Yes")
else:print("No")
0