結果

問題 No.1701 half price
ユーザー neko_the_shadow
提出日時 2021-10-10 01:18:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 75,776 KB
最終ジャッジ日時 2024-09-13 15:40:23
合計ジャッジ時間 3,633 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = set()
for bit in range(3**n):
    x = bit
    total = 0
    key = 0
    for i in range(n):
        y = x % 3
        x //= 3
        if y == 1: total += a[i]
        if y == 2: total += a[i] // 2
        if y != 0: key |= (1 << i)
    if total == w: ans.add(key)

print(len(ans))
0