LIS (dynamic programming)

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