#C8888. Longest Increasing Subarray
Longest Increasing Subarray
Longest Increasing Subarray
Paul is training for a marathon and records the distance he runs each day. He is interested in finding out the length of the longest consecutive period (subarray) during which his daily running distances are strictly increasing.
Formally, given a sequence of distances \(d_1, d_2, \ldots, d_n\), you need to find the maximum length \(L\) such that there exists an index \(i\) (1 \(\leq i \leq n-L+1\)) with \(d_i < d_{i+1} < \cdots < d_{i+L-1}\). If there is no increasing pair, the answer is 1.
Your solution must read input from stdin and write the output to stdout.
inputFormat
The input consists of two lines:
- The first line contains a positive integer n (\(1 \leq n \leq 10^5\)) denoting the number of days in Paul’s log.
- The second line contains n space-separated integers representing the running distances for each day.
outputFormat
Output a single integer: the length of the longest strictly increasing consecutive subarray.
## sample5
1 2 3 2 3
3