标签:des blog http io ar os sp java for
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 19842 Accepted Submission(s): 7862
#include<iostream> #include<cstdio> #include<cstring> #include<string> #include<cmath> #include<cstdlib> #include<algorithm> #include<queue> #include<vector> #include<set> using namespace std; int n,a[100010],dp[100010],ans; int main() { while(scanf("%d",&n)!=EOF) { ans=1; for(int i=1;i<=n;i++) scanf("%d",&a[i]); for(int i=1;i<=n;i++) dp[i]=1; for(int i=2;i<=n;i++) for(int j=1;j<i;j++) if(a[j]<a[i]&&dp[j]>=dp[i]) dp[i]=dp[j]+1; for(int i=1;i<=n;i++) if(ans<dp[i]) ans=dp[i]; printf("%d\n",ans); } return 0; }
标签:des blog http io ar os sp java for
原文地址:http://www.cnblogs.com/a972290869/p/4099609.html