結果

問題 No.1015 おつりは要らないです
ユーザー tachyon777tachyon777
提出日時 2020-04-03 22:44:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 704 bytes
コンパイル時間 1,121 ms
コンパイル使用メモリ 86,624 KB
実行使用メモリ 116,028 KB
最終ジャッジ日時 2023-09-16 03:48:46
合計ジャッジ時間 7,353 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,132 KB
testcase_01 AC 77 ms
71,048 KB
testcase_02 AC 74 ms
71,156 KB
testcase_03 AC 74 ms
70,956 KB
testcase_04 AC 76 ms
70,960 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 74 ms
71,264 KB
testcase_08 AC 76 ms
71,120 KB
testcase_09 AC 73 ms
71,040 KB
testcase_10 AC 149 ms
109,132 KB
testcase_11 AC 144 ms
109,492 KB
testcase_12 AC 145 ms
109,004 KB
testcase_13 AC 147 ms
109,060 KB
testcase_14 AC 149 ms
109,512 KB
testcase_15 AC 144 ms
109,372 KB
testcase_16 AC 148 ms
109,476 KB
testcase_17 AC 149 ms
109,336 KB
testcase_18 AC 147 ms
109,084 KB
testcase_19 AC 149 ms
109,436 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 75 ms
71,108 KB
testcase_31 AC 128 ms
115,772 KB
testcase_32 AC 128 ms
116,028 KB
testcase_33 AC 121 ms
107,912 KB
testcase_34 AC 76 ms
71,112 KB
testcase_35 WA -
testcase_36 AC 75 ms
71,164 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

    G.append(res//5000)

    res = i%5000

    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