1. You must be carefully, typically I rare create "test cases", just write and submit the source code (I have a lot of WAs in some judge online). This time A,B are passed with 1 submission. It makes me feel comfortable.
2. You need to wait the judge evaluate your submission. I submitted C problem, I saw green (Accepted - 0s) and I changed to problem D, but late, i checked the standing board I saw (-1), so I need to verify my code (it showed 30ms). One experience.
3. Problem D, I think it is easier to think about recursive DP than iterative DP and coding recursive DP is also easy too.
Two stuffs which can help you solve this problem:
4. Problem E, time out because of D.