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 | 3773 |
3 | Radewoosh | 3646 |
4 | ecnerwala | 3624 |
5 | jqdai0815 | 3620 |
5 | Benq | 3620 |
7 | orzdevinwang | 3612 |
8 | Geothermal | 3569 |
8 | cnnfls_csy | 3569 |
10 | gyh20 | 3447 |
# | User | Contrib. |
---|---|---|
1 | awoo | 161 |
2 | maomao90 | 160 |
3 | nor | 157 |
4 | atcoder_official | 156 |
4 | cry | 156 |
6 | -is-this-fft- | 155 |
7 | maroonrk | 154 |
8 | adamant | 153 |
9 | Um_nik | 151 |
10 | djm03178 | 146 |
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!
Hmm sorry when my question is not clear. It mean you have n rectangles, you find the intersection areas of n rectangles.
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.