結果

問題 No.1701 half price
ユーザー wgrapewgrape
提出日時 2024-11-11 11:07:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 442 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 61,440 KB
最終ジャッジ日時 2024-11-11 11:07:07
合計ジャッジ時間 3,569 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = set()
for status in range(3 ** N):
    i = 0
    val = 0
    cond = 0
    while status:
        if status % 3 == 2:
            val += A[i]
            cond |= (1 << i)
        elif status % 3 == 1:
            val += A[i] // 2
            cond |= (1 << i)
        status //= 3
        i += 1
    if val == W:
        ans.add(cond)
        
print(len(ans))
            
0