#K34557. Longest Increasing Temperature Sequence

    ID: 25335 Type: Default 1000ms 256MiB

Longest Increasing Temperature Sequence

Longest Increasing Temperature Sequence

This problem requires you to determine the length of the longest consecutive period during which the temperature increases every day. Given a sequence of daily temperatures, a consecutive period is defined as a subarray where each element is strictly greater than its previous element, i.e., \(t_i < t_{i+1}\) for all consecutive days in that period.

Your task is to compute the maximum length of such an increasing sequence from the given list of daily temperatures.

inputFormat

The input is given via stdin and consists of two lines:

  • The first line contains a single integer \(n\) representing the number of days.
  • The second line contains \(n\) space-separated integers representing the daily temperatures.

outputFormat

The output, written to stdout, is a single integer representing the length of the longest consecutive period during which each day's temperature is strictly greater than the previous day's temperature.

## sample
10
1 2 3 2 3 4 1 2 3 4
4

</p>