結果

問題 No.1015 おつりは要らないです
コンテスト
ユーザー chinchilla
提出日時 2020-04-03 23:52:02
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 71 ms / 2,000 ms
+ 122µs
コード長 346 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 55 ms
コンパイル使用メモリ 14,976 KB
実行使用メモリ 22,020 KB
最終ジャッジ日時 2026-09-25 14:38:26
合計ジャッジ時間 3,843 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge4_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n, x, y, z = map(int, input().split())
C = [-((int(w)+1)//-1000) for w in input().split()]
m = sum(c//10 for c in C)
z, m = max(z-m, 0), max(m-z, 0)
C = sorted(c%10 for c in C)[:max(n-z, 0)]
f = sum(c//5 for c in C) + 2*m
y, f = max(y-f, 0), max(f-y, 0)
C = sorted(c%5 for c in C)[:max(len(C)-y, 0)]
t = sum(C) + 5*f
print('No' if t>x else 'Yes')
0