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

Unija

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

의견: 0

설명

1 \(s / 64\) \(MB / 100\) points

You are given \(N\) rectangles, which are centered in the center of the Cartesian coordinate

system and their sides are parallel to the coordinate axes. Each rectangle is uniquely

identified with its width (along the \(x-ax\)is) and height (along the \(y-ax\)is). The lower image

depicts the first sample test.

Mirko has coloured each rectangle in a certain color and now wants to know the area of the

coloured part of the paper. In other words, he wants to know the number of unit squares that

belong to at least one rectangle.

제약

In test cases worth 40% of total points, all numbers from the input will be smaller than 3333.
In test cases worth 50% of total points, not a single rectangle will be located strictly within
another rectangle.

입력 형식

The first line of input contains the integer \(N\)

(1 ≤ \(N\)

≤ 1 000 000), the number of rectangles.
Each of the following \(N\) lines contains even integers \(X\) and \(Y\) (2 ≤ X, \(Y \le 10\) {7}{ }), dimensions

(width and height, respectively) of the corresponding rectangles.

출력 형식

The first and only line of output must contain the required area.

예제 1
입력
1 s / 64 MB / 100 points

3
8 2
4 4
2 6

5
2 10
4 4
2 2
8 8
6 6
출력
output
28

68





Task Ronald
1 s / 64 MB / 120 points

There are ​N
​
 cities in one country that are connected with two-way air links. One crazy airline
president, Ronald Krump, often changes the flight schedule. More precisely, every day he
does the following:

●
chooses one of the cities,
●
introduces flights from that city towards all other cities where these flights do not
currently exist, and at the same time cancels all existing flights from that city

For instance, if from city 5 flights exist towards cities 1 and 2, but not towards cities 3 and 4,
after Krump’s change, there will exist flights from city 5 towards cities 3 and 4, but not
towards cities 1 and 2.

The citizens of this country are wondering if a day could come when the flight schedule will
be complete. In other words, when between each two different cities a (direct) flight will exist.
Write a programme that will, based on the current flight schedule, determine whether it is
possible to have a ​Complete Day
​
, or whether this will never happen, no matter what moves
Krump makes.
예제 2
입력
The first line of input contains the integer ​N
​
 (2 ≤ ​N
​
≤ 1000), the number of cities. The cities
are labeled with numbers from 1 to ​N
​
.
The second line contains the integer ​M
​
 (0 ≤ ​M
​
< ​N*(N-1)/2
​
), the number of current flights.
Each of the following ​M
​
 lines contains two different numbers, the labels of the cities that are
currently connected.
출력
The first and only line of output must contain DA (Croatian for “yes”) or NE (Croatian for
“no”).

SAMPLE TESTS
예제 3
입력
2
0

3
2
1 2
2 3

4
2
1 3
2 4
출력
output
output
DA

NE

DA





Task Ronald
1 s / 64 MB / 120 points
설명

Clarification of the first test case: In the first step, Krump will introduce the (only possible) line 1-2.
Clarification of the third case: If Krump first chooses city 1, flights 1-2, 1-4 and 2-4 will exist. If he
then chooses city 3, the flight schedule will become complete.

문제 정보

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

출처 COCI 2016/2017 Contest 5

평가 및 의견

Unija

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

Log in to rate problems.

개별 의견

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

풀이 제출

Unija

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