← All problemsSign in

Battle Royale

CodeChefRating 2795Open on judge ↗

Chef invented a new game named Quick Battle Royale. $N$ people play the game. One or more rounds are played until all players except one are eliminated. In each round: - Let there be $x$ non-eliminated players at the start of the round. Let's number them $1$ through $x$. - First, each of these players chooses an integer between $1$ and $x$ inclusive. For each valid $i$, let's denote the integer ch

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