How to solve this problem from nstu ice fest?

https://toph.co/arena?contest=mirror-nstu-ice-fest-regional-2020#!/p/sgt-laugh

dp[i][j] = maximum first element of any increasing subsequence of the first i elements with size j. You can maintain the dp efficiently with a binary indexed tree / segment tree.

4 Likes