← All problemsSign in

Chess Pairing

CodeChefRating 892Open on judge ↗

You are hosting a chess tournament with $2N$ people. Exactly $X$ of them are *rated* players, and the remaining $2N - X$ are *unrated* players. Your job is to distribute the players into $N$ pairs, where every player plays against the person paired up with them. Since you want the rated players to have an advantage, you want to pair them with unrated players. Thus, you want to **minimize** the n

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