結果

問題 No.1015 おつりは要らないです
ユーザー setsunasetsuna
提出日時 2020-06-25 15:48:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 19,192 KB
最終ジャッジ日時 2023-09-16 22:44:33
合計ジャッジ時間 7,674 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,800 KB
testcase_01 AC 16 ms
8,116 KB
testcase_02 AC 16 ms
8,040 KB
testcase_03 AC 16 ms
7,844 KB
testcase_04 WA -
testcase_05 AC 16 ms
7,864 KB
testcase_06 AC 16 ms
7,780 KB
testcase_07 AC 16 ms
8,116 KB
testcase_08 AC 16 ms
8,124 KB
testcase_09 AC 16 ms
8,220 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 226 ms
18,348 KB
testcase_16 AC 236 ms
18,696 KB
testcase_17 AC 243 ms
18,920 KB
testcase_18 AC 239 ms
18,536 KB
testcase_19 AC 232 ms
18,608 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 16 ms
8,036 KB
testcase_31 AC 165 ms
10,032 KB
testcase_32 AC 164 ms
9,864 KB
testcase_33 AC 88 ms
18,984 KB
testcase_34 AC 16 ms
7,828 KB
testcase_35 AC 16 ms
7,748 KB
testcase_36 AC 16 ms
7,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X, Y, Z = map(int, input().split())
A = sorted([x // 1000 + 1 for x in list(map(int, input().split()))])

for i in range(N):
    x, y, z = A[i], 0, 0
    if x > X:
        y = (x - X) // 5 + int((x - X) % 5 != 0)
        x = max(x - y * 5, 0)
    if y > Y:
        z = (y - Y) // 2 + int((y - Y) % 2 != 0)
        y = max(y - z * 2, 0)
    if z > Z:
        print('No')
        exit()

    X -= x
    Y -= y
    Z -= z
print('Yes')
0