In The Green Zone
There are $N$ cans lying on the X-axis at points $X_i$ $(1 \le i \le N)$. Each of the N cans is associated with two values $A_i$ and $B_i$. Also, the segment between the points $L$ and $R$ $(L \leq R)$ is considered to be green zone including the points $L$ and $R$. There are two types of operations - $1.$ Select a can $i$ out of the $N$ cans and move it one unit in either direction along the
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