#K57997. Longest Increasing Contiguous Subsequence

    ID: 30544 Type: Default 1000ms 256MiB

Longest Increasing Contiguous Subsequence

Longest Increasing Contiguous Subsequence

Given an array of integers, your task is to determine the length of the longest contiguous subsequence where each element is strictly greater than its previous element. Note that the subsequence must be composed of consecutive elements from the original array.

If the array is empty, the answer is 0.

Example: For the array [1, 3, 2, 3, 4, 5], the longest increasing contiguous subsequence is [2, 3, 4, 5] with a length of 4.

The mathematical formulation: Find the maximum integer \( L \) such that there exists a contiguous block \( a_i, a_{i+1}, \dots, a_{i+L-1} \) of the array satisfying \( a_j < a_{j+1} \) for all \( i \le j < i+L-1 \).

inputFormat

The first line contains an integer \( n \) which is the number of elements in the array.

The second line contains \( n \) space-separated integers representing the elements of the array.

outputFormat

Output a single integer representing the length of the longest contiguous subsequence where the numbers are strictly increasing.

## sample
6
1 3 2 3 4 5
4