← All problemsSign in

Fun With Cameras

On a straight road of length 105, n CCTV cameras are placed on different positions pi. The road starts at pi=0 and is of length 105. At time=0, the cameras are switched ON and are facing right. The range of view of each camera ri is also given i.e if camera is facing right, then pi to pi+ri (both inclusive) and if camera is facing left, then pi-ri to pi (both inclusive) is in the viewing range of

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