#K42852. Longest Continuous Increasing Subsequence
Longest Continuous Increasing Subsequence
Longest Continuous Increasing Subsequence
You are given an array of integers. Your task is to find the length of the Longest Continuous Increasing Subsequence (LCIS) within the array. A continuous increasing subsequence is defined as a contiguous subarray in which every element is strictly greater than its previous element.
For example, in the array [1, 3, 5, 4, 7]
the longest continuous increasing subsequence is [1, 3, 5]
with a length of 3
.
The problem can be formalized as: Given an array \(A = [a_1, a_2, \dots, a_n]\), find the maximum integer \(L\) such that there exists an index \(i\) where \(a_i < a_{i+1} < \dots .
inputFormat
The first line of input contains a single integer \(n\) representing the number of elements in the array. The second line contains \(n\) space-separated integers which are the elements of the array.
If \(n = 0\), then the array is empty.
outputFormat
Output a single integer representing the length of the longest continuous increasing subsequence in the given array.
## sample5
1 3 5 4 7
3