Longest increasing subsequence

Please checkout this question

codeforces.com/contest/76/problem/F