← All problemsSign in

You Know XOR!

You are given array $a$ of $N$ element. You are goven $M$ query in each query you have to calculate function $f(l,r,k)$. The function $f(l,r,k)$ is define as follow: $f(l,r,k) = \sum_{i_1=l}^{r} \sum_{i_2=l}^{r} \sum_{i_3=l}^{r} \dots \sum_{i_k=l}^{r} a_{i_1} \oplus a_{i_2} \oplus a_{i_3} \oplus \dots \oplus a_{i_k}$ The answer may large so print $10^9 +7$ modulo it. ###Input: - Fi

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start