← All problemsSign in

Pile Partition

CodeChefRating 2803Open on judge ↗

Alice and Bob are playing a game. At the start of the game, there are $N$ piles of stones, the $i$-th of which has $A_i$ stones. Alice and Bob alternate moves. On their move, a player does the following: - Choose one pile of stones, and discard the remaining $N-1$ piles. - Partition the stones in the chosen pile into **exactly** $N$ new piles of stones, each containing at least $1$ stone. Note th

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