結果

問題 No.1701 half price
ユーザー Kude
提出日時 2021-10-08 22:00:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 356 bytes
コンパイル時間 393 ms
コンパイル使用メモリ 82,020 KB
実行使用メモリ 76,224 KB
最終ジャッジ日時 2024-07-23 04:13:39
合計ジャッジ時間 1,922 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

n, w = map(int, input().split())

ans = 0
def solve(a, w):
    global ans
    n = len(a)
    for s in range(1 << n):
        x = 0
        for i in range(n):
            if s >> i & 1:
                x += a[i]
        ans += x == w

a = list(map(int, input().split()))
solve(a, w)
for i in range(n):
    solve(a[:i] + a[i + 1:], w - a[i] // 2)

print(ans)
0