#C7070. Longest Contiguous Increasing Subsequence
Longest Contiguous Increasing Subsequence
Longest Contiguous Increasing Subsequence
Given an array of integers, your task is to find the length of the longest contiguous subsequence in which each element is strictly greater than its previous element.
For example, consider the array [5, 1, 2, 3, 2, 4, 5, 6]. The longest strictly increasing contiguous subsequence is either [1, 2, 3] or [2, 4, 5, 6], so the answer is 4.
If the array is empty, the answer is 0.
inputFormat
The input is given via standard input (stdin).
The first line contains an integer n representing the number of elements in the array. If n > 0, the second line contains n space-separated integers representing the array. If n = 0, the array is empty.
outputFormat
Output a single integer to standard output (stdout) which is the length of the longest contiguous subsequence where each element is strictly greater than its previous element.## sample
8
5 1 2 3 2 4 5 6
4