SEGMENTS - Segments
There are N horizontal line segments in the plane. The ith segment has some height hi (which may be negative) and runs from x = ai to x = bi (ai < bi). Segments do not contain their endpoints. You must draw a set of vertical lines (note lines and not line segments) so that every given horizontal segment is intersected at least once and at most R times by vertical lines in such a way that R is minimized.
The first line of the input is N (1 ≤ N ≤ 400), the number of horizontal line segments. N lines then follow, where the ith line is "ai bi hi". Each of ai,bi,hi are 32-bit signed integers. Horizontal segments may overlap.
Your output should consist of a single integer, the smallest value of R that is achievable, followed by a newline.
Input: 3 0 1 5 0 2 -2 1 2 7 Output: 2
Jelani Nelson (Minilek):
Yes, that's what it means.
It probably means that segment's 'y' coordinate is equal to 'h'Last edit: 2011-01-04 14:21:17
WHat does the height refers to ?