#C6151. Maximum Consecutive Increasing Skyscrapers
Maximum Consecutive Increasing Skyscrapers
Maximum Consecutive Increasing Skyscrapers
You are given a sequence of skyscraper heights arranged in a line. Your task is to compute the maximum number of consecutive skyscrapers that form a strictly increasing sequence. In other words, if the heights are represented as \(a_1, a_2, \ldots, a_n\), you need to find the maximum length \(L\) such that there exists an index \(i\) satisfying \(a_i < a_{i+1} < \cdots < a_{i+L-1}\). The problem can be mathematically represented as:
[ L = \max_{1 \leq i \leq n} { \text{length of consecutive increasing subsequence starting at } i } ]
It is guaranteed that \(n \geq 1\) and the sequence contains at least one skyscraper.
inputFormat
The input is read from standard input (stdin). The first line contains an integer (n) representing the number of skyscrapers. The second line contains (n) space-separated integers representing the heights of the skyscrapers.
outputFormat
Output to standard output (stdout) a single integer: the maximum number of consecutive skyscrapers with strictly increasing heights.## sample
6
1 2 1 2 3 4
4