Throw and Take
There is a line consisting of $N$ piles of coins on the table. For each $i$ ($1 \leq i \leq N$), the $i$-th pile contains $C_i$ coins, each with value $V_i$. There is also a bin under the table. Alice and Bob play a game, moving alternately. A move consists of two steps: - Throw a prefix of the piles in the bin (the prefix can be empty). Then, if there are no coins left on the table, the game end
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.
Sign in to chat with the tutor and save your progress.
Sign in to start