Problem list
Log in
#r03121 · Online Judge > GoldOJ

Meeting Room Scheduling

Silver I 2.0 s 1024 MB

One meeting room is shared by many meetings, each with a start and end time; a meeting may start exactly when another ends. Choose the maximum number of non-overlapping meetings and print that count.

Input

Line 1: $N$. Next $N$ lines: start $S$ and end $E$ ($S < E$).

Output

Print the maximum number of meetings.

Example 1

Input
6
1 4
3 5
2 6
5 7
3 8
7 9
Output
3
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code