← All problemsSign in

Xorry 2

CodeChefRating 1788Open on judge ↗

[This problem is very similar to XORRY1. The only difference is that instead of printing any one Xorry pair, you are now asked to count the number of Xorry pairs] You are given an integer $X$. Two integers ($A$, $B$) are said to be an Xorry pair, if the following conditions are satisfied: - $A \oplus B = X$ - $0 \leq A \leq B \leq X$ - Among all the pairs which satisfy the above two conditions,

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