Streetlights and Intervals
CodeChefOpen on judge ↗
There are $N$ streetlights at points $x_1$, $x_2$, . . ., $x_n$ on a road. Chef wants to create unit length intervals to determine the cost of marking the road between two streetlights. Determine the size of the smallest set of unit-length closed intervals that contain all the given streetlights. ###Input: - The first line of the input contains a single integer $T$ denoting the number of t
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