nlogn LIS CF1437E

 1 vector<int> v;
 2 v.clear();
 3 vector<int>::iterator it;
 4 for(int j = l + 1 ; j < r ; j++){
 5     if(a[j] >= a[l] && a[j] <= a[r]){
 6         it = upper_bound(v.begin(), v.end(), a[j]);
 7         if(it == v.end()){
 8             v.push_back(a[j]);
 9         }else{
10             *it = a[j];
11         }
12     }
13 }
原文地址:https://www.cnblogs.com/ecustlegendn324/p/13928944.html