結果

問題 No.1015 おつりは要らないです
ユーザー takakintakakin
提出日時 2020-04-03 22:31:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 757 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 10,996 KB
実行使用メモリ 19,236 KB
最終ジャッジ日時 2023-09-16 03:16:33
合計ジャッジ時間 6,079 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,256 KB
testcase_01 AC 17 ms
8,248 KB
testcase_02 AC 19 ms
8,308 KB
testcase_03 AC 18 ms
8,212 KB
testcase_04 RE -
testcase_05 AC 17 ms
8,216 KB
testcase_06 AC 17 ms
8,312 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 199 ms
18,572 KB
testcase_11 AC 209 ms
18,752 KB
testcase_12 AC 195 ms
18,240 KB
testcase_13 AC 205 ms
18,804 KB
testcase_14 AC 209 ms
19,236 KB
testcase_15 AC 193 ms
18,384 KB
testcase_16 AC 204 ms
18,760 KB
testcase_17 AC 207 ms
18,816 KB
testcase_18 AC 198 ms
18,616 KB
testcase_19 AC 199 ms
18,652 KB
testcase_20 AC 162 ms
18,704 KB
testcase_21 AC 164 ms
18,676 KB
testcase_22 AC 162 ms
18,780 KB
testcase_23 AC 155 ms
18,176 KB
testcase_24 AC 166 ms
18,832 KB
testcase_25 AC 165 ms
18,684 KB
testcase_26 AC 160 ms
18,616 KB
testcase_27 AC 164 ms
18,596 KB
testcase_28 AC 160 ms
18,684 KB
testcase_29 AC 161 ms
18,920 KB
testcase_30 AC 16 ms
8,300 KB
testcase_31 AC 115 ms
9,976 KB
testcase_32 AC 117 ms
10,068 KB
testcase_33 AC 83 ms
18,992 KB
testcase_34 AC 17 ms
8,248 KB
testcase_35 AC 17 ms
8,376 KB
testcase_36 AC 16 ms
7,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n,x,y,z=map(int,input().split())
A=[int(i) for i in input().split()]
t=0
chk=True
for i in range(n):
  t+=A[i]//10000
  A[i]%=10000
if z>=t:
  z-=t
else:
  t-=z
  z=0
  if y>=2*t:
    y-=2*t
  else:
    t=t*10-y*5
    y=0
    if t>=x:
      chk=False
    else:
      x-=t
if not chk:
  print("No")
else:
  if z>=n:
    print("Yes")
  else:
    A.sort()
    A=A[:n-z]
    import heapq
    heapq.heapify(A)
    while A:
      a=heapq.heappop(A)
      if a==0:
        a=1
      aa=(a-1)//1000+1
      if aa>x+5*y:
        print("No")
        break
      if x>=aa:
        x-=aa
      else:
        y-=1
        if aa>5:
          heapq.heappop(a-5)
      if not A:
        print("Yes")
        break




0