RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
R03672

Picture

Unrated 레이팅 미적용
난이도
2s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Setubal 1998
Picture
A number of rectangular posters, photographs
and other pictures of the same shape are pasted
on a wall. Their sides are all vertical or
horizontal. Each rectangle can be partially or
totally covered by the others. The length of the
boundary of the union of all rectangles is called
the perimeter.
Task
Write a program to calculate the perimeter.
An example with 7 rectangles is shown in
Figure 1.
Figure 1. A set of 7 rectangles
The corresponding boundary is the whole set of
line segments drawn in Figure 2.
Figure 2. The boundary of the set of rectangles
The vertices of all rectangles have integer
coordinates.
Input Data
The first line of the file PICTURE.IN contains
the number of rectangles pasted on the wall.
In each of the subsequent lines, one can find the
integer coordinates of the lower left vertex and
the upper right vertex of each rectangle. The
values of those coordinates are given as ordered
pairs consisting of an x-coordinate followed by
a y-coordinate.

Sample Input

7
-15 0 5 10
-5 8 20 25
15 -4 24 14
0 -6 16 4
2 15 10 22
30 10 36 20
34 0 40 16
This corresponds to the example of Figure 1.
Output Data
The file PICTURE.OUT must contain a single
line with a non-negative integer which
corresponds to the perimeter for the input
rectangles.
Sample Output:
228
This is the contents of the output file for the
example above.

제약

0 ≤ number of rectangles < 5000
All coordinates are in the range [-10000,10000]
and any existing rectangle has a positive area.
The numeric value of the result may need a
32-bit signed representation.

입력 형식
출력 형식
문제 정보

생성자가 기록되지 않았습니다.

출처 IOI 1998

평가 및 의견

Picture

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Picture

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8