結果

問題 No.1015 おつりは要らないです
ユーザー convexineqconvexineq
提出日時 2020-04-03 21:57:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 688 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 10,880 KB
実行使用メモリ 19,200 KB
最終ジャッジ日時 2023-09-16 01:25:23
合計ジャッジ時間 4,466 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,772 KB
testcase_01 AC 16 ms
7,720 KB
testcase_02 AC 16 ms
7,888 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 16 ms
7,768 KB
testcase_08 WA -
testcase_09 AC 16 ms
7,968 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 91 ms
18,276 KB
testcase_16 AC 92 ms
18,856 KB
testcase_17 AC 95 ms
18,924 KB
testcase_18 AC 94 ms
18,420 KB
testcase_19 AC 89 ms
18,756 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 16 ms
7,772 KB
testcase_31 AC 69 ms
10,128 KB
testcase_32 AC 69 ms
10,128 KB
testcase_33 AC 93 ms
19,008 KB
testcase_34 AC 16 ms
7,952 KB
testcase_35 AC 16 ms
7,900 KB
testcase_36 AC 16 ms
7,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read

n,x,y,z = [int(i) for i in readline().split()]
a = [int(i)//1000+1 for i in readline().split()]

val = val5 = 0
num = [0]*5
for ai in a:
    val += ai//10*10
    if ai%10>=5:
        val5 += 1
    num[ai%5] += 1

#print(num,val,val5,x,y,z)

c = min(val//10,z)
val -= c*10
z -= c

val5 += val
y += z
c = min(val5//5,y)
val -= c*5
y -= c

#print(num,val,val5,x,y,z)

for i in range(4,-1,-1):
    c =  min(y,num[i])
    y -= c
    num[i] -= c

k = sum(i*ni for i,ni in enumerate(num))
#print(val,num,k,x,y)
if val5+k <= x:
    print("Yes")
else:
    print("No")

0