Topcoder SRM 555; Implementation Subtelties

This was my first non TCO div1 SRM, as last SRM advanced me to division 1. With this extra joy, came the nervousness of competing in a room where almost everyone else was supposed to be much better then me. Anyway, I had decided to focus on just the easy problem, as solving it alone would have raised my probability of gaining in rating. After struggling with it initially, I came up with the right approach to solve it. Unfortunately, I couldn’t get the implementation subtleties correct till the end, and ended up with non positive score. After the SRM, I entered practice room to validate that my DP was right, and also tried a simpler recursive method that worked as well.
Continue reading