QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#21269. 과도한 잔디 심기

Statistics

Farmer John은 수평과 수직 변인 축 정렬 직사각형에 잔디를 심는 기계를 샀습니다. 어느 날 고장 나 하나가 아닌 $N$개 영역($1 \le N \le 1000$)에 심었으며 겹칠 수 있습니다.

영역들로부터 잔디로 덮인 총면적을 구하세요.

입력

  • 1번째 줄: 정수 $N$.
  • 2..1+$N$번째 줄: 공백 구분 네 정수 $x1$, $y1$, $x2$, $y2$로 왼쪽 위 $(x1,y1)$와 오른쪽 아래 $(x2,y2)$인 직사각형을 나타냅니다. 좌표는 $-10^8...10^8$입니다.

출력

  • 1번째 줄: 총 덮인 면적, 32비트 정수보다 클 수 있습니다.

예제

입력 1

2
0 5 4 1
2 4 6 2

출력 1

20

문제 작성자: Brian Dean, 2012

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.