For a long time I thought that the comment that I left in 2011 after the PHP bug was sufficient. Remembering it today I edited the answer at the same time that I posted here.
Now I could be faulted for not having responded to the comments in 2015. However I was taking an extended break from stack overflow after getting annoyed at the moderation of https://stackoverflow.com/questions/11314077/algorithm-for-e.... When I came back, dealing with the variety of things that could have further annoyed me while I was gone did not seem worthwhile, so I didn't. (It remains a pet peeve that a lot of moderators remain quick to close algorithm questions because they do not recognize DP-type problems as things which are more likely to be answerable by people with a CS background than a math one.)