QOJ.ac

QOJ

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

#22681. Osłona przed deszczem

Statistics

Farmę nawiedziły wyjątkowe deszcze. Pomysłowe krowy ustawiają $N$ prostokątnych parasoli ($1 \le N \le 25{,}000$), aby paść się bez moknięcia.

Pole to pas trawy; każdy parasol pokrywa cały przedział. Są ustawione chaotycznie i niektóre pokrywają całość lub część obszaru jednego lub więcej innych. Znajdź maksymalną liczbę innych parasoli całkowicie pokrywanych przez jeden.

Wejście

  • Wiersz $1$: całkowite $N$.

  • Wiersze $2..N+1$: całkowite $A$ i $B$ oddzielone spacją ($1 \le A < B \le 2{,}000{,}000{,}000$), końce pokrytego przedziału. Żadne dwa parasole nie dzielą końca.

Wyjście

  • Wiersz $1$: jedna liczba całkowita, maksimum parasoli całkowicie wewnątrz obszaru jednego innego parasola.

Przykład

Wejście 1

4
1 7
2 3
5 6
4 10

Wyjście 1

2

Uwagi

Wyjście

Pierwszy pokrywa drugi i trzeci, jak poniżej:

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

Źródło: 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.