結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,016 KB
testcase_01 AC 16 ms
8,112 KB
testcase_02 AC 17 ms
8,132 KB
testcase_03 AC 15 ms
8,080 KB
testcase_04 AC 16 ms
8,048 KB
testcase_05 AC 15 ms
8,008 KB
testcase_06 AC 16 ms
7,976 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 250 ms
18,876 KB
testcase_11 AC 252 ms
18,952 KB
testcase_12 AC 232 ms
18,292 KB
testcase_13 AC 246 ms
18,612 KB
testcase_14 AC 253 ms
19,232 KB
testcase_15 AC 237 ms
18,328 KB
testcase_16 AC 242 ms
18,824 KB
testcase_17 AC 250 ms
18,992 KB
testcase_18 AC 251 ms
18,524 KB
testcase_19 AC 238 ms
18,736 KB
testcase_20 AC 210 ms
18,664 KB
testcase_21 AC 208 ms
18,596 KB
testcase_22 AC 209 ms
18,476 KB
testcase_23 AC 202 ms
18,376 KB
testcase_24 AC 213 ms
18,904 KB
testcase_25 AC 207 ms
18,584 KB
testcase_26 AC 211 ms
18,448 KB
testcase_27 AC 206 ms
18,424 KB
testcase_28 AC 205 ms
18,696 KB
testcase_29 AC 209 ms
18,764 KB
testcase_30 AC 15 ms
7,980 KB
testcase_31 AC 117 ms
10,124 KB
testcase_32 AC 119 ms
10,180 KB
testcase_33 AC 105 ms
19,140 KB
testcase_34 AC 15 ms
7,960 KB
testcase_35 AC 15 ms
8,060 KB
testcase_36 AC 16 ms
8,072 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]-=s*1000

if max(A)==0:
    print("Yes")
else:
    print("No")
    
    
    

    
        
        
0