3009. Maximum Number of Intersections on the Chart
ArrayHash TableMathBinary Indexed TreeGeometrySweep LineSorting
Hints
Hint 1
We move a horizontal line from the bottom of the chart to the top.
Hint 2
For each point we reach, the number of intersections might change, so we have to count it.
Hint 3
If a point we just reached is lower than its previous/next point, the number of intersections increases.
Hint 4
If a point we just reached is higher than its previous/next point, the number of intersections decreases.
Hint 5
There is also another solution using Fenwick Tree.
Preparing judge…