Do anyone know how can i learn how to use dp algorithm? like, i cant use anything that i read from books and i need to learn it.
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 165 |
2 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 160 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 153 |
Name |
---|
Start with the fundamental problems. CSES Problem Set is a great resource. Spend some time on each problem you solve on your own or by seeing the solution. Understand the intuition of how the states are linked to each other, how the base cases, and finally the final subproblem is formulated. Understand the Transitions very thoroughly and analyze why such Transitions. After you do 50-60% of the Problem set you are good to go. Now only practicing good problems would take you further.
Learn Recursion (You are given : [1,2,3,4,5,6]. Now you are able to write a code that will generate all possible combinations for ex. [2,3,4,1,5,6], [3,2,5,6,1,4]... total of 6! combinations using recursion and you understand how the code works).
Learn backtracking (Solve 8-queens problem and understand how the recursion works)
Read these 2 tutorials : Tutorial-1 Tutorial-2
You need to do some meditation first to develop enough concentration. With love.
hard luck bozo
The Atcoder educational dp contest might also help.
The one thing that helped me immensely in understanding DP are Errichto youtube videos on dynamic programming where he goes over some basic and very common DP problems. Good luck!
The answers mostly discuss practice, and are quite comprehensive in their coverage of resources. I would like to add though, one might need to go over blogs/videos multiple times in order to understand the same. Don't be disheartened by that. Also, you can refer to this blog for the basic idea of DP.
https://www.youtube.com/playlist?list=PLgUwDviBIf0qUlt5H_kiKYaNSqJ81PMMY
you can see this, it helped me a lot .
i personally wouldn't advise learning dp at rating 588. I recommend practicing problems at the moment and then you should start of with some algorithms such as binary search
Start with problem in atcoder dp contest, in this contest appear all basic techniques. Good luck for problem solving!
Bruh
buddy dp is a optimization technique. not the idea to solve a question. the main idea requried to solve the question is always something else, you just use dp to optimize it :) change pov