結果

問題 No.1015 おつりは要らないです
ユーザー sanpohappysanpohappy
提出日時 2020-04-04 19:36:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 767 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 10,892 KB
実行使用メモリ 19,008 KB
最終ジャッジ日時 2023-09-16 06:07:29
合計ジャッジ時間 7,720 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,692 KB
testcase_01 AC 15 ms
8,148 KB
testcase_02 AC 15 ms
8,236 KB
testcase_03 AC 16 ms
7,772 KB
testcase_04 AC 16 ms
7,728 KB
testcase_05 AC 16 ms
7,800 KB
testcase_06 AC 15 ms
7,828 KB
testcase_07 AC 15 ms
8,148 KB
testcase_08 AC 15 ms
8,212 KB
testcase_09 AC 15 ms
8,280 KB
testcase_10 AC 311 ms
18,596 KB
testcase_11 AC 309 ms
18,808 KB
testcase_12 AC 296 ms
18,040 KB
testcase_13 AC 306 ms
18,624 KB
testcase_14 AC 322 ms
19,008 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
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,104 KB
testcase_31 AC 138 ms
12,728 KB
testcase_32 AC 137 ms
12,676 KB
testcase_33 WA -
testcase_34 AC 15 ms
7,900 KB
testcase_35 WA -
testcase_36 AC 15 ms
7,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X,Y,Z = [int(i) for i in input().split(' ')]
A = [int(i) for i in input().split(' ')]

sort_A = sorted(A)
for i,j in enumerate(sort_A):
    a = j  // 10000
    Z -= a
    sort_A[i] -= a * 10000

for d in range(1,6):
    for i,j in enumerate(sort_A):
        if X > d -1:
            if j%5000 < (d * 1000):
                sort_A[i] -= d * 1000
                X -= 1 * d
                flg = 1
        else:
            break

for i,j in enumerate(sort_A):
    j % 5000
    while j >= 5000 and Z > 0:
        j -= 10000
        Z -= 1
    while j > 0 and (Z> 0 or Y >0):
        j -= 5000
        if Y>0:
            Y -= 1
        elif Z > 0:
            Z -= 1
    sort_A[i] = j

    if j >=0 and Y<=0 and Z <=0:
        print('No')
        exit()

print('Yes')
0