Link to question -- https://www.codechef.com/DEC16/problems/SEAINCR/
Could anybody give me a detailed explanation of how to solve this question from Codechef DEC16 long challenge.
Note : I know to find LIS in O(nlogn) but due to the number of queries my solution gets 30 points and gets a TLE in larger cases.