結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,912 KB
testcase_01 AC 15 ms
7,860 KB
testcase_02 AC 16 ms
7,880 KB
testcase_03 AC 16 ms
7,852 KB
testcase_04 AC 16 ms
7,908 KB
testcase_05 AC 16 ms
7,796 KB
testcase_06 AC 15 ms
7,888 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 92 ms
18,800 KB
testcase_11 AC 96 ms
18,988 KB
testcase_12 AC 91 ms
18,268 KB
testcase_13 AC 94 ms
18,440 KB
testcase_14 AC 101 ms
19,212 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 93 ms
18,612 KB
testcase_21 AC 93 ms
18,568 KB
testcase_22 AC 93 ms
18,560 KB
testcase_23 AC 91 ms
18,280 KB
testcase_24 AC 96 ms
18,952 KB
testcase_25 AC 95 ms
18,496 KB
testcase_26 AC 93 ms
18,580 KB
testcase_27 AC 92 ms
18,384 KB
testcase_28 AC 90 ms
18,336 KB
testcase_29 AC 91 ms
18,732 KB
testcase_30 AC 16 ms
7,848 KB
testcase_31 AC 69 ms
10,016 KB
testcase_32 AC 71 ms
10,032 KB
testcase_33 AC 94 ms
19,160 KB
testcase_34 AC 15 ms
7,908 KB
testcase_35 AC 15 ms
7,852 KB
testcase_36 AC 15 ms
7,836 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 val+k <= x:
    print("Yes")
else:
    print("No")

0