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

L. Visual Python++

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
Unrated 레이팅 미적용
난이도
5s
시간 제한
1024MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

In the recently proposed Visual Python++ programming language, a block of statements is represented as a rectangle of characters with t\(op-le\)ft corner in row \(r_{1}\) and column \(c_{1}\), and bott\(om-ri\)ght corner in row \(r_{2}\) and column \(c_{2}\). All characters at locations (r, c) with \(r_{1} \le r \le r_{2}\) and \(c_{1} \le c \le c_{2}\) are then considered to belong to that block. Among these locations, the ones with \(r = r_{1}\) or \(r = r_{2}\) or \(c = c_{1}\) or \(c = c_{2}\) are called a border. Statement blocks can be nested (rectangles contained in other rectangles) to an arbitrary level. In a synt\(ac- ti\)cally correct program, every two statement blocks are either nested (one contained in the other) or disjoint (not overlapping). In both cases, their borders may not overlap. Programmers are not expected to draw the many rectangles contained in a typical program – this takes too long, and Visual Python++ would not have a chance to become the next ICPC programming language. So a programmer only has to put one character ‘⌜’ in the t\(op-le\)ft corner of the rectangle and one character ‘^{⌟}’ in the bott\(om-ri\)ght corner. The parser will automatically match up the appropriate corners to obtain the nesting structure of the program. Your team has just been awarded a fi\(ve-ho\)ur contract to develop this part of the parser.

제약
입력 형식

The first line of the input contains an integer \(n\) (\(1 \le n \le 10^{5}\)), the number of corner pairs. Each of the next \(n\) lines contains two integers \(r\) and \(c\) (\(1 \le r\), \(c \le 10^{9}\)), specifying that there is a t\(op-le\)ft corner in row \(r\) and column \(c\) of the program you are parsing. Following that are \(n\) lines specifying the bott\(om-ri\)ght corners in the same way. All corner locations are distinct.

출력 형식

Display \(n\) lines, each containing one integer. A number \(j\) in line \(i\) means that the \(i^{th}\) t\(op-le\)ft corner and the \(j^{th}\) bott\(om-ri\)ght corner form one rectangle. T\(op-le\)ft and bott\(om-ri\)ght corners are each numbered from 1 to \(n\) in the order they appear in the input. The output must be a permutation of the numbers from 1 to \(n\) such that the matching results in properly nested rectangles. If there is more than one valid matching, any one will be accepted. If no such matching exists, display syntax error.

예제 1
입력
2
4 7
9 8
14 17
19 18
출력
2
1
예제 2
입력
2
4 7
14 17
9 8
19 18
출력
1
2
예제 3
입력
2
4 8
9 7
14 18
19 17
출력
syntax error
예제 4
입력
3
1 1
4 8
8 4
10 6
6 10
10 10
출력
syntax error
문제 정보

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

출처 ICPC World Finals 2017

평가 및 의견

L. Visual Python++

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

Log in to rate problems.

개별 의견

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

풀이 제출

L. Visual Python++

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