Hi guy, I was trying to solve a problem (link : http://www.usaco.org/index.php?page=viewproblem2&cpid=193〈=en)
It's a dynamic programming problem and the most difficult to solve is optimize the state of dp function.
Nearly, I found a cool solution (it's the second code in this solution : http://www.usaco.org/current/data/sol_bbreeds.html)
I don't understand how does it's work. Can you tell me the idea behind that?
Thanks you very much!