### Glydon's blog

By Glydon, history, 14 months ago,

Most of the DP tagged problems that are below 1600 RATING are solvable by Greedy Approach hence not making much progress in my DP practice and DP problems that are rated above 1600 feels a bit tough even to understand sometimes. So what should I do? :( I know and solved many of the classical DP problems but am still unable to implement DP most of the time in CodeForces.

What should I do?

• +24

| Write comment?
 » 14 months ago, # |   +14 Even I have the same question...
 » 14 months ago, # |   +10 the tag is usually misleading.maybe ask someone for dp problems recommendation?
 » 14 months ago, # |   +47 You should improve the skill of finding states and transitioning between those states. You can develop these skills by solving some DP problems that challenge you. Important thing is that from all the classical-DP techniques you've learned, you should understand why and how they work.
 » 14 months ago, # | ← Rev. 4 →   +28 I don't know whether people will agree or not but I think clinging to solving random problems in codeforces eventually makes one capable of every important part of cp with time
•  » » 14 months ago, # ^ |   +1 Yup Yup, that's true, but one also needs to keep a check on the new learned concepts and see if he/she is able to solve the actual problems on cf from the same topic or not!
 » 14 months ago, # |   +4 maybe try solving the same problem with dp after solving it with greedy approach
•  » » 14 months ago, # ^ |   -20 that's a boring idea at least for me
 » 14 months ago, # | ← Rev. 3 →   +95 I think you're misunderstanding the implication of most problems below 1600 rating tagged dp having greedy solutions. Its not that most easy dp problems also have greedy solutions, but rather if the dp solution was the only solution for those problems they would probably be higher rated.But coming back to your original question, practically any problem in competitive coding is made up of two parts: The adhoc part. The standard part. The adhoc part is usually what makes the problem interesting, its the observations required to reduce the problem to something you know how to solve, i.e, the standard part. In a good problem $\text{difficulty(the adhoc part)} \gt \text{difficulty(the standard part)}$, otherwise it just becomes a game of who has memorized more standard ideas. Most good competitive coding platforms (including Codeforces) tend to follow this rule for the most part and this is true for dp problems as well. Good dp problems will often require you to make adhoc observations to figure out some properties that allow you to apply dp on them.If you've solved a lot of standard dp problems but aren't able to solve dp problems in CF contests, maybe you're struggling with the adhoc part? If so I'd suggest solving problems from the CF problemset without any topic restrictions. Aim for a difficulty range such that the problems that are tough, but not so tough that you can't understand the editorial either. Current rating + 100-300 is what a lot of people suggest, but remember to increase / decrease difficulty to find what suits you. Also personally I'd suggest avoiding older problems if you're trying to improve adhoc since they contain a lot more standard ideas.Also on a personal note back when I was on the edge of Expert I remember really struggling with dp problems. And as far as I remember even simple linear dp problems were 16-1700, so unless their difficulty has sharply dropped maybe you're jumping into them a bit too early?
•  » » 14 months ago, # ^ |   +9 I can't understand editorial for most problems, even one's I was able to solve myself. I usually waste like a day to understand editorial, and sometimes don't succeed. So that doesn't look like a good restriction for a "too hard" problems, as for me.
•  » » » 14 months ago, # ^ |   +8 I faced the same problem. In most cases, I'll find good solutions in the announcement/editorial comment section.
 » 14 months ago, # |   +30 I hate this so much about CF tags. Most of these 1600s you are talking about have DP tag because there exists some solution (often very complicated compared to the official solution) that uses DP. Not because DP is in any way a reasonable method to solve this problem. More than once I have searched for easy DP problems for some workshop this way and every time I'm disappointed because the 1600s are not at all DP problems.
•  » » 14 months ago, # ^ | ← Rev. 2 →   +32 I'd say they're most likely dp problems. I somewhat often use DP on div2B/C because if you think of it as DP it removes the need to wonder if the "greedy" solution is correct or not because DP trivially proves the correctness usually.EDIT: taking a look at those problems, indeed it seems the DP tag is misused more often than I thought lol
•  » » » 14 months ago, # ^ |   0 I was about to say the same thing and you beat me to it. To my students I always recommend to go for DP instead of greedy whenever applicable because it's trivially correct.
•  » » » » 14 months ago, # ^ |   0 If I can think of both a DP and a greedy approach, I always implement DP approach. Some seemingly fine greedies are wrong. Greedy sometimes has edge cases. DP is easier to implement and prove correctness of.
 » 14 months ago, # | ← Rev. 2 →   +3 Pratice Atcoder Educational DP contest . Which I am also doing. Problems level are gradually increasing.So perfect for beginner.
•  » » 14 months ago, # ^ |   0 I second this recommendation. Here's a link: https://atcoder.jp/contests/dp/tasksCSES also has a Dynamic Programming section with some basic problems, and some more advanced DP problems later: https://cses.fi/problemset/list
•  » » » 14 months ago, # ^ |   -12 can you clarify why you recommend cses dp section over atcoder educational dp contest problems?
•  » » » » 14 months ago, # ^ |   +1 I don't. Both are good. Solve both.
 » 7 months ago, # | ← Rev. 2 →   -7 .