I have discussed a solution to problem 1225-Flags from Timus OJ on my blog. This is a beginner-level dp problem and I have tried to explain the solution as intuitively as possible.
http://theanirudhrb.blogspot.com/2014/10/problem-discussion-timus-oj-1225-flags.html
I am always open to feedback!
Have a nice day!