結果

問題 No.1015 おつりは要らないです
ユーザー mkawa2mkawa2
提出日時 2020-04-03 22:49:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,004 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 11,020 KB
実行使用メモリ 19,588 KB
最終ジャッジ日時 2023-09-16 03:54:06
合計ジャッジ時間 4,151 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
8,608 KB
testcase_01 AC 20 ms
8,628 KB
testcase_02 AC 20 ms
8,784 KB
testcase_03 AC 20 ms
8,644 KB
testcase_04 AC 20 ms
8,580 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 20 ms
8,692 KB
testcase_08 AC 20 ms
8,784 KB
testcase_09 AC 20 ms
8,592 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 122 ms
19,588 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 112 ms
19,432 KB
testcase_18 AC 112 ms
18,784 KB
testcase_19 AC 108 ms
19,240 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,600 KB
testcase_31 AC 92 ms
10,432 KB
testcase_32 AC 94 ms
10,356 KB
testcase_33 AC 60 ms
19,508 KB
testcase_34 AC 21 ms
8,744 KB
testcase_35 AC 19 ms
8,596 KB
testcase_36 AC 19 ms
8,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import *
from collections import deque
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
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 LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    n,x,y,z=MI()
    aa=LI()
    for i in range(n):
        c=aa[i]//10000
        c=min(c,x)
        aa[i]-=10000*c
        x-=c
        if x==0:break
    aa.sort(reverse=True)
    while aa and aa[-1]==0:aa.pop()
    aa=aa[x:]

    for i in range(len(aa)):
        c=aa[i]//5000
        c=min(c,y)
        aa[i]-=5000*c
        y-=c
        if y==0:break
    aa.sort(reverse=True)
    while aa and aa[-1]==0:aa.pop()
    aa=aa[y:]

    for a in aa:
        c=a//1000+1
        z-=c
        if z<0:
            print("No")
            exit()
    print("Yes")

main()
0