← All problemsSign in

Mystical Numbers

CodeChefRating 1702Open on judge ↗

A number $M$ is said to be a *Mystical Number* with respect to a number $X$ if $(M \oplus X) \gt (M \& X)$. You are given an array $A$ of size $N$. You are also given $Q$ queries. Each query consists of three integers $L$, $R$, and $X$. For each query, find the count of *Mystical Numbers* in the subarray $A[L:R]$ with respect to the number $X$. **Notes:** - $\oplus$ represents the [Bitwise XOR

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