結果
| 問題 | No.1015 おつりは要らないです |
| コンテスト | |
| ユーザー |
ayaoni
|
| 提出日時 | 2020-11-27 04:10:46 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 79 ms / 2,000 ms |
| コード長 | 690 bytes |
| コンパイル時間 | 166 ms |
| コンパイル使用メモリ | 82,264 KB |
| 実行使用メモリ | 88,552 KB |
| 最終ジャッジ日時 | 2024-11-18 07:26:53 |
| 合計ジャッジ時間 | 3,777 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
ソースコード
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N,X,Y,Z = MI()
A = LI()
for i in range(N):
A[i] = A[i]//1000+1
for i in range(N):
a = A[i]//10
if a <= Z:
A[i] -= 10*a
Z -= a
else:
A[i] -= 10*Z
Z = 0
if Z:
A.sort(reverse=True)
for i in range(min(N,Z)):
A[i] = 0
for i in range(N):
b = A[i]//5
if b <= Y:
A[i] -= 5*b
Y -= b
else:
A[i] -= 5*Y
Y = 0
if Y:
A.sort(reverse=True)
for i in range(min(N,Y)):
A[i] = 0
if sum(A) <= X:
print('Yes')
else:
print('No')
ayaoni