#K36947. Longest Increasing Subscription Sequence
Longest Increasing Subscription Sequence
Longest Increasing Subscription Sequence
You are given the monthly subscription counts for a period of n months. Your task is to determine the maximum length of any consecutive sequence of months during which the subscription counts were strictly increasing.
Formally, given an array \( a_1, a_2, \ldots, a_n \), find the maximum length \( L \) such that there exists an index \( i \) with \( a_i < a_{i+1} < \cdots < a_{i+L-1} \). If no such increasing sequence exists, the answer is 1.
Input format: Provided as standard input.
Output format: Print a single integer representing the maximum length of the longest increasing consecutive subsequence.
inputFormat
The first line contains a single integer \( n \) (\( 1 \le n \le 10^5 \)) — the number of months. The second line contains \( n \) space-separated integers \( a_1, a_2, \ldots, a_n \) where \( a_i \) represents the subscription count in the \( i\)-th month.
outputFormat
Output a single integer representing the maximum length of a consecutive period where the subscriptions are strictly increasing.
## sample6
2 3 5 3 4 5
3