結果

問題 No.1015 おつりは要らないです
ユーザー komkompi
提出日時 2020-04-03 23:06:51
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 583 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 21,960 KB
最終ジャッジ日時 2024-07-03 05:42:05
合計ジャッジ時間 7,837 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 21 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
N,X,Y,Z=map(int,input().split())

A=list(map(int,input().split()))

for i in range(N):
    temp=min((A[i]//10000),Z)
    A[i]-=10000*temp
    Z-=temp
    
for i in range(N):
    temp=min((A[i]//5000),Y)
    A[i]-=5000*temp
    Y-=temp

A.sort(reverse=True)
for i in range(len(A)):
    if Z>0 and A[i]>=0:
        Z-=1
        A[i]-=10000
    if Y>0 and A[i]>=0:
        Y-=1
        A[i]-=5000
    if A[i]<0:
        continue
    temp=A[i]//1000+1
    A[i]-=temp*1000
    X-=temp
#print(X,Y,Z)    
    
if X<0:
    print("No")
else:
    print("Yes")
0