LIS:wikipedia
There is one thing that I can\'t understand:
why is X[M[i]] a non-decreasing sequence?
You can surely check this video for explanation:
https://www.youtube.com/watch?v=nf3YG4CnTbg&feature=youtu.be
My code for nlogn approch is:
int n;
cin>>n;//LENGTH OF ARRAY
vectorv(n);
for(int i=0;i>v[i];
}
vectord(n+1,INT_MAX);//AUXILLARY ARRAY
for(int i=0;i<=n;i++){
*lower_bound(d.begin(),d.end(),v[i])=v[i];
}
for(int i=0;i