結果

問題 No.1015 おつりは要らないです
ユーザー 👑 rin204rin204
提出日時 2022-03-21 20:57:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 398 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 82,392 KB
実行使用メモリ 91,948 KB
最終ジャッジ日時 2024-04-17 17:29:08
合計ジャッジ時間 3,399 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
52,180 KB
testcase_01 AC 29 ms
52,328 KB
testcase_02 AC 28 ms
52,896 KB
testcase_03 AC 29 ms
52,336 KB
testcase_04 AC 32 ms
53,008 KB
testcase_05 AC 31 ms
53,008 KB
testcase_06 AC 30 ms
52,892 KB
testcase_07 AC 29 ms
52,872 KB
testcase_08 AC 32 ms
52,112 KB
testcase_09 AC 30 ms
52,744 KB
testcase_10 AC 75 ms
91,496 KB
testcase_11 AC 75 ms
90,796 KB
testcase_12 AC 74 ms
90,972 KB
testcase_13 AC 75 ms
90,944 KB
testcase_14 AC 78 ms
91,948 KB
testcase_15 AC 73 ms
90,148 KB
testcase_16 AC 76 ms
90,668 KB
testcase_17 AC 75 ms
91,568 KB
testcase_18 AC 75 ms
90,728 KB
testcase_19 AC 75 ms
91,520 KB
testcase_20 AC 64 ms
87,468 KB
testcase_21 AC 63 ms
86,948 KB
testcase_22 AC 63 ms
87,452 KB
testcase_23 AC 63 ms
86,608 KB
testcase_24 AC 63 ms
87,840 KB
testcase_25 AC 62 ms
86,744 KB
testcase_26 AC 63 ms
86,620 KB
testcase_27 AC 62 ms
88,148 KB
testcase_28 AC 63 ms
87,776 KB
testcase_29 AC 65 ms
86,612 KB
testcase_30 AC 32 ms
52,240 KB
testcase_31 AC 54 ms
81,780 KB
testcase_32 AC 53 ms
82,496 KB
testcase_33 AC 64 ms
90,472 KB
testcase_34 AC 31 ms
52,092 KB
testcase_35 AC 30 ms
52,876 KB
testcase_36 AC 30 ms
52,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, x, y, z = map(int, input().split())
A = list(map(int, input().split()))
A = [a // 1000 + 1 for a in A]

for i in range(n):
    mi = min(z, A[i] // 10)
    A[i] -= mi * 10
    z -= mi
A.sort(reverse = True)
A = A[z:]
n = len(A)
for i in range(n):
    mi = min(y, A[i] // 5)
    A[i] -= mi * 5
    y -= mi
A.sort(reverse = True)
tot = sum(A[y:])
if tot <= x:
    print("Yes")
else:
    print("No")
0