시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
5 초 (추가 시간 없음) | 1024 MB | 130 | 21 | 21 | 20.588% |
Whenever students of KAIST go outside of campus, they usually follow a straight road named the Endless Road. The name comes from the fact that most students feel like the road is endless. One factor for this is due to the boring scenery of the road. Here, we model the Endless Road as a straight line of length $10^9$. The position over the straight line can be denoted as a single real number $x \in [0, 10^9)$.
To cope with this, the members of RUN@KAIST decided to plant different kinds of colorful flowers on this road. $N$ members of RUN@KAIST are numbered from $1 \ldots N$. In the last regular meeting, each member is assigned a nonempty segment over the straight line $[L_i, R_i)$, containing all positions $L_i \le x < R_i$.
The member with a higher index bears more responsibility for the tasks on the club. Thus, the length of the segment is nondecreasing as the indices of the members increases. In other words, $R_i - L_i \leq R_j - L_j$ for $1 \le i < j \le N$.
The planting is done in $N$ turns. In each turn, we select one previously unselected member to plant flowers. The selected member plants the flowers in their assigned segment $[L_i, R_i)$, except where other members have already planted flowers before.
To make the work distribution more equitable, the selection is done in the following way:
Jaeung should now announce the planting schedule. For this, he has to find an order in which the $N$ members will plant the flowers, according to the above selection rules.
The first line contains an integer $N$.
The next $N$ lines each contain two integers $L_i$ and $R_i$.
Output $N$ space-separated integers denoting the order of planting. The $i$-th integer denotes the index of member who will plant the flower in the $i$-th turn.
This subtask has an additional constraint.
This subtask has an additional constraint.
This subtask has an additional constraints.
This subtask has an additional constraints.
This subtask has no additional constraints.
6 1 2 2 3 3 4 4 5 1 3 3 5
1 2 5 3 4 6
4 3 7 10 14 1 6 6 11
1 3 2 4
University > KAIST > 2021 KAIST RUN Spring Contest G번
Camp > Petrozavodsk Programming Camp > Winter 2022 > Day 2: Grand Prix of Daejeon H번
Contest > Open Cup > 2021/2022 Season > Stage 11: Grand Prix of Daejeon H번