#C9399. Longest Increasing Subarray

    ID: 53487 Type: Default 1000ms 256MiB

Longest Increasing Subarray

Longest Increasing Subarray

You are given a sequence of n blocks, each with a certain height. Your task is to determine the length of the longest strictly increasing continuous subarray in the sequence.

Formally, given an integer \( n \) and an array \( heights = [h_1, h_2, \ldots, h_n] \), find the maximum integer \( L \) such that there exists an index \( i \) with \( 1 \leq i \leq n-L+1 \) where \( h_i < h_{i+1} < \ldots < h_{i+L-1} \). Even if all adjacent pairs are equal or decreasing, the answer is at least 1.

Example:

Input: 6
       5 1 3 2 4 6
Output: 3

inputFormat

The input is read from standard input and consists of two lines:

  1. The first line contains an integer \( n \), representing the number of blocks.
  2. The second line contains \( n \) space-separated integers, where the \( i\)-th integer represents \( h_i \), the height of the \( i\)-th block.

outputFormat

Output a single integer to the standard output: the length of the longest strictly increasing contiguous subarray.

## sample
6
5 1 3 2 4 6
3

</p>