Subsequences of Subsequences
Define $f(A)$ for an array $A$ of length $N$ as the number of elements $X$ such that there exists an array $C$, also of length $N$, satisfying : - $0 \le C_i \le 1$ - $\bigoplus_{i = 1}^{N} (A_i \cdot C_i) = X$, where $\oplus$ represents the bitwise XOR operator. This is equivalent to choosing some (possibly-empty) subsequence of $A$ (the elements with $C_i = 1$), and then their XOR should
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start