結果

問題 No.1701 half price
ユーザー titiatitia
提出日時 2021-10-08 22:12:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 366 bytes
コンパイル時間 1,044 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 77,468 KB
最終ジャッジ日時 2023-09-30 10:31:16
合計ジャッジ時間 3,622 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,376 KB
testcase_01 AC 73 ms
71,432 KB
testcase_02 AC 92 ms
76,808 KB
testcase_03 AC 74 ms
71,400 KB
testcase_04 AC 94 ms
77,468 KB
testcase_05 AC 79 ms
76,216 KB
testcase_06 AC 103 ms
77,016 KB
testcase_07 AC 129 ms
77,432 KB
testcase_08 WA -
testcase_09 AC 75 ms
71,580 KB
testcase_10 AC 74 ms
71,400 KB
testcase_11 AC 74 ms
71,244 KB
testcase_12 AC 73 ms
71,532 KB
testcase_13 AC 74 ms
71,492 KB
testcase_14 AC 75 ms
71,396 KB
testcase_15 AC 73 ms
71,324 KB
testcase_16 AC 73 ms
71,248 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 73 ms
71,404 KB
testcase_21 AC 90 ms
77,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,W=map(int,input().split())
A=list(map(int,input().split()))
ANS=0


for j in range(1<<N):
    sc={0}

    for k in range(N):
        AD=[]
        if j & (1<<k)!=0:
            for x in sc:
                AD.append(x+A[k])
                AD.append(x+A[k]//2)
            sc=set(AD)


    #print(j,sc)
                

    if W in sc:
        ANS+=1

print(ANS)
0