結果

問題 No.1015 おつりは要らないです
ユーザー mkawa2mkawa2
提出日時 2020-04-05 16:51:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 988 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 19,552 KB
最終ジャッジ日時 2023-09-16 06:41:36
合計ジャッジ時間 6,248 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,696 KB
testcase_01 AC 20 ms
8,640 KB
testcase_02 AC 20 ms
8,560 KB
testcase_03 AC 19 ms
8,620 KB
testcase_04 AC 20 ms
8,728 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 20 ms
8,636 KB
testcase_08 AC 20 ms
8,648 KB
testcase_09 AC 21 ms
8,652 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 199 ms
19,552 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 193 ms
19,424 KB
testcase_18 AC 183 ms
18,796 KB
testcase_19 AC 182 ms
19,232 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 20 ms
8,584 KB
testcase_31 AC 101 ms
10,404 KB
testcase_32 AC 101 ms
10,584 KB
testcase_33 AC 146 ms
19,428 KB
testcase_34 AC 21 ms
8,724 KB
testcase_35 AC 21 ms
8,724 KB
testcase_36 AC 20 ms
8,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
from bisect import *
from collections import *
from heapq import *

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    n,*xyz=MI()
    aa=LI()
    mm=[10000,5000,1000]
    for m,x in zip(mm,xyz):
        n=len(aa)
        for i in range(n):
            c=min(aa[i]//m,x)
            aa[i]-=c*m
            x-=c
        aa.sort(reverse=True)
        while aa and aa[-1]==0:aa.pop()
        if len(aa)<=x:aa=[]
        else:aa=aa[x:]
    if aa:print("No")
    else:print("Yes")

main()
0