Getting Runtime Error while code is Answering all Test CASE IN MINOPS

Here is solution can anyone tell whats wrong with approach i used dp to solve
Hwere is the solutionhttps://www.codechef.com/viewsolution/32078406