CSES Problemset/Sorting and Searching
Movie Festival
#1629Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude DesktopIn a movie festival movies will be shown. You know the starting and ending time of each movie. What is the maximum number of movies you can watch entirely?
Input
The first input line has an integer : the number of movies.
After this, there are lines that describe the movies. Each line has two integers and : the starting and ending times of a movie.
Output
Print one integer: the maximum number of movies.
Constraints
Sample Test Cases (1)
Example 1ID: sample-1
Input
3 3 5 4 9 5 8
Expected Output
2
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|1 line, 0 charsTest Bench
Input (stdin)
3 3 5 4 9 5 8
Expected Output
2