結果

問題 No.1736 Princess vs. Dragoness
ユーザー customfolkcustomfolk
提出日時 2021-11-12 21:36:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 1,126 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 87,668 KB
実行使用メモリ 78,788 KB
最終ジャッジ日時 2023-08-17 00:16:45
合計ジャッジ時間 6,808 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
73,404 KB
testcase_01 AC 124 ms
73,308 KB
testcase_02 AC 125 ms
73,428 KB
testcase_03 AC 125 ms
73,564 KB
testcase_04 AC 134 ms
78,656 KB
testcase_05 AC 125 ms
73,340 KB
testcase_06 AC 132 ms
78,536 KB
testcase_07 AC 137 ms
78,624 KB
testcase_08 AC 135 ms
78,788 KB
testcase_09 AC 135 ms
78,788 KB
testcase_10 AC 127 ms
73,636 KB
testcase_11 AC 138 ms
78,680 KB
testcase_12 AC 135 ms
78,536 KB
testcase_13 AC 137 ms
78,672 KB
testcase_14 AC 138 ms
78,664 KB
testcase_15 AC 136 ms
78,496 KB
testcase_16 AC 128 ms
73,456 KB
testcase_17 AC 137 ms
78,660 KB
testcase_18 AC 138 ms
78,624 KB
testcase_19 AC 136 ms
78,696 KB
testcase_20 AC 128 ms
73,516 KB
testcase_21 AC 135 ms
78,524 KB
testcase_22 AC 136 ms
78,712 KB
testcase_23 AC 135 ms
78,608 KB
testcase_24 AC 127 ms
73,544 KB
testcase_25 AC 128 ms
73,128 KB
testcase_26 AC 138 ms
78,784 KB
testcase_27 AC 139 ms
78,748 KB
testcase_28 AC 136 ms
78,700 KB
testcase_29 AC 136 ms
78,772 KB
testcase_30 AC 137 ms
78,564 KB
testcase_31 AC 131 ms
73,544 KB
testcase_32 AC 139 ms
78,552 KB
testcase_33 AC 125 ms
73,136 KB
testcase_34 AC 128 ms
73,460 KB
testcase_35 AC 126 ms
73,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict, deque, Counter
from heapq import heapify, heappop, heappush
import math
from copy import deepcopy
from itertools import combinations, permutations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right

import sys

def input():
    return sys.stdin.readline().rstrip()
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getListGraph():
    return list(map(lambda x:int(x) - 1, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]

mod = 10 ** 9 + 7
MOD = 998244353
sys.setrecursionlimit(10000000)
inf = float('inf')
eps = 10 ** (-15)
dy = [0, 1, 0, -1]
dx = [1, 0, -1, 0]

#############
# Main Code #
#############

# まずAで減らす
N, A, B, X, Y = getNM()
H = getList()

for i in range(N):
    t = min(H[i] // X, A)
    H[i] -= X * t
    A -= t

H.sort()
for i in range(N - 1, -1, -1):
    if A:
        H[i] -= X
        A -= 1
H = [h if h >= 0 else 0 for h in H]

if B * Y >= sum(H):
    print('Yes')
else:
    print('No')
0