So I framed a DP described by the following code: Link The subproblem I framed was that dp[i] is the most profit that one can get if he plays ith match. If we play ith match, then we can either
When we have filled the whole dp array we select the maximum element in the array. Three subtasks give AC for this but the rest 7 fail. What is wrong with the logic? Also on an unrelated note, what is the cutoff for ZCO usually? Whole 2 problems? How hard is it to get into IOITC? asked 25 Oct '16, 00:01

I looked up agnishom's answer and saw the solution, but I'm still not sure what is wrong with my solution that his solution covers.