P26731 [AtCoder] Longest Ascending Contiguous Subsequence
提高-
题目描述

Problem Description

Given a sequence of positive integers $A=(A_1,\ A_2,\ \ldots,\ A_N)$ of length $ N $. Find the length of the longest contiguous subsequence of $ A $ that is in ascending order.

That is, for two integers $l,\ r$ ( $1\ \leqq\ l\ \leqq\ r\ \leqq\ N$ ) that satisfy $A_l\ \leqq\ A_{l+1}\ \leqq\ \cdots\ \leqq\ A_r$, find the maximum value of $ r-l+1 $.

Input Format

The input is given from the standard input in the following format:

$ N $ $ A_1 $ $ A_2 $ $\cdots$ $ A_N $

Output Format

Output the length of the longest contiguous subsequence of $ A $ that is in ascending order in one line.

Sample Input and Output

Sample Input #1

10
3 1 4 1 5 9 2 6 5 3

Sample Output #1

3

Sample Input #2

10
9 8 7 6 5 5 4 3 2 1

Sample Output #2

2

Sample Input #3

9
1 2 2 12 120 210 202 1010 2020

Sample Output #3

6

Notes/Hints

Constraints

  • $1\ \leqq\ N\ \leqq\ 100$.
  • $1\ \leqq\ A_i\ \leqq\ 2020$ ($1\ \leqq\ i\ \leqq\ N$).

Sample Explanation 1

The contiguous subsequence corresponding to the 4th to 6th terms of the sequence $ A $ is $1,\ 5,\ 9$, which is in ascending order. No longer ascending contiguous subsequence exists.

Sample Explanation 2

The contiguous subsequence corresponding to the 5th to 6th terms of the sequence $ A $ is $5,\ 5$, which is in ascending order. No longer ascending contiguous subsequence exists.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
10 3 1 4 1 5 9 2 6 5 3
样例输出
3