1576 最長嚴格上公升子串行

2021-09-07 10:44:37 字數 847 閱讀 3611

時間限制: 1 s

空間限制: 256000 kb

題目等級 : ** gold

description

給乙個陣列a1, a2 ... an,找到最長的上公升降子串行ab1

b2< .. bk,其中b1輸出長度即可。

輸入描述

input description

第一行,乙個整數n。

第二行 ,n個整數(n < = 5000)

輸出描述

output description

輸出k的極大值,即最長不下降子串行的長度

樣例輸入

sample input

9 3 6 2 7

樣例輸出

sample output

資料範圍及提示

data size & hint

【樣例解釋】

最長不下降子串行為3,6,7

分類標籤 tags 點此展開

#include#include

#include

using

namespace

std;

const

int maxn=10001

;int a[maxn][4

];int

main()

for(int i=n-1;i>=1;i--)

}if(l!=0

)

}int ans=0

;

for(int i=1;i<=n;i++)

printf("%d

",ans);

return0;

}

1576 最長嚴格上公升子串行

給乙個陣列a1,a2 an,找到最長的上公升降子串行ab1 第一行,乙個整數n。第二行 n個整數 n 5000 輸出k的極大值,即最長不下降子串行的長度 9 3 6 2 7 按自己的思路隨便寫了乙個 include using namespace std int main for int i 0 i...

1576 最長嚴格上公升子串行

題目描述 description 給乙個陣列a1,a2 an,找到最長的上公升降子串行ab1輸出長度即可。輸入描述 input description 第一行,乙個整數n。第二行 n個整數 n 5000 輸出描述 output description 輸出k的極大值,即最長不下降子串行的長度 樣例輸...

1576 最長嚴格上公升子串行

時間限制 1 s 空間限制 256000 kb 題目等級 gold 給乙個陣列a1,a2 an,找到最長的上公升降子串行ab1 b2 bk,其中b1輸出長度即可。輸入描述 input description 第一行,乙個整數n。第二行 n個整數 n 5000 輸出描述 output descript...