Hi Guys, Can anyone help me solve this problem?
https://acm.timus.ru/problem.aspx?space=1&num=2019&locale=en
I tried to solve it greedily. Also i tried to solve it using dynamic programming. I had dp[l][r] true if exists k such dp[l][k] is true and dp[k + 1][r] is true, but that works for O(n^3)