atcoder#ARC159D. [ARC159D] LIS 2
[ARC159D] LIS 2
Score : points
Problem Statement
We have a sequence , which is initially empty. Takahashi has performed the following operation for in this order.
- Append in this order to the end of .
Find the greatest length of a strictly increasing subsequence of the final .
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
4
1 1
2 4
10 11
7 10
8
The final is . The -st, -nd, -rd, -th, -th, -th, -th, and -th elements form a strictly increasing subsequence with the greatest length.
4
1 1
1 1
1 1
1 1
1
The final is .
1
1 1000000000
1000000000