位运算的小 trick
\[\def\or{\operatorname{or}}
\def\and{\operatorname{and}}
\def\xor{\operatorname{xor}}
\def\not{\operatorname{not}}
\begin{aligned}
&(x\or y)\and z=(x\and z)\or(y\and z)\\
&\xor (a_i\and v)=(\xor a_i)\and v\\
&\xor (a_i\or v)=
\begin{cases}
(\xor a_i)\and\not v & \text{if } n\text{ is even.}\\
(\xor a_i)\or v & \text{if }n\text{ is odd.}
\end{cases}
\end{aligned}
\]

浙公网安备 33010602011771号