Hi everyone!
There are 3 roughly similar problems on Library Checker:
All of them ask us to find $$$c_0, \dots, c_{2^n-1}$$$, where
where $$$\circ$$$ stands for bitwise xor, bitwise and, and "disjoint or" correspondingly.
As of now, my submissions are the fastest one for all 3 problems, and in this blog I'd like to explain how it is achieved.
XOR / AND convolutions are fairly simple, which is why my 30 ms submissions are closely followed by others. However, for subset convolution, my submission uses 94 ms with just 34 MiB, while all other submissions (except the one by Qwerty1232 on the second place, whose approach is similar to mine) use at least 300 ms and 180 MiB each.
If you want to check whether your subset convolution is good, I would suggest trying out 1034E - Little C Loves 3 III. Its constraints are very tight in both time and memory specifically to cut off subset convolution, but an optimal implementation would pass (see e.g. 355217827 by me or 355275135 by Qwerty1232).
Prerequisite: Know how the problems above are solved (e.g. see this blog).












