結果
| 問題 |
No.1015 おつりは要らないです
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-03 23:57:22 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 979 bytes |
| コンパイル時間 | 100 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 22,060 KB |
| 最終ジャッジ日時 | 2024-07-03 06:36:46 |
| 合計ジャッジ時間 | 6,733 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 33 |
ソースコード
import copy
# 入力
N, X, Y, Z = map(int, input().split())
a = list(map(int, input().split()))
a = [i // 1000 + 1 for i in a]
a = sorted(a, reverse=True)
# 10000円
ans = True
tmp = []
for i in a:
if Z > 0:
if i // 10 > Z:
tmp.append(i - 10 * Z)
Z = 0
else:
tmp.append(i % 10)
Z -= i // 10
else:
tmp.append(i)
tmp.sort()
if Z > 0:
tmp = tmp[:len(tmp) - Z]
print(tmp)
a = tmp
tmp = []
for i in a:
if Y > 0:
if i // 5 > Y:
tmp.append(i - 5 * Y)
Y = 0
else:
tmp.append(i % 5)
Y -= i // 5
else:
tmp.append(i)
tmp.sort()
if Y > 0:
tmp = tmp[:len(tmp) - Y]
a = tmp
tmp = []
for i in a:
if X == 0 and i > 0:
ans = False
break
if X < 0:
ans = False
break
if X > 0:
X -= i
if X < 0:
ans = False
print('Yes' if ans else 'No')