Hi Guys
I was reading this document point "2.1. The problem" and I was trying to implement the solution for (point "2.3.1. Leaves") http://vn.spoj.com/problems/NKLEAVES/en/ but I think I am missing something, my implementation fails even with example test case :(. Please, can someone help me with this problem.
Just in case, cij in the document is my function cost(i,j), F[n] is my dp[n][j], g in the document is the same g, but I send an extra parameter j the number of piles.