結果
問題 |
No.1015 おつりは要らないです
|
ユーザー |
![]() |
提出日時 | 2020-04-03 21:39:01 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 830 bytes |
コンパイル時間 | 90 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 21,872 KB |
最終ジャッジ日時 | 2024-07-03 01:46:36 |
合計ジャッジ時間 | 6,769 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 WA * 3 |
ソースコード
import sys input = sys.stdin.readline N,X,Y,Z=map(int,input().split()) A=list(map(int,input().split())) for i in range(N): A[i]+=1 if A[i]>=10000 and Z>0: s=min(A[i]//10000,Z) Z-=s A[i]-=s*10000 if Z==0: for i in range(N): if A[i]>=5000 and Y>0: s=min(A[i]//5000,Y) Y-=s A[i]-=s*5000 A.sort(reverse=True) #print(A,X,Y,Z) if Z>0: for i in range(N): if A[i]>0 and Z>0: Z-=1 A[i]=0 #print(A,X,Y,Z) if Y>0: for i in range(N): if A[i]>0 and Y>0: Y-=1 A[i]=0 #print(A,X,Y,Z) for i in range(N): if A[i]>0 and X>0: s=min((A[i]+999)//1000,X) X-=s A[i]=0 if max(A)==0: print("Yes") else: print("No")