結果

問題 No.1015 おつりは要らないです
ユーザー w0mbatw0mbat
提出日時 2020-04-03 23:18:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 656 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 94,128 KB
最終ジャッジ日時 2023-09-16 04:44:36
合計ジャッジ時間 5,855 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,064 KB
testcase_01 AC 75 ms
71,312 KB
testcase_02 AC 80 ms
71,480 KB
testcase_03 AC 76 ms
71,068 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 78 ms
71,456 KB
testcase_08 AC 76 ms
71,200 KB
testcase_09 AC 75 ms
71,096 KB
testcase_10 AC 126 ms
93,460 KB
testcase_11 AC 122 ms
93,832 KB
testcase_12 AC 123 ms
93,760 KB
testcase_13 AC 124 ms
93,536 KB
testcase_14 AC 126 ms
94,128 KB
testcase_15 AC 125 ms
93,548 KB
testcase_16 AC 125 ms
93,484 KB
testcase_17 AC 124 ms
93,704 KB
testcase_18 AC 119 ms
93,668 KB
testcase_19 AC 120 ms
93,768 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 77 ms
71,416 KB
testcase_31 AC 110 ms
91,476 KB
testcase_32 AC 112 ms
91,424 KB
testcase_33 AC 124 ms
94,120 KB
testcase_34 AC 80 ms
71,320 KB
testcase_35 AC 78 ms
71,192 KB
testcase_36 AC 77 ms
71,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X,Y,Z=map(int, input().split())
*A,=map(lambda x:1+int(x)//1000, input().split())

ans = True
for i in range(N):
    d = min(Z, A[i] // 10)
    Z -= d
    A[i] -= 10 * d
for i in range(N):
    d = min(Y, A[i] // 5)
    Y -= d
    A[i] -= 5 * d
for a in A:
    if a > 5 and Z > 0:
        Z -= 1
        a -= 10
    if a > 1 and Y > 0:
        Y -= 1
        a -= 5
    if a > 0:
        d = min(X,a)
        X -= d
        a -= d
    if a > 0:
        d = min(Y,1+a//5)
        Y -= d
        a -= d*5
    if a > 0:
        d = min(Z,1+a//10)
        Z -= d
        a -= d*10
    if a > 0:
        ans = False
        break

print('Yes' if ans else 'No')
0