[COCI 2022/2023 #5] Diskurs

· · 题解

从大到小枚举答案 k。

把所有 $\operatorname{popcount}(x)=k$ 的 $x$ 拿出来和 $a$ FWT 即可。复杂度 $O(m^2 2^m)$。