#K37387. Longest Increasing Consecutive Subsequence
Longest Increasing Consecutive Subsequence
Longest Increasing Consecutive Subsequence
You are given an array of integers. Your task is to find the length of the longest contiguous subsequence of strictly increasing numbers.
In other words, let \(a_1, a_2, \dots, a_n\) be the input array, you need to compute the maximum length \(L\) such that there exists an index \(i\) for which \(a_i < a_{i+1} < \cdots < a_{i+L-1}\). Note that the subsequence must be contiguous.
If the array is empty, the answer is 0.
inputFormat
The input is provided via standard input (stdin) and consists of two parts:
- An integer \(n\) representing the number of elements in the array.
- \(n\) space-separated integers representing the array elements.
If \(n = 0\), the array is empty.
outputFormat
Output a single integer via standard output (stdout): the length of the longest contiguous subsequence where each number is strictly greater than the previous one.
## sample5
1 3 5 4 7
3
</p>