Dynamic Programming by Alamin Bhuiyan
Dynamic Programming by Alamin Bhuiyan
My name is MD AL AMIN BHUIYAN. I was trying to get some knowledge about dynamic
programming. During my learning period, I tried to gather all resources in one place and also make
a list of my solved problems day by day. So if I get any improvement or anything good in my
process this is the path that I will show to others and so on.
Sorry for my poor English. Let’s move on to my next point.
I searched a lot of videos on YouTube. Every resource has different types of specialty. I made up
my mind to follow a particular one.
First I have watched the video mentioned below for a specific guideline.
In this video, there are some resources in the description which I have also copied here. After getting
this information I have watched Aditya Verma’s playlist. Here I also like to mention that his recursion
playlist is very efficient. This playlist is suggested by my friend Hasan. I learned recursion before so I
didn’t watch it during my learning time.
Before solving new problems I watched the lectures of Errichto on youtube. You can see in my
solved problems list that I mentioned the lecture number before solving the specific problem.
Errichto Lectures:
1. https://www.youtube.com/watch?v=YBSt1jYwVfU
2. https://www.youtube.com/watch?v=1mtvm2ubHCY
3. https://www.youtube.com/watch?v=KJWAQVmuFW0
Some tricks and realizations during my learning time. You can just roll your eyes at the points
mentioned below:
My friend Hamim said to remember 3 things to solve DP: (these 3 points are difficult to understand
by reading. Come to me I will show it with an example)
1. States
2. Base case
3. Formula (recursive case)
Hamim told me to search for these 3 points in my solution idea. First look for the states you want to
declare in the bound. Find the base case when will your recursion stop. Finally, make a formula for
the solution.
There are some observations that I have achieved during my learning period. I am
going to mention them, including the day number. These points may or may not be
understood so you can just go through the points:
● The base case doesn't always return 0(zero). There might be some conditions to
returning zero/one otherwise returns the max/min value. (Realization from day 19th)
● For the “number of ways” problems, we need to sum the answer in the recursive case.
(Day 22)
● On day 27th, I solved my first dp problem in a virtual contest. Hope the real contest
goes up.
● Sometimes it is better to memorize the dp array with max values or min values(day 32)
● On day 33 I thought not to use a condition while it was very important and impactful
Here are the links to the resources mentioned in the guideline video:
Hackerearth’s 4 DP Tutorials:
https://www.hackerearth.com/practice/...
Codechef:
https://www.codechef.com/cptutorials?...
DP Playlist:
https://www.youtube.com/playlist?list...
CSES: https://cses.fi/problemset/
ATCODER: https://atcoder.jp/contests/dp
USACO guide gold: https://usaco.guide/gold/
USACO guide platinum: https://usaco.guide/plat/
USACO guide advanced: https://usaco.guide/adv
Solved Problems:
5 https://atcoder.jp/contests/abc220/tasks/abc220_d 2D Fibonacci
7-11 https://atcoder.jp/contests/dp/tasks/dp_d
https://atcoder.jp/contests/dp/tasks/dp_e
https://cses.fi/problemset/task/1158 Knapsack
https://cses.fi/problemset/task/1745
https://cses.fi/problemset/task/1093
12 https://codeforces.com/problemset/problem/106/C Knapsack
13 https://codeforces.com/contest/730/problem/J Knapsack
18 https://codeforces.com/contest/358/problem/D Knapsack
https://codeforces.com/contest/225/problem/C
19 https://codeforces.com/contest/234/problem/F Knapsack
20 https://codeforces.com/contest/67/problem/D LIS
https://codeforces.com/contest/214/problem/E Recursion/Subproblem
21 https://lightoj.com/problem/pimp-my-ride Bitmask Dp
22 https://lightoj.com/problem/divisible-group-sums No of ways
24 https://lightoj.com/problem/how-many-zeroes Digit Dp
26 https://codeforces.com/contest/1633/problem/D Knapsack
32 https://codeforces.com/gym/104059/problem/I
33 https://atcoder.jp/contests/abc303/tasks/abc303_d
34 https://www.codechef.com/problems/CS2023_404 IDEA