Traffic Police
CodeChefOpen on judge ↗
City has m residents. Each resident ei travels from time li to ri (in seconds). Every car has a starting velocity of si m/s (assume that it goes from 0 to si in no time), and an acceleration of ai m/s2. That means residents ei travels with speed si at time li, with speed si + ai at time li + 1, s + 2*ai at time li + 2 and so on until time ri. Then at time ri + 1 he stops suddenly. Now, the traff
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