#K9906. Longest Continuous Increasing Subsequence
Longest Continuous Increasing Subsequence
Longest Continuous Increasing Subsequence
Given a sequence of integers, find the length of its longest strictly continuously increasing subsequence. A contiguous subsequence is defined as a sequence that appears in the same order as the original list without any gaps. The subsequence must be strictly increasing, meaning each subsequent element is greater than the previous one.
For example, in the sequence [1, 2, 3, 2, 3, 4, 5, 1], the longest strictly continuously increasing subsequence is [2, 3, 4, 5] with a length of 4. Note that if the sequence is empty, the answer should be 0.
inputFormat
The input is provided via standard input (stdin) in the following format:
n x1 x2 x3 ... xn
Where n
is a non-negative integer representing the number of elements in the sequence. If n
is 0, then no elements will follow, and the sequence is considered empty.
outputFormat
Output a single integer via standard output (stdout) representing the length of the longest strictly continuously increasing subsequence.
## sample8
1 2 3 2 3 4 5 1
4