結果

問題 No.1015 おつりは要らないです
ユーザー tachyon777tachyon777
提出日時 2020-04-04 00:26:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,062 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 92,208 KB
最終ジャッジ日時 2023-09-16 05:08:18
合計ジャッジ時間 5,984 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,384 KB
testcase_01 AC 78 ms
71,300 KB
testcase_02 AC 74 ms
71,324 KB
testcase_03 WA -
testcase_04 AC 75 ms
71,412 KB
testcase_05 AC 81 ms
71,132 KB
testcase_06 AC 74 ms
71,324 KB
testcase_07 AC 74 ms
71,284 KB
testcase_08 AC 75 ms
71,456 KB
testcase_09 AC 76 ms
71,216 KB
testcase_10 AC 128 ms
90,904 KB
testcase_11 AC 128 ms
91,344 KB
testcase_12 AC 125 ms
90,984 KB
testcase_13 AC 129 ms
90,944 KB
testcase_14 AC 126 ms
91,040 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 138 ms
91,688 KB
testcase_21 AC 136 ms
91,520 KB
testcase_22 AC 134 ms
91,664 KB
testcase_23 AC 135 ms
91,716 KB
testcase_24 AC 136 ms
91,764 KB
testcase_25 AC 137 ms
92,208 KB
testcase_26 AC 135 ms
91,700 KB
testcase_27 AC 134 ms
91,924 KB
testcase_28 AC 135 ms
91,768 KB
testcase_29 AC 135 ms
92,096 KB
testcase_30 AC 75 ms
71,300 KB
testcase_31 AC 95 ms
89,736 KB
testcase_32 AC 97 ms
89,520 KB
testcase_33 AC 95 ms
89,076 KB
testcase_34 AC 75 ms
71,536 KB
testcase_35 AC 75 ms
71,328 KB
testcase_36 AC 74 ms
71,464 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()))

lst1.sort(reverse=True)
for i in range(len(lst1)):
    if lst1[i]%10000 == 0: #10000で割り切れてしまう時点でfalse
        print("No")
        exit()
    lst1[i] += 1 #lst1[i]+1円を支払う必要がある
i = 0
l = len(lst1)
while True:
    if i >= l:
        break
    if lst1[i] < 10000:
        break
    else:
        if man > 0:
            mai = min(man,lst1[i]//10000)
            lst1[i] -= mai*10000
            man -= mai
    i += 1
        

lst1.sort(reverse=True)
if man:
    lst1 = lst1[man:]

i = 0
l = len(lst1)
while True:
    if i >= l:
        break
    if lst1[i] < 5000:
        break
    else:
        if gosen > 0:
            lst1[i] -= 5000
            gosen -= 1
    i += 1

lst1.sort(reverse=True)
if gosen:
    lst1 = lst1[gosen:]

need = 0
for i in lst1:
    need += (i+1000-1)//1000

if sen >= need:
    print("Yes")
else:
    print("No") 


0