結果

問題 No.1015 おつりは要らないです
ユーザー tanon710tanon710
提出日時 2020-05-04 18:04:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,147 bytes
コンパイル時間 455 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 99,156 KB
最終ジャッジ日時 2023-09-07 00:50:02
合計ジャッジ時間 8,039 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,468 KB
testcase_01 AC 71 ms
71,164 KB
testcase_02 AC 71 ms
71,440 KB
testcase_03 AC 71 ms
71,404 KB
testcase_04 AC 70 ms
71,308 KB
testcase_05 AC 72 ms
71,472 KB
testcase_06 AC 72 ms
71,476 KB
testcase_07 AC 72 ms
71,404 KB
testcase_08 AC 71 ms
71,432 KB
testcase_09 AC 71 ms
71,432 KB
testcase_10 AC 155 ms
98,116 KB
testcase_11 AC 139 ms
96,680 KB
testcase_12 AC 151 ms
97,596 KB
testcase_13 AC 136 ms
96,424 KB
testcase_14 AC 153 ms
97,968 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 147 ms
97,888 KB
testcase_21 AC 148 ms
98,072 KB
testcase_22 AC 147 ms
97,976 KB
testcase_23 AC 141 ms
97,248 KB
testcase_24 AC 144 ms
97,976 KB
testcase_25 AC 147 ms
98,416 KB
testcase_26 AC 150 ms
97,976 KB
testcase_27 AC 148 ms
97,956 KB
testcase_28 AC 147 ms
98,176 KB
testcase_29 AC 148 ms
98,096 KB
testcase_30 AC 70 ms
71,492 KB
testcase_31 AC 95 ms
94,656 KB
testcase_32 AC 98 ms
94,636 KB
testcase_33 AC 108 ms
96,468 KB
testcase_34 AC 70 ms
71,276 KB
testcase_35 AC 73 ms
71,308 KB
testcase_36 AC 74 ms
71,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,x,y,z=map(int,input().split())
arr=list(map(int,input().split()))
arr=sorted(arr,reverse=True)
for i in range(n):
    k=arr[i]//10000
    if k==0:
        break
    if z>=k:
        arr[i]-=k*10000
        z-=k
    else:
        arr[i]-=z*10000
        break
arr=sorted(arr,reverse=True)
for i in range(n):
    if z==0:
        break
    else:
        arr[i]=-1
        z-=1
if arr.count(-1)==n:
    print('Yes')
    exit()
arr=sorted(arr,reverse=True)
for i in range(n):
    k=arr[i]//5000
    if k==0:
        break
    if y>=k:
        arr[i]-=k*5000
        y-=k
    else:
        arr[i]-=y*5000
        break
arr=sorted(arr,reverse=True)
for i in range(n):
    if y==0:
        break
    else:
        arr[i]=-1
        y-=1
if arr.count(-1)==n:
    print('Yes')
    exit()
arr=sorted(arr,reverse=True)
for i in range(n):
    k=arr[i]//1000
    if k==0:
        break
    if x>=k:
        arr[i]-=k*1000
        x-=k
    else:
        arr[i]-=x*1000
        break
arr=sorted(arr,reverse=True)
for i in range(n):
    if x==0:
        break
    else:
        arr[i]=-1
        x-=1
if arr.count(-1)==n:
    print('Yes')
    exit()
print('No')
0