結果

問題 No.1015 おつりは要らないです
ユーザー buey_tbuey_t
提出日時 2023-03-21 19:14:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 2,019 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 81,624 KB
実行使用メモリ 105,832 KB
最終ジャッジ日時 2023-10-18 18:32:48
合計ジャッジ時間 8,510 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
84,112 KB
testcase_01 AC 133 ms
84,116 KB
testcase_02 AC 132 ms
84,112 KB
testcase_03 AC 132 ms
84,116 KB
testcase_04 AC 133 ms
84,116 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 134 ms
84,108 KB
testcase_08 AC 134 ms
84,108 KB
testcase_09 AC 131 ms
84,112 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 230 ms
105,724 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 225 ms
105,648 KB
testcase_18 AC 223 ms
105,036 KB
testcase_19 AC 222 ms
105,400 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 133 ms
84,136 KB
testcase_31 AC 174 ms
101,428 KB
testcase_32 AC 174 ms
101,424 KB
testcase_33 AC 183 ms
103,828 KB
testcase_34 AC 132 ms
84,132 KB
testcase_35 AC 133 ms
84,136 KB
testcase_36 AC 133 ms
84,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    from math import sqrt,sin,cos,tan,ceil,radians,floor,gcd,exp,log,log10,log2,factorial,fsum
    from heapq import heapify, heappop, heappush
    from bisect import bisect_left, bisect_right
    from copy import deepcopy
    import copy
    import random
    from collections import deque,Counter,defaultdict
    from itertools import permutations,combinations
    from decimal import Decimal,ROUND_HALF_UP
    #tmp = Decimal(mid).quantize(Decimal('0'), rounding=ROUND_HALF_UP)
    from functools import lru_cache, reduce
    #@lru_cache(maxsize=None)
    from operator import add,sub,mul,xor,and_,or_,itemgetter
    INF = 10**18
    mod1 = 10**9+7
    mod2 = 998244353
    
    #DecimalならPython
    
    
    '''
    
    
    
    '''
    
    N,X,Y,Z = map(int, input().split())
    A = list(map(int, input().split()))
    
    A.sort(reverse=True)
    
    for i in range(N):
        if A[i] > 10000 and X > 0:
            cnt = A[i]//10000
            A[i] -= min(cnt, X)*10000
            X -= min(cnt,X)
    
    A.sort(reverse=True)
    for i in range(N):
        if X > 0 and A[i] <= 10000:
            A[i] = 0
            X -= 1
    
    for i in range(N):
        if A[i] > 5000 and Y > 0:
            cnt = A[i]//5000
            A[i] -= min(cnt, Y)*5000
            Y -= min(cnt,Y)
    
    A.sort(reverse=True)
    for i in range(N):
        if Y > 0 and A[i] <= 5000:
            A[i] = 0
            Y -= 1
    
    for i in range(N):
        if A[i] > 1000 and Z > 0:
            cnt = A[i]//1000
            A[i] -= min(cnt, Z)*1000
            Z -= min(cnt,Z)
    
    A.sort(reverse=True)
    for i in range(N):
        if Z > 0 and A[i] <= 1000:
            A[i] = 0
            Z -= 1
    
    for i in range(N):
        if A[i] != 0:
            print('No')
            exit()
    
    print('Yes')
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
if __name__ == '__main__':
    main()
0