結果

問題 No.1701 half price
ユーザー mink1618033mink1618033
提出日時 2021-10-08 23:16:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 473 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 87,316 KB
実行使用メモリ 77,128 KB
最終ジャッジ日時 2023-09-30 13:05:41
合計ジャッジ時間 3,759 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,332 KB
testcase_01 AC 71 ms
71,368 KB
testcase_02 AC 106 ms
77,064 KB
testcase_03 AC 71 ms
71,460 KB
testcase_04 AC 105 ms
76,988 KB
testcase_05 AC 79 ms
76,688 KB
testcase_06 AC 290 ms
77,100 KB
testcase_07 AC 289 ms
77,128 KB
testcase_08 WA -
testcase_09 AC 72 ms
71,604 KB
testcase_10 AC 71 ms
71,592 KB
testcase_11 AC 70 ms
71,384 KB
testcase_12 AC 70 ms
71,340 KB
testcase_13 AC 70 ms
71,592 KB
testcase_14 AC 69 ms
71,344 KB
testcase_15 AC 70 ms
71,620 KB
testcase_16 AC 70 ms
71,284 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 70 ms
71,464 KB
testcase_21 AC 347 ms
76,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,w = map(int,input().split())
a = list(map(int,input().split()))
a2 = [i//2 for i in a]
cnt=0          

for bit in range(1<<n):
    li = []
    for j in range(n):
        if (bit>>j)&1==1:
            li.append(j)
    l = len(li)
    for j in range(1<<l):
        ka = 0
        for k in range(l):
            if (j>>k)&1==1:
                ka+= a2[li[k]]
            else:
                ka+= a[li[k]]
        if ka==w:
            cnt+=1
            break
print(cnt)
0