hdu 1950 最长上升子序列

 //Accepted    3540 KB    62 ms
 //dp 最长上升子序列
 #include <cstdio>
 #include <cstring>
 #include <iostream>
 using namespace std;
 ;
 int dp[imax_n];
 int d[imax_n];
 int a[imax_n];
 int n;
 int len;
 int max(int a,int b)
 {
     return a>b?a:b;
 }
 int binary_search(int k)
 {
     ;
     int r=len;
     while (l<=r)
     {
         ;
         if (d[mid]==k) return mid;
         ;
         ;
     }
     return l;
 }
 void Dp()
 {
     memset(dp,,sizeof(dp));
     memset(d,,sizeof(d));
     len=-;
     ;i<n;i++)
     {
         int j=binary_search(a[i]);
         if (j>len) len++;
         dp[i]=j+;
         d[j]=a[i];
     }
     ;
     ;i<n;i++)
     ans=max(ans,dp[i]);
     printf("%d\n",ans);
 }
 int main()
 {
     int T;
     scanf("%d",&T);
     while (T--)
     {
         scanf("%d",&n);
         ;i<n;i++)
         scanf("%d",&a[i]);
         Dp();
     }
     ;
 }
上一篇:java compiler level does not match the version of the installed java project facet


下一篇:eclipse中切换jre后报错:Java compiler level does not match the version of the installed Java project facet.