Dp problem

2915 -- Zuma so, this is a poj problem that has a DP solution. if anybody could give any hints, would be much appreciated

I am looking for an explanation too,
Found this code CmSMbv - Online C++0x Compiler & Debugging Tool - Ideone.com But couldn’t really understand it.
If someone could point me to an editorial of a similar type problem or so, It would be great.

POJ/2915Zuma.cpp at master · Linzertorte/POJ · GitHub here’s another solution, a shorter one, but still can’t understand it. I even found an analysis of the problem, but in chinese

Please update this thread if you find any editorial equivalent .