← All problemsSign in

Yet Another Array Game

CodeChefRating 2183Open on judge ↗

Alice and Bob play a game on a array $A$ of size $N$. Alice moves first and their turns alternate. Alice also has with her another array $B$, initially empty. On Alice's turn, she chooses any element that remains in $A$, deletes it from $A$, and **appends** it to $B$. On Bob's turn, he chooses any element that remains in $A$ and deletes it. This proceeds till $A$ is empty. Alice *must* ens

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