結果

問題 No.1015 おつりは要らないです
ユーザー ゼットゼット
提出日時 2023-10-08 19:43:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 833 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 92,132 KB
最終ジャッジ日時 2023-10-08 19:43:19
合計ジャッジ時間 5,409 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,332 KB
testcase_01 AC 72 ms
71,328 KB
testcase_02 AC 74 ms
71,664 KB
testcase_03 AC 71 ms
71,672 KB
testcase_04 AC 72 ms
71,492 KB
testcase_05 AC 73 ms
71,552 KB
testcase_06 AC 70 ms
71,192 KB
testcase_07 AC 73 ms
71,340 KB
testcase_08 AC 74 ms
71,332 KB
testcase_09 AC 70 ms
71,332 KB
testcase_10 AC 104 ms
91,532 KB
testcase_11 AC 101 ms
91,556 KB
testcase_12 AC 102 ms
91,296 KB
testcase_13 AC 102 ms
91,520 KB
testcase_14 AC 103 ms
91,696 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 94 ms
91,060 KB
testcase_21 AC 95 ms
91,232 KB
testcase_22 AC 95 ms
91,068 KB
testcase_23 AC 94 ms
91,284 KB
testcase_24 AC 93 ms
91,280 KB
testcase_25 AC 92 ms
91,044 KB
testcase_26 AC 94 ms
91,040 KB
testcase_27 AC 94 ms
91,164 KB
testcase_28 AC 93 ms
91,296 KB
testcase_29 AC 101 ms
91,196 KB
testcase_30 AC 69 ms
71,448 KB
testcase_31 AC 90 ms
89,324 KB
testcase_32 AC 91 ms
89,372 KB
testcase_33 AC 103 ms
92,132 KB
testcase_34 AC 71 ms
71,644 KB
testcase_35 AC 70 ms
71,196 KB
testcase_36 AC 69 ms
71,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,x,y,z=map(int,input().split())
A=list(map(int,input().split()))
v=[0]*10
for i in range(N):
  n=A[i]
  n+=1000
  h=n//(10000)
  if z>=h:
    z-=h
  else:
    h-=z
    z=0
    if y>=2*h:
      y-=2*h
    else:
      cost=10000*h
      cost-=5000*y
      if 1000*x>=cost:
        x-=cost//(1000)
      else:
        print('No')
        exit()
  t=(A[i]+1000)%(10000)
  v[t//(1000)]+=1
for i in range(9,0,-1):
  if z>=v[i]:
    z-=v[i]
    v[i]=0
  else:
    v[i]-=z
    z=0
for i in range(9,0,-1):
  if y>=v[i]:
    if i>=5:
      v[i-5]+=v[i]
      y-=v[i]
      v[i]=0
    else:
      y-=v[i]
      v[i]=0
  else:
    if i>=5:
      v[i-5]+=y
      v[i]-=y
      y=0
    else:
      v[i]-=y
      y=0
for i in range(9,0,-1):
  if x>=i*v[i]:
    x-=i*v[i]
    v[i]=0
v[0]=0
if sum(v)==0:
  print('Yes')
else:
  print('No')
  
      
0