#K50787. Longest Consecutive Increasing Subsequence

    ID: 28942 Type: Default 1000ms 256MiB

Longest Consecutive Increasing Subsequence

Longest Consecutive Increasing Subsequence

You are given a sequence of integers. Your task is to find the length of the longest contiguous subsequence (subarray) where each element is strictly greater than the previous one.

If the sequence is empty, then the answer is 0. For example, given the sequence [1, 2, 3, 2, 3, 4], the longest consecutive increasing subsequence is [1, 2, 3] with a length of 3.

The increasing condition is defined as follows: for any two consecutive elements a and b in the subsequence, it must hold that \(b > a\). This is a typical problem that can be solved by scanning the list and counting the length of current increasing segments.

Input/Output

Please read the input from standard input (stdin) and write your answer to standard output (stdout).

inputFormat

The first line of input contains an integer \(N\) representing the number of elements in the sequence. The second line contains \(N\) space-separated integers.

If \(N = 0\), then the sequence is empty.

outputFormat

Output a single integer, the length of the longest consecutive increasing subsequence.

## sample
6
1 2 3 2 3 4
3