結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,956 KB
testcase_01 AC 15 ms
7,844 KB
testcase_02 AC 15 ms
7,840 KB
testcase_03 AC 15 ms
7,816 KB
testcase_04 AC 16 ms
7,832 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 15 ms
7,820 KB
testcase_08 AC 15 ms
7,816 KB
testcase_09 AC 15 ms
7,848 KB
testcase_10 AC 92 ms
18,760 KB
testcase_11 AC 95 ms
19,032 KB
testcase_12 AC 92 ms
18,224 KB
testcase_13 AC 92 ms
18,428 KB
testcase_14 AC 98 ms
19,068 KB
testcase_15 AC 91 ms
18,356 KB
testcase_16 AC 91 ms
18,840 KB
testcase_17 AC 96 ms
18,996 KB
testcase_18 AC 93 ms
18,496 KB
testcase_19 AC 90 ms
18,636 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 15 ms
7,768 KB
testcase_31 AC 69 ms
9,912 KB
testcase_32 AC 72 ms
10,004 KB
testcase_33 AC 94 ms
19,124 KB
testcase_34 AC 16 ms
7,776 KB
testcase_35 WA -
testcase_36 AC 15 ms
7,952 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 += 5
    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)
val5 -= 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