Hello everyone. Today i meet a problem like find the intersection areas of n rectangles. i use IT tree but i can't not solve with case have a area that more than 3 rectangles intersection. Very thanks you help me to solve this proplem.
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | -is-this-fft- | 158 |
5 | adamant | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
Hello everyone. Today i meet a problem like find the intersection areas of n rectangles. i use IT tree but i can't not solve with case have a area that more than 3 rectangles intersection. Very thanks you help me to solve this proplem.
Name |
---|
Intersection of two rectangles is a rectangle. I don't think any further explanation is really necessary. A bit of casework and the problem is done.
Good luck!
By mentioning IT tree, which I suppose is segment tree, I think you realized this problem can be solved with sweep line and range queries. A classic problem would be to find union of $$$n$$$ rectangles instead of intersection. If you know how to solve for union, I think you can also solve for intersection.