Fast longest increasing subsequence