Xor Separation
You are given a sequence $A_1, A_2, \ldots, A_N$. Find the number of ways to split it into one or more non-empty contiguous subsequences $B_1, B_2, \ldots, B_k$ such that the following condition is satisfied: for each $i$ ($1 \le i \le k$), the XOR of all elements in $B_i$ is divisible by $2^{i-1}$. Since this number can be enormous, compute it modulo $1,000,000,007$ ($10^9 + 7$). ### Input -
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