#CCBCHMOT0000031. Dãy tăng liên tiếp trong luồng (Longest Strictly Increasing Run)
Dãy tăng liên tiếp trong luồng (Longest Strictly Increasing Run)
Longest Strictly Increasing Run
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given n integers in their original order, find the maximum length of a contiguous strictly increasing run. Adjacent elements in a run must satisfy next > previous. A single element has length one; do not reorder the data.
Input
The first integer is n, followed by exactly n integers separated by whitespace.
Output
Print the maximum length of a contiguous strictly increasing run.
Subtasks
- Subtask 1 (20%): , .
- Subtask 2 (30%): , .
- Subtask 3 (50%): , .
Examples
Example 1
Input
7
1 3 2 4 5 0 1
Output
3
Explanation
The increasing runs have lengths 2, 3, and 2, so the maximum is 3.
Example 2
Input
4
2 2 2 2
Output
1
Explanation
Equal adjacent values do not satisfy strict increase; each run has length one.