Modular Array
CodeChefOpen on judge ↗
Vilas is currently doing the Travas $N$ day challenge, where on the $i^{th}$ day he is supposed to run $x$ metres, where $x$ is an integer and $0 \leq x \leq (i - 1)$, that is he can run anywhere from $0$ metres to $i - 1$ metres on the $i^{th}$ day. Since Vilas is superhuman (and also immortal) he manages to complete the challenge. However he realises that he had forgotten to record on certain da
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