結果

問題 No.1015 おつりは要らないです
ユーザー tachyon777tachyon777
提出日時 2020-04-03 22:54:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 818 bytes
コンパイル時間 991 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 116,112 KB
最終ジャッジ日時 2023-09-16 04:02:59
合計ジャッジ時間 6,805 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,036 KB
testcase_01 AC 71 ms
71,280 KB
testcase_02 AC 70 ms
71,076 KB
testcase_03 AC 70 ms
70,996 KB
testcase_04 AC 71 ms
71,124 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 71 ms
71,188 KB
testcase_08 AC 71 ms
71,480 KB
testcase_09 AC 71 ms
71,292 KB
testcase_10 AC 144 ms
106,320 KB
testcase_11 AC 140 ms
106,228 KB
testcase_12 AC 138 ms
106,224 KB
testcase_13 AC 140 ms
106,264 KB
testcase_14 AC 144 ms
106,460 KB
testcase_15 AC 140 ms
106,320 KB
testcase_16 AC 139 ms
106,352 KB
testcase_17 AC 140 ms
106,276 KB
testcase_18 AC 141 ms
106,280 KB
testcase_19 AC 140 ms
106,092 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 71 ms
71,472 KB
testcase_31 AC 124 ms
116,112 KB
testcase_32 AC 124 ms
116,000 KB
testcase_33 AC 112 ms
108,280 KB
testcase_34 AC 72 ms
71,316 KB
testcase_35 WA -
testcase_36 AC 74 ms
71,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

n,sen,gosen,man = map(int,readline().split())
lst1 = list(map(int,readline().split()))

S = []
G = []
M = []

for i in lst1:
    i += 1

    M.append(i//10000)

    res = i%10000

    if 9000 < res:
        M[-1] += 1
        continue

    G.append(res//5000)

    res = res%5000

    if 4000 < res:
        G[-1] += 1
        continue

    S.append((res+1000-1)//1000)
S.sort()
for i in S:
    if sen - i >= 0:
        sen -= i
    else:
        G.append(1)

if sen:
    gosen += sen//5
G.sort()
for i in G:
    if gosen - i >= 0:
        gosen -= i
    else:
        M.append(1)

if gosen:
    man += gosen//2
M.sort()
for i in M:
    if man - i >= 0:
        man -= i
    else:
        print("No")
        exit()
print("Yes")

0