結果

問題 No.1015 おつりは要らないです
ユーザー tachyon777tachyon777
提出日時 2020-04-04 10:34:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 1,001 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 86,016 KB
最終ジャッジ日時 2024-04-29 05:06:04
合計ジャッジ時間 4,696 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
51,968 KB
testcase_01 AC 42 ms
52,096 KB
testcase_02 AC 44 ms
51,840 KB
testcase_03 AC 44 ms
52,096 KB
testcase_04 AC 43 ms
51,968 KB
testcase_05 AC 42 ms
51,840 KB
testcase_06 AC 42 ms
51,840 KB
testcase_07 AC 42 ms
51,840 KB
testcase_08 AC 42 ms
51,840 KB
testcase_09 AC 43 ms
52,096 KB
testcase_10 AC 120 ms
84,992 KB
testcase_11 AC 120 ms
85,376 KB
testcase_12 AC 114 ms
84,864 KB
testcase_13 AC 119 ms
85,632 KB
testcase_14 AC 118 ms
85,504 KB
testcase_15 AC 116 ms
85,248 KB
testcase_16 AC 115 ms
85,248 KB
testcase_17 AC 118 ms
86,016 KB
testcase_18 AC 117 ms
85,248 KB
testcase_19 AC 118 ms
86,016 KB
testcase_20 AC 114 ms
83,840 KB
testcase_21 AC 117 ms
83,712 KB
testcase_22 AC 114 ms
83,456 KB
testcase_23 AC 110 ms
82,816 KB
testcase_24 AC 111 ms
83,840 KB
testcase_25 AC 112 ms
83,328 KB
testcase_26 AC 113 ms
83,584 KB
testcase_27 AC 115 ms
84,096 KB
testcase_28 AC 113 ms
83,200 KB
testcase_29 AC 115 ms
83,840 KB
testcase_30 AC 42 ms
51,840 KB
testcase_31 AC 69 ms
77,952 KB
testcase_32 AC 70 ms
77,824 KB
testcase_33 AC 86 ms
83,840 KB
testcase_34 AC 44 ms
52,096 KB
testcase_35 AC 42 ms
51,712 KB
testcase_36 AC 41 ms
52,096 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:
            mai = min(gosen,lst1[i]//5000)
            lst1[i] -= 5000*mai
            gosen -= mai
    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