← All problemsSign in

Lazy Bob

CodeChefRating 3608Open on judge ↗

Alice decides to challenge Bob with a new game. She gives Bob an integer $M$ and two arrays $A$ and $B$ both of length $N$, such that $0 \leq A_i, B_i \lt M$ for each index $i$. Bob can perform two types operations on array $B$: 1. Choose an index $i$ $(1 \leq i \leq N$), and set $B_i\to (B_i + 1)\pmod M$. That is, increase $B_i$ by $1$, but wrap around to $0$ if the value reaches $M$. -

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