← All problemsSign in

ATM Queue

CodeChefRating 2911Open on judge ↗

There are $N$ people waiting in a queue at ATM. The $i^{th}$ person in the queue has a power level equal to $A_i$ ($1 \leq A_i \leq N$). The following process happens every second till the queue is not empty. - The person in front of the queue uses the ATM and then leaves the queue. - After the first step, if the queue is empty, the process stops. Otherwise, for each person from left to right (e

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