結果

問題 No.1015 おつりは要らないです
ユーザー tachyon777tachyon777
提出日時 2020-04-04 00:47:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 952 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 17,460 KB
最終ジャッジ日時 2023-09-16 05:10:39
合計ジャッジ時間 5,912 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,768 KB
testcase_01 AC 16 ms
7,884 KB
testcase_02 AC 18 ms
7,752 KB
testcase_03 AC 17 ms
7,840 KB
testcase_04 AC 16 ms
7,836 KB
testcase_05 AC 17 ms
7,696 KB
testcase_06 AC 17 ms
7,768 KB
testcase_07 AC 16 ms
7,780 KB
testcase_08 AC 15 ms
7,764 KB
testcase_09 AC 16 ms
7,788 KB
testcase_10 AC 186 ms
16,872 KB
testcase_11 AC 187 ms
17,396 KB
testcase_12 AC 166 ms
16,876 KB
testcase_13 AC 181 ms
17,044 KB
testcase_14 AC 190 ms
17,404 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 205 ms
17,064 KB
testcase_21 AC 193 ms
16,864 KB
testcase_22 AC 199 ms
16,864 KB
testcase_23 AC 203 ms
16,692 KB
testcase_24 AC 204 ms
17,252 KB
testcase_25 AC 194 ms
16,948 KB
testcase_26 AC 195 ms
16,908 KB
testcase_27 AC 190 ms
16,984 KB
testcase_28 AC 202 ms
16,820 KB
testcase_29 AC 199 ms
16,956 KB
testcase_30 AC 16 ms
7,688 KB
testcase_31 AC 50 ms
9,904 KB
testcase_32 AC 50 ms
9,988 KB
testcase_33 WA -
testcase_34 AC 16 ms
7,788 KB
testcase_35 AC 16 ms
7,792 KB
testcase_36 AC 16 ms
7,868 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)):
    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