Longest increasing subsequence

Please checkout this question

http://codeforces.com/contest/76/problem/F