結果

問題 No.1736 Princess vs. Dragoness
ユーザー roarisroaris
提出日時 2021-11-12 21:32:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 77,692 KB
最終ジャッジ日時 2023-08-16 21:42:46
合計ジャッジ時間 5,391 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,420 KB
testcase_01 AC 90 ms
71,248 KB
testcase_02 AC 89 ms
71,244 KB
testcase_03 AC 97 ms
72,088 KB
testcase_04 AC 106 ms
77,320 KB
testcase_05 AC 96 ms
71,220 KB
testcase_06 AC 105 ms
77,176 KB
testcase_07 AC 109 ms
77,240 KB
testcase_08 AC 106 ms
77,324 KB
testcase_09 AC 109 ms
77,432 KB
testcase_10 AC 94 ms
71,312 KB
testcase_11 AC 112 ms
77,528 KB
testcase_12 AC 105 ms
77,184 KB
testcase_13 AC 107 ms
77,016 KB
testcase_14 AC 107 ms
77,692 KB
testcase_15 AC 100 ms
77,188 KB
testcase_16 AC 94 ms
71,784 KB
testcase_17 AC 107 ms
77,212 KB
testcase_18 AC 103 ms
77,052 KB
testcase_19 AC 103 ms
77,256 KB
testcase_20 AC 96 ms
71,972 KB
testcase_21 AC 107 ms
77,204 KB
testcase_22 AC 107 ms
77,572 KB
testcase_23 AC 105 ms
77,020 KB
testcase_24 AC 91 ms
71,200 KB
testcase_25 AC 98 ms
76,540 KB
testcase_26 AC 109 ms
77,396 KB
testcase_27 AC 108 ms
76,920 KB
testcase_28 AC 105 ms
76,996 KB
testcase_29 AC 105 ms
77,092 KB
testcase_30 AC 104 ms
77,188 KB
testcase_31 AC 102 ms
76,360 KB
testcase_32 AC 104 ms
76,956 KB
testcase_33 AC 91 ms
71,304 KB
testcase_34 AC 92 ms
71,276 KB
testcase_35 AC 92 ms
71,020 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