#C14623. Longest Contiguous Increasing Subsequence

    ID: 44293 Type: Default 1000ms 256MiB

Longest Contiguous Increasing Subsequence

Longest Contiguous Increasing Subsequence

Given a sequence of integers, your task is to determine the length of the longest contiguous subsequence in which each element is strictly greater than its previous element.

More formally, given an array \(A\) of length \(n\), find the maximum integer \(k\) such that there exists an index \(i\) (0-indexed) with \(0 \leq i \leq n-k\) and

[ A_{i} < A_{i+1} < \cdots < A_{i+k-1} ]

Note that if the array is empty, the answer is defined as 0.

Constraints:

  • \(0 \leq n \leq 10^5\)
  • \(-10^9 \leq A_i \leq 10^9\)

inputFormat

The input is given via standard input in the following format:

  1. The first line contains an integer \(n\), representing the number of elements in the sequence.
  2. The second line contains \(n\) space-separated integers representing the elements of the sequence.

If \(n = 0\), the second line will be absent.

outputFormat

Output a single integer — the length of the longest contiguous strictly increasing subsequence. The output should be printed to standard output.

## sample
6
1 2 2 3 4 1
3

</p>