#C6827. Longest Increasing Contiguous Subarray

    ID: 50630 Type: Default 1000ms 256MiB

Longest Increasing Contiguous Subarray

Longest Increasing Contiguous Subarray

You are given a sequence of temperature readings. Your task is to find the length of the longest contiguous subarray in which the temperatures are strictly increasing.

Formally, let the temperature readings be \(a_1, a_2, \ldots, a_n\). You need to compute the maximum length \(\ell\) such that for some index \(i\), \[ a_i < a_{i+1} < \cdots < a_{i+\ell-1} \] with \(1 \leq i \leq n-\ell+1\). If the list is empty, the answer is 0.

Note: The subarray must be contiguous.

inputFormat

The input is given in two lines:

  • The first line contains a single integer \(n\) — the number of temperature readings.
  • The second line contains \(n\) space-separated integers representing the temperature readings.

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

outputFormat

Output a single integer — the length of the longest contiguous subarray that is strictly increasing.

## sample
9
30 32 31 33 35 37 36 38 40
4