1 #include2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 int d[100005],a[100005];12 int len,i,k,n,m;13 14 int binary(int t)15 {16 int low,high,mid;17 low=0;18 high=len;19 while(low >cas;34 while(cas--)35 {36 cin>>n;37 for(i=1;i<=n;i++)38 cin>>a[i];39 len=0;40 d[0]=-99999;41 for(i=1;i<=n;i++)42 {43 if(a[i]>d[len])44 {45 len++;46 d[len]=a[i];47 //cout< <<" ";48 }49 else50 {51 k=binary(a[i]);52 d[k]=a[i];53 }54 }55 cout< <