Alan and Marbles
CodeChefOpen on judge ↗
Alan has $N$ cylindrical tubes placed in a sequence. In $i^{th}$ cylinder there are $a_i$ marbles. All the cylinders have the same diameter and all the marbles have the same diameter. The diameter of the cylinders is just slightly greater than that of the marbles, thus the marbles will form a **queue** in the cylinders. In **one minute**, **one marble exits** through the bottom of the cyli
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