How to solve this problem in dp?

Revision en1, by InshaAllah, 2018-04-18 17:14:40

http://mirror.codeforces.com/contest/337/problem/A

There are three tags for this problem( Greedy, Graph matching, dp). I have solved it using a greedy technique. Please help me to solve it using dp. Thanks, advanced!!!

N:B You can also suggest the graph matching solution.

Tags #dp, graph matching

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English InshaAllah 2018-04-18 17:14:40 303 Initial revision (published)