QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22681. 비 가리개

Statistics

농장에 최근 유난히 많은 비가 왔습니다. 영리한 소들은 비를 맞지 않고 풀을 먹으려고 직사각형 우산 $N$개($1 \le N \le 25{,}000$)를 설치했습니다.

목초지는 한 줄의 풀밭이고 각 우산은 어떤 구간을 완전히 덮습니다. 마구 설치해서 다른 하나 이상 우산의 영역 일부 또는 전부를 덮기도 합니다. 한 우산이 완전히 덮는 다른 우산 수의 최댓값을 구하세요.

입력

  • $1$번 줄: 정수 $N$.

  • $2..N+1$번 줄: 공백 구분 정수 $A$, $B$($1 \le A < B \le 2{,}000{,}000{,}000$), 덮인 구간의 양끝입니다. 어떤 두 우산도 끝점을 공유하지 않습니다.

출력

  • $1$번 줄: 다른 한 우산의 영역에 완전히 포함되는 우산 수의 최댓값 정수 하나.

예제

입력 1

4
1 7
2 3
5 6
4 10

출력 1

2

참고

출력

첫 우산은 둘째와 셋째를 덮습니다:

      *-----------*
      |           |
*-----------*
|           |
| *-*   *-* |
| | |   | | |
1 2 3 4 5 6 7 8 9 10

문제 제공: Alex Schwendner, 2003.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.