結果

問題 No.1015 おつりは要らないです
ユーザー IT_parselyIT_parsely
提出日時 2020-04-03 23:35:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 340 ms / 2,000 ms
コード長 746 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,744 KB
最終ジャッジ日時 2024-04-29 01:20:09
合計ジャッジ時間 8,218 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,880 KB
testcase_01 AC 32 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 32 ms
10,752 KB
testcase_04 AC 33 ms
10,624 KB
testcase_05 AC 34 ms
10,624 KB
testcase_06 AC 31 ms
10,624 KB
testcase_07 AC 32 ms
10,752 KB
testcase_08 AC 30 ms
10,624 KB
testcase_09 AC 33 ms
10,624 KB
testcase_10 AC 320 ms
21,156 KB
testcase_11 AC 335 ms
21,452 KB
testcase_12 AC 320 ms
21,052 KB
testcase_13 AC 340 ms
21,176 KB
testcase_14 AC 332 ms
21,744 KB
testcase_15 AC 325 ms
21,000 KB
testcase_16 AC 321 ms
21,272 KB
testcase_17 AC 333 ms
21,612 KB
testcase_18 AC 316 ms
20,984 KB
testcase_19 AC 323 ms
21,360 KB
testcase_20 AC 251 ms
21,108 KB
testcase_21 AC 245 ms
21,024 KB
testcase_22 AC 250 ms
21,024 KB
testcase_23 AC 240 ms
20,560 KB
testcase_24 AC 256 ms
21,168 KB
testcase_25 AC 254 ms
21,028 KB
testcase_26 AC 250 ms
21,004 KB
testcase_27 AC 247 ms
20,808 KB
testcase_28 AC 254 ms
20,856 KB
testcase_29 AC 250 ms
21,124 KB
testcase_30 AC 30 ms
10,624 KB
testcase_31 AC 201 ms
12,632 KB
testcase_32 AC 208 ms
12,760 KB
testcase_33 AC 98 ms
21,608 KB
testcase_34 AC 30 ms
10,624 KB
testcase_35 AC 30 ms
10,752 KB
testcase_36 AC 30 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, x, y, z = map(int, input().split())
A = list(map(int, input().split()))

for i in range(n):
    yukichi = min(A[i]//10000, z)
    z -= yukichi
    A[i] -= yukichi * 10000
    if not z:
        break

A.sort()
for i in range(z):
    A.pop()
    if not A:
        print('Yes')
        exit()

for i in range(len(A)):
    ichiyo = min(A[i]//5000, y)
    y -= ichiyo
    A[i] -= ichiyo * 5000
    if not y:
        break

A.sort()
for i in range(y):
    A.pop()
    if not A:
        print('Yes')
        exit()

for i in range(len(A)):
    noguchi = min(A[i]//1000, x)
    x -= noguchi
    A[i] -= noguchi * 1000
    if not x:
        break

A.sort()
for i in range(x):
    A.pop()
    if not A:
        print('Yes')
        exit()

print('No')

0