Marble Game
CodeChefOpen on judge ↗
$n$ marbles are placed on a cyclic gameboard, divided into $m$ cells. The cells are numbered $1$ to $m$. The board is cyclic, so cell $1$ goes right after the cell $m$ in the direction of movement. $i$-th marble can move $ai$ cells during its turn . The marbles are moved in turns; game starts with a move by marble 1. In its turn, $i$-th marble moves $ai$ cells forward, knocking out all the marb
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