結果

問題 No.1015 おつりは要らないです
ユーザー とらすたとらすた
提出日時 2020-04-03 23:02:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,000 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 11,036 KB
実行使用メモリ 23,084 KB
最終ジャッジ日時 2023-09-16 04:16:40
合計ジャッジ時間 4,188 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
12,620 KB
testcase_01 AC 16 ms
8,184 KB
testcase_02 AC 15 ms
8,228 KB
testcase_03 AC 16 ms
8,264 KB
testcase_04 AC 16 ms
8,268 KB
testcase_05 AC 15 ms
8,208 KB
testcase_06 AC 16 ms
8,292 KB
testcase_07 AC 15 ms
8,268 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,x,y,z = na()
a = na()
a.reverse()
b = [0]*n

#10000-
for i in range(n):
    k = 0
    while True:
        if k*10000 >= a[i] or k > z:
            break
        k+=1
    a[i] -= 10000*k
    z -= k
    if z == 0:
        break

if len(a) <= z:
    print('Yes')
    exit()

a = sorted(a, reverse=True)[z:]

#5000-
for i in range(len(a)):
    k = 0
    while True:
        if k*5000 >= a[i] or k > y:
            break
        k+=1
    a[i] -= 5000*k
    y -= k
    if y == 0:
        break

if len(a) <= y:
    print('Yes')
    exit()

a = sorted(a, reverse=True)[y:]

#1000-
for i in range(len(a)):
    k = 0
    while True:
        if k*1000 >= a[i] or k > x:
            break
        k+=1
    a[i] -= 1000*k
    x -= k
    if x == 0:
        break

if len(a) <= x:
    print('Yes')
    exit()

print('No')
0