Hi, Codeforces community,

I'm trying to improve my Dynamic programming. I'm able to solve DP problems under 1100-1200 but struggle with DP problems above that rating (When I don't know I have to use DP). The major problem I'm having and which I want to ask with the help of this blog is how to practice to improve?

When I practice DP by searching DP problems specifically by tags I simply don't see improvement because I know I have to apply DP. And came to the conclusion that I can solve the DP problem but just don't know when to use DP. So, How should I practice to improve this? I know Practice is the solution but guidance on how Should I practice would be helpful.

When should we start doing dp ?

I started practicing it from the day-1.

Star random DP and non-DP problems without seeing the problem name.

Solve them from favorites, now you won't know if it's a DP problem or not.

Thanks for the advice. I'll try it.

Practice. Do approx 500 problems on Dp and then you are good to go.

Beginner:Click me

Medium: Click me

Hard: Click me

500 seems like an incredibly inefficient practice routine

It just a random number that came to my mind, you can even try 499 problems XD.

How about 69 ?

Well I can see where my "Jallu" is going! ;)

:-) then the DP will do 69 with me

What a coincidence I actually started the beginner's one this morning. Thanks for the advice.

You may benefit from these blogs:

Spoileri'm crying loudly because bad connect made me lose what i had typed !!!

if nobody needs i won't type them again.

Now i'm curious

emm……i try to write down some of my thoughts.it's not easy because of my poor English.

i think it's necessary to do some exercise.but not too much.for each problem,try to solve it by yourself at first.maybe it's hard to solve but don't worry.to see the solution,just like what i always do XD.don't just copy the answer like dp[i][j] = dp[i-1][j] + (n-i)*dp[i-1][j-1].try to find out how it works,and why it is correct.

to learn about what is the meaning of 'dp' and the meaning of state transition equation.this is IMPORTANT.

P.S i don't know how to describe 'state transition equation' in English ,maybe it's incorrect.

Perhaps

Aditya VermaDp playlist can help you to learn concept in very clear and structured way. He explain how to find that dp is applied in some question or not. LinkFor rest I can say that it comes with your

experience. Explore more question (of different types) onother's platformtoo.Honestly, Aditya Verma DP playlist is way too fkn underrated, people need to know about it more, especially beginners, it's all in Hindi so I guess non-hindi speakers won't get it.

Practice randomly :p

Dis way, you don't have context for the dp problem and the solutions will be less obvious, meaning that you'll probably learn a lot more from doing that problem over another dp problem.

If it's hard to see improvement fast check out the greedy and dp tags. Here you'll maybe gain more intuition for dp and possibly learn how to solve problems with both.

https://cses.fi/problemset/ just do all DP problems.

Step 1: Start with a little on Day-1, basically an easy problem,

Step 2: The next day, build up upon what you learned the previous day.

Step 3: Repeat Step 2

I'll tell you what helped me, try and understand all the standard DP problems, be it knapsack or coin change, do cses dp section. After that start doing cf, you'll feel better about it.

Dp everyday!

Ig cses(dp) and leetcode(dp section) are really the best places to start dp from. They have trivial dp problems which can help you improve your "raw" dp skill.

Then learn some new tricks like bitmasking, range dp, matching dp etc.

Now solve every problem on dp on USACO Guide (Gold/Platinum).

Then solve every problem on Atcoder dp contest(It even has a editorial now Lunchbox orz).

Then finally move onto CF dp section 1600+ only. You can also use binarysearch.com for additional dp practice. If you feel like it.