~~~~
求最长不上升子序列,把数组倒过来不就是求最长上升子序列了么,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; }
?