結果

問題 No.1736 Princess vs. Dragoness
ユーザー U SU S
提出日時 2021-11-12 22:40:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 1,099 bytes
コンパイル時間 377 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 77,952 KB
最終ジャッジ日時 2024-05-04 10:07:47
合計ジャッジ時間 4,485 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
60,544 KB
testcase_01 AC 60 ms
61,184 KB
testcase_02 AC 57 ms
61,184 KB
testcase_03 AC 67 ms
64,768 KB
testcase_04 AC 82 ms
71,296 KB
testcase_05 AC 70 ms
66,048 KB
testcase_06 AC 102 ms
77,184 KB
testcase_07 AC 115 ms
77,824 KB
testcase_08 AC 99 ms
77,824 KB
testcase_09 AC 111 ms
77,468 KB
testcase_10 AC 69 ms
65,536 KB
testcase_11 AC 122 ms
77,952 KB
testcase_12 AC 88 ms
71,680 KB
testcase_13 AC 102 ms
77,440 KB
testcase_14 AC 93 ms
74,368 KB
testcase_15 AC 75 ms
68,352 KB
testcase_16 AC 91 ms
73,088 KB
testcase_17 AC 100 ms
77,440 KB
testcase_18 AC 82 ms
70,656 KB
testcase_19 AC 82 ms
71,040 KB
testcase_20 AC 70 ms
66,304 KB
testcase_21 AC 92 ms
74,880 KB
testcase_22 AC 106 ms
77,440 KB
testcase_23 AC 89 ms
73,856 KB
testcase_24 AC 62 ms
63,232 KB
testcase_25 AC 92 ms
75,136 KB
testcase_26 AC 97 ms
77,184 KB
testcase_27 AC 98 ms
77,440 KB
testcase_28 AC 80 ms
70,144 KB
testcase_29 AC 75 ms
68,096 KB
testcase_30 AC 90 ms
73,344 KB
testcase_31 AC 106 ms
77,440 KB
testcase_32 AC 106 ms
77,440 KB
testcase_33 AC 58 ms
61,184 KB
testcase_34 AC 57 ms
60,928 KB
testcase_35 AC 56 ms
61,184 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