← All problemsSign in

Binary Puzzle

CodeChefRating 2700Open on judge ↗

Salmon is playing a game! He is given two integers $N$ and $K$. His goal is to output $K$ pairs $(x_i,y_i)$. He creates a function $f$ such that $f(x_i) = y_i$ and $f$ is undefined for all other values of $x$. His pairs must then meet the following conditions: - All $x_i$ are distinct. - All $y_i$ are distinct. - All $x_i, y_i$ are in the range $[0,2^N - 1]$ and are integers. - $f(f(x_i))

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