結果

問題 No.1015 おつりは要らないです
ユーザー komkompikomkompi
提出日時 2020-04-03 23:06:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 583 bytes
コンパイル時間 492 ms
コンパイル使用メモリ 10,692 KB
実行使用メモリ 18,860 KB
最終ジャッジ日時 2023-09-16 04:21:17
合計ジャッジ時間 7,805 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,872 KB
testcase_01 AC 15 ms
7,808 KB
testcase_02 AC 16 ms
7,816 KB
testcase_03 AC 15 ms
7,744 KB
testcase_04 AC 15 ms
7,752 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 15 ms
7,844 KB
testcase_08 AC 16 ms
7,820 KB
testcase_09 AC 16 ms
7,744 KB
testcase_10 AC 237 ms
18,432 KB
testcase_11 AC 246 ms
18,716 KB
testcase_12 AC 229 ms
18,220 KB
testcase_13 AC 239 ms
18,576 KB
testcase_14 AC 249 ms
18,860 KB
testcase_15 AC 231 ms
18,228 KB
testcase_16 AC 244 ms
18,568 KB
testcase_17 AC 249 ms
18,728 KB
testcase_18 AC 235 ms
18,504 KB
testcase_19 AC 239 ms
18,364 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 15 ms
7,760 KB
testcase_31 AC 193 ms
12,156 KB
testcase_32 AC 199 ms
12,096 KB
testcase_33 AC 217 ms
18,852 KB
testcase_34 AC 16 ms
7,864 KB
testcase_35 AC 16 ms
7,848 KB
testcase_36 AC 16 ms
7,860 KB
権限があれば一括ダウンロードができます

ソースコード

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