Sweep line with isosceles right triangle

Revision en1, by Loserinlife, 2023-11-07 12:37:10

Given an isosceles right triangle with vertices (0, 0) (0, d) (d, 0). And N rectangles (x1, y1, x2, y2).

Count number of points (x, y) that is both inside the triangle and at least 1 of the rectangles.

N <= 2e5

d, x1, x2, y1, y2 <= 1e9

x1 <= x2, y1 <= y2



  Rev. Lang. By When Δ Comment
en1 English Loserinlife 2023-11-07 12:37:10 317 Initial revision (published)