結果

問題 No.1015 おつりは要らないです
コンテスト
ユーザー komkompi
提出日時 2020-04-03 23:06:51
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 583 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 665 ms
コンパイル使用メモリ 20,952 KB
実行使用メモリ 25,240 KB
最終ジャッジ日時 2026-03-24 12:47:01
合計ジャッジ時間 8,400 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 21 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# 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