結果

問題 No.1736 Princess vs. Dragoness
ユーザー roarisroaris
提出日時 2021-11-12 21:32:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 70,784 KB
最終ジャッジ日時 2024-05-04 05:04:31
合計ジャッジ時間 2,682 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,632 KB
testcase_01 AC 36 ms
53,376 KB
testcase_02 AC 35 ms
53,504 KB
testcase_03 AC 38 ms
55,296 KB
testcase_04 AC 45 ms
64,768 KB
testcase_05 AC 37 ms
53,996 KB
testcase_06 AC 45 ms
66,048 KB
testcase_07 AC 51 ms
69,120 KB
testcase_08 AC 48 ms
65,152 KB
testcase_09 AC 50 ms
67,712 KB
testcase_10 AC 38 ms
53,504 KB
testcase_11 AC 58 ms
70,784 KB
testcase_12 AC 47 ms
65,536 KB
testcase_13 AC 49 ms
66,816 KB
testcase_14 AC 50 ms
68,608 KB
testcase_15 AC 45 ms
63,488 KB
testcase_16 AC 39 ms
54,784 KB
testcase_17 AC 48 ms
67,328 KB
testcase_18 AC 48 ms
66,176 KB
testcase_19 AC 45 ms
65,536 KB
testcase_20 AC 39 ms
55,168 KB
testcase_21 AC 51 ms
66,304 KB
testcase_22 AC 49 ms
67,968 KB
testcase_23 AC 47 ms
66,816 KB
testcase_24 AC 36 ms
53,760 KB
testcase_25 AC 42 ms
61,056 KB
testcase_26 AC 46 ms
66,176 KB
testcase_27 AC 51 ms
68,608 KB
testcase_28 AC 48 ms
66,304 KB
testcase_29 AC 49 ms
66,176 KB
testcase_30 AC 46 ms
65,920 KB
testcase_31 AC 45 ms
62,464 KB
testcase_32 AC 49 ms
65,664 KB
testcase_33 AC 39 ms
53,888 KB
testcase_34 AC 37 ms
53,632 KB
testcase_35 AC 36 ms
53,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

N, A, B, X, Y = map(int, input().split())
H = list(map(int, input().split()))
l = []

for Hi in H:
    l.append((X, Hi//X))
    l.append((Hi%X, 1))

l.sort(reverse=True)
decr = 0

for v, c in l:
    if A>c:
        decr += v*c
        A -= c
    else:
        decr += v*A
        break
    
if sum(H)-decr<=B*Y:
    print('Yes')
else:
    print('No')
0