#B. 【模板】扫描线 & 矩形面积并

    Type: RemoteJudge 1000ms 512MiB

【模板】扫描线 & 矩形面积并

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

nn 个四边平行于坐标轴的矩形的面积并。

输入格式

第一行一个正整数 nn

接下来 nn 行每行四个非负整数 x1,y1,x2,y2x_1, y_1, x_2, y_2,表示一个矩形的四个端点坐标为 (x1,y1),(x1,y2),(x2,y2),(x2,y1)(x_1, y_1),(x_1, y_2),(x_2, y_2),(x_2, y_1)

输出格式

一行一个正整数,表示 nn 个矩形的并集覆盖的总面积。

2
100 100 200 200
150 150 250 255

18000

提示

对于 20%20\% 的数据,1n10001 \le n \le 1000
对于 100%100\% 的数据,1n1051 \le n \le {10}^50x1<x21090 \le x_1 < x_2 \le {10}^90y1<y21090 \le y_1 < y_2 \le {10}^9

Updated on 4.10 by Dengduck(口胡) & yummy(实现):增加了一组数据。

ch12 - 扫描线

Not Claimed
Status
Done
Problem
4
Open Since
2024-1-21 0:00
Deadline
2024-3-3 23:59
Extension
2400 hour(s)