結果

問題 No.1015 おつりは要らないです
ユーザー titiatitia
提出日時 2020-04-03 21:39:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 830 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 19,200 KB
最終ジャッジ日時 2023-09-16 00:40:22
合計ジャッジ時間 6,964 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,024 KB
testcase_01 AC 16 ms
8,060 KB
testcase_02 AC 15 ms
8,096 KB
testcase_03 AC 15 ms
7,984 KB
testcase_04 AC 15 ms
8,056 KB
testcase_05 AC 15 ms
8,056 KB
testcase_06 AC 14 ms
8,080 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 237 ms
18,480 KB
testcase_11 AC 241 ms
18,964 KB
testcase_12 AC 227 ms
18,364 KB
testcase_13 AC 229 ms
18,552 KB
testcase_14 AC 242 ms
19,176 KB
testcase_15 AC 224 ms
18,496 KB
testcase_16 AC 237 ms
18,416 KB
testcase_17 AC 236 ms
19,008 KB
testcase_18 AC 228 ms
18,372 KB
testcase_19 AC 230 ms
18,584 KB
testcase_20 AC 204 ms
18,740 KB
testcase_21 AC 205 ms
18,536 KB
testcase_22 AC 203 ms
18,484 KB
testcase_23 AC 194 ms
18,272 KB
testcase_24 AC 206 ms
18,904 KB
testcase_25 AC 199 ms
18,632 KB
testcase_26 AC 208 ms
18,568 KB
testcase_27 AC 199 ms
18,520 KB
testcase_28 AC 204 ms
18,528 KB
testcase_29 AC 203 ms
18,676 KB
testcase_30 AC 15 ms
8,004 KB
testcase_31 AC 112 ms
10,028 KB
testcase_32 AC 114 ms
10,124 KB
testcase_33 AC 104 ms
19,200 KB
testcase_34 AC 15 ms
8,024 KB
testcase_35 AC 15 ms
8,000 KB
testcase_36 AC 15 ms
8,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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")
    
    
    

    
        
        
0