So I framed a DP described by the following code: Link
The subproblem I framed was that dp* is the most profit that one can get if he plays i-th match. If we play i-th match, then we can either
- Play (i-1)th match and not play the one before that, then use the best answer we have for dp[i-3] OR
- Don’t play (i-1)th match and instead choose whatever was best (i-2) matches i.e dp[i-2]
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?