Dynamic Programming: Bottom-Up (Tabulation, Knapsack)
You are given an array of n integers. A subsequence keeps the original order but may skip elements. Find the length of the longest subsequence whose values are strictly increasing.
The first line has n. The second line has n integers.
Print one integer: the length of the longest strictly increasing subsequence.
1 <= n <= 100000 |a_i| <= 10^9
1000 ms256 MB
8 10 9 2 5 3 7 101 18
4
For example 2, 3, 7, 101.
5 5 4 3 2 1
1
No two elements are in increasing order, so the best is a single element.