Author: | Far-Eastern Subregional | Time limit: | 1 sec | |
Input file: | input.txt | Memory limit: | 8 Mb | |
Output file: | output.txt |
A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric sequence (a1, a2, ., aN) be any sequence (ai1, ai2, ., aiK), where 1 ≤ i1 < i2 < ... < iK ≤ N. For example, the sequence (1, 7, 3, 5, 9, 4, 8) has ordered subsequences, e. g., (1, 7), (3, 4, 8) and many others. All longest ordered subsequences of this sequence are of length 4, e. g., (1, 3, 5, 8).
Your program, when given the numeric sequence, must find the length of its longest ordered subsequence.
No. | Input file (input.txt ) |
Output file (output.txt ) |
---|---|---|
1 |
|
|