結果

問題 No.1701 half price
ユーザー SPD_9X2
提出日時 2021-10-08 22:03:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 427 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 77,164 KB
最終ジャッジ日時 2024-07-23 04:18:42
合計ジャッジ時間 3,848 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

"""
from sys import stdin
import sys

N,W = map(int,stdin.readline().split())

a = list(map(int,stdin.readline().split()))

ans = set()
for i in range(3**N):

    now = 0
    s = []
    for j in range(N):
        if i % 3 == 0:
            now += a[j]
        elif i % 3 == 1:
            now += a[j] // 2
        else:
            s.append(j)
        i //= 3

    if now == W:
        ans.add(tuple(s))

print (len(ans))
0