标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 24450 Accepted Submission(s):
9569
#include<stdio.h> #include<string.h> int main() { int n,m,j,i,sum,k; int dp[11000]; int a[11000]; while(scanf("%d",&n)!=EOF) { for(i=0;i<n;i++) { scanf("%d",&a[i]); dp[i]=1; } k=1;dp[0]=a[0]; for(i=1;i<n;i++) { m=1; for(j=0;j<k;j++) { if(dp[j]>=a[i]) { dp[j]=a[i]; m=0; break; } } if(m) dp[k++]=a[i]; } printf("%d\n",k); } return 0; }
标签:
原文地址:http://www.cnblogs.com/tonghao/p/4525691.html