LIS:wikipedia
There is one thing that I can\'t understand:
why is X[M[i]] a non-decreasing sequence?
i came up with this
set my_set; set::iterator it; vector out; out.clear(); my_set.clear(); for(int i = 1; i <= n; i++) { my_set.insert(a[i]); it = my_set.find(a[i]); it++; if(it != my_set.end()) st.erase(it); else out.push_back(*it); } cout<< out.size();