結果

問題 No.1736 Princess vs. Dragoness
ユーザー moharan627moharan627
提出日時 2021-11-12 21:52:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 197 ms / 2,000 ms
コード長 1,075 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 86,812 KB
実行使用メモリ 78,104 KB
最終ジャッジ日時 2023-08-17 01:06:10
合計ジャッジ時間 7,820 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
71,656 KB
testcase_01 AC 115 ms
71,704 KB
testcase_02 AC 109 ms
71,816 KB
testcase_03 AC 129 ms
77,192 KB
testcase_04 AC 137 ms
77,268 KB
testcase_05 AC 124 ms
77,136 KB
testcase_06 AC 162 ms
77,900 KB
testcase_07 AC 169 ms
77,456 KB
testcase_08 AC 139 ms
77,308 KB
testcase_09 AC 160 ms
77,480 KB
testcase_10 AC 121 ms
77,048 KB
testcase_11 AC 185 ms
77,752 KB
testcase_12 AC 139 ms
77,712 KB
testcase_13 AC 159 ms
77,664 KB
testcase_14 AC 156 ms
77,552 KB
testcase_15 AC 128 ms
77,380 KB
testcase_16 AC 135 ms
77,332 KB
testcase_17 AC 150 ms
78,104 KB
testcase_18 AC 159 ms
77,452 KB
testcase_19 AC 164 ms
77,764 KB
testcase_20 AC 127 ms
77,096 KB
testcase_21 AC 136 ms
77,580 KB
testcase_22 AC 197 ms
77,644 KB
testcase_23 AC 137 ms
78,016 KB
testcase_24 AC 123 ms
77,252 KB
testcase_25 AC 128 ms
77,428 KB
testcase_26 AC 139 ms
77,652 KB
testcase_27 AC 130 ms
77,340 KB
testcase_28 AC 135 ms
77,696 KB
testcase_29 AC 131 ms
77,448 KB
testcase_30 AC 155 ms
77,564 KB
testcase_31 AC 134 ms
77,428 KB
testcase_32 AC 143 ms
77,452 KB
testcase_33 AC 109 ms
71,424 KB
testcase_34 AC 111 ms
71,564 KB
testcase_35 AC 112 ms
71,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#sys.setrecursionlimit(10 ** 6)
INF = float('inf')
#10**20,2**63に変えるのもあり
MOD = 10**9 + 7
MOD2 = 998244353
from collections import defaultdict
def solve():
    def II(): return int(sys.stdin.readline())
    def LI(): return list(map(int, sys.stdin.readline().split()))
    def LC(): return list(input())
    def IC(): return [int(c) for c in input()]
    def MI(): return map(int, sys.stdin.readline().split())
    N,A,B,X,Y = MI()
    H =LI()
    for a in range(A):
        MAX=0
        idx = -1
        for n in range(N):
            if H[n]<=0:
                continue
            if MAX < H[n]:
                MAX = H[n]
                idx = n
        H[idx]-=X
        #print(H)
    for b in range(B):
        P = Y
        for i in range(N):
            if H[i]<=0:
                continue
            D = min(P,H[i])
            H[i]-=D
            P-=D
        #print(H)
    flag = True
    for n in range(N):
        if H[n]>0:
            flag = False
    if flag:
        print("Yes")
    else:
        print("No")
    return
solve()
0