#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstring>
#include <string>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <map>
#include <functional>
#include <set>
using namespace std;
//1112
int k;
int d[26];
int ans[26];
int main(){
//freopen("input.txt","r",stdin);
while(cin>>k){
memset(ans,0,sizeof(ans));
for(int i=1;i<=k;i++)
cin>>d[i];
for(int i=1;i<=k;i++){
ans[i]=1;
for(int j=i-1;j>0;j--){
if(d[i]<=d[j])
ans[i]=max(ans[i],ans[j]+1);
}
}
int mx=-1;
for(int i=0;i<=k;i++)
if(ans[i]>mx)
mx=ans[i];
cout<<mx<<endl;
}
return 0;
}
/**************************************************************
Problem: 1112
User: cust123
Language: C++
Result: Accepted
Time:0 ms
Memory:1520 kb
****************************************************************/
题目1112:拦截导弹
最新推荐文章于 2023-10-10 10:17:00 发布