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

Graškrižja

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

의견: 0

설명

\(6^{th}\) round, March \(8^{th}\), 2014

Peatown has become a metropolis. We can observe it as a rectangular grid of streets. There are fifty
thousand vertical streets running nor\(th-so\)uth (labeled with \(x-co\)ordinates from 1 to 50 000) and fify
thousand horizontal streets running ea\(st-we\)st (labeled with \(y-co\)ordinates from 1 to 50 000). All streets
are t\(wo-wa\)y streets. An intersection of a horizontal and vertical street is called a crossroads.
Residents of Peatown are very irresponsible and reckless. They drive like idiots so the mayor of
Peatown has decided to place traffic lights on N crossroads. A path between two crossroads is
dangerous if there is a turn without a traffic light. Otherwise it is harmless.
It is not possible to ensure that all paths are harmless, but the mayor of Peatown is satisfied if between
each two traffic lights at least one of the shortest paths is harmless. Unfortunately, the current
distribution of traffic lights is too dangerous. Your task is to place additional traffic lights (less than
700 000 of them) so that the set of traffic lights (which contains both new and old traffic lights) meets
the mayor's requirement. Surely you're not p\(ea-br\)ained so help the residents of Peatown!

제약
입력 형식

The first line of input consists of an integer N (\(2 \le N \le 50\,000\)), the number of initially placed traffic
lights.
Each of the following N lines contains a location of one traffic light, represented with integers X and Y
(\(1 \le X\), \(Y \le 50\,000\)), coordinates of the vertical and horizontal streets which intersect in that
crossroads. All traffic lights will be unique.

출력 형식

Output the locations of new traffic lights, each in its own line.
Placing multiple traffic lights on the same location is allowed.
The number of new traffic lights must be smaller than 700 000.

예제 1
입력
2
1 1
3 3
출력
1 3
예제 2
입력
3
2 5
5 2
3 3
출력
3 5
5 3
예제 3
입력
5
1 3
2 5
3 4
4 1
5 2
출력
1 5
3 3
3 5
4 2
4 3
문제 정보

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

출처 COCI 2013/2014 Contest 6

평가 및 의견

Graškrižja

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

Log in to rate problems.

개별 의견

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

풀이 제출

Graškrižja

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