设为首页 加入收藏

TOP

POJ 1887 Testing the CATCHER.
2015-07-20 18:00:17 来源: 作者: 【 】 浏览:2
Tags:POJ 1887 Testing the CATCHER.

~~~~

求最长不上升子序列,把数组倒过来不就是求最长上升子序列了么,QAQ..

?

~~~~

?

#include
  
   
#include
   
     #include
    
      #include
     
       #define N 10000 using namespace std; int f[N],a[N]; int main() { int t,c,T=0; while(~scanf(%d,&t),t!=-1) { c=0; a[c++]=t; while(~scanf(%d,&t),t!=-1) a[c++]=t; int i,j; for(i=0,j=c-1;i
      
       f[cnt]) f[++cnt]=a[k]; else { int pos=lower_bound(f+1,f+cnt,a[k])-f; f[pos]=a[k]; } } } printf(Test #%d: ,++T); printf( maximum possible interceptions: %d ,cnt); } return 0; } 
      
     
    
   
  


?

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇HDU 4910 Problem about GCD(米勒.. 下一篇HDU 2842 Chinese Rings (带常数..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: