#K77517. Longest Increasing Driving Path

    ID: 34882 Type: Default 1000ms 256MiB

Longest Increasing Driving Path

Longest Increasing Driving Path

You are given a sequence of n stage hardness values that represent the difficulty of driving through consecutive stages. A car can only proceed from one stage to the next if the hardness value strictly increases. Your task is to determine the length of the longest contiguous segment (subarray) of stages where the difficulty increases at each step.

Formally, given an integer \( n \) and an array \( hardnesses[0 \ldots n-1] \), find the maximum positive integer \( L \) such that there exists an index \( i \) with \( 0 \leq i \leq n - L \) satisfying \[ hardnesses[i] < hardnesses[i+1] < \cdots < hardnesses[i+L-1]\] If no two consecutive stages have increasing difficulty, the answer is 1 since any single stage is a valid path.

inputFormat

The input is read from standard input and consists of two lines. The first line contains a single integer \( n \) (the number of stages). The second line contains \( n \) space-separated integers representing the hardness values of each stage.

outputFormat

Output a single integer which is the length of the longest contiguous increasing path.

## sample
1
5
1

</p>