How to become strong at implementing DP

Revision en1, by tickbird, 2024-10-15 03:53:11

Hello,

I’m at that point where I can recognize a problem has something to do with DP, but I just can’t seem to translate that into actual code. I believe I get the basics like overlapping subproblems, and I can figure out if a problem is DP-related. But when it comes to sitting down and writing the actual implementation.. I literally face a wall.

for example see recent problem like 2022C - Gerrymandering

I knew it must has something to do with DP, and able to identify three condition? 1x3 shape L shape, Г shape and closing but endup with no actual code but full of thought in 2 hours.

Anyone have tips on how to bridge that gap? How do you go from identifying a DP problem to confidently writing out the solution?

And what is your rules of thumb that you follow when implementing DP problems? I'm not posting this to hear something like "practice more problem on DP" or similar.

Thanks in advance.

Tags dp, practice, help me

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English tickbird 2024-10-15 03:53:11 955 Initial revision (published)