I feel like I'm extremely weak on DP problems. Can somebody suggest a way to practice DP?
I feel like I'm extremely weak on DP problems. Can somebody suggest a way to practice DP?
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3831 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | gamegame | 3386 |
10 | ksun48 | 3373 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
6 | adamant | 157 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
Name |
---|
I suggest reading these https://mirror.codeforces.com/blog/entry/67679 https://mirror.codeforces.com/blog/entry/80064 https://mirror.codeforces.com/blog/entry/70018
Try to solve DP problems using tabulation method and first of all try to understand 0-1 knapsack. Tabulation method will provide you a more clear understanding how dp actually works
I know how DP works, but I just can't figure out how to use DP in problems.
For solving DP problems try to form a state for the problems and try to see how to change from one state to another. For forming a state try to minimise the problem, like for forming Fibonacci series try to see how fib(4) could be formed from fib(3) and for changing the state see what changes are being done for getting fib(4) from fib(3)
Well, to get into DP, I would suggest you to do some beginner DP problem set, such as CSES, Atcoder (this one does contain some relatively hard stuff so I would suggest complete like 75% of them). Then, you would pull off the pro-gamer move in your training, which is not doing DP problem set, and just solve everything thrown at you. As counter-intuitive as it may sounds, not specifically doing DP problem will benefits you greatly, as it will train your ability to notice DP problems, as well as changing your mindset to use DP as a tool, not as the entire solution. I've met quite a few problems where DP is the easiest part lol.
Thanks a lot! By the way, could you give some tips on how to reach candidate master?
you should get proficient at basic techniques, such at binary searching, two pointers, dynamic programming, hash and basic graph knowledge. You should also get to a certain point of math maturity. I know several people who are not that good at math, therefore it took them an excessively long time to reach Candidate Master. Some have been at Expert for like a whole 3 years.
From my experience, the best way is to just practice. It helps improve your skill and your experience to deal with problems in the future. About the problem source, I suggest the CSES problem set, it contains some nice DP problem that you can do to practice. Hope it'll help!