-->
当前位置:首页 > 题库

PROGRAMMING:Longest ascending subsequence

Luz5年前 (2021-05-10)题库455
To give you an array of length N, you need to find the longest ascending subsequence in the array, and then output its length.
The definition of subsequence is to take any number from the array, and their relative position remains unchanged.
The meaning of ascending is that the last one of each number in the array must be larger than the previous one.
###Input format:
Give an N, and then give n numbers( The length of the array should not exceed 1000, and the range of int should not be exceeded.)
###Output format:
Output a number representing the length of the longest ascending subsequence.
###Input example:
Here is a set of inputs. For example:
```in
five
1 2 2 3 3
```
###Output example:
The corresponding output is given here. For example:
```out
three
```
### TIPS
You can take 1, 2, 3, which is the ascending subsequence, and the length is the longest< br>





answer:If there is no answer, please comment