Finding The XOR
CodeChefOpen on judge ↗
Given a long integer $x$, count the number of values of $a$ satisfying the following conditions: - $a ⊕ x \gt x$ - $0 \lt a \lt x$ where $a$ and $x$ are long integers and $⊕$ is the bitwise XOR operator. You are given $q$ queries, and each query is in the form of a long integer denoting $x$. For each query, print the total number of values of $a$ satisfying the conditions above on a new lin
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