The blog publish date is incorrect, should be around 12.07.2025. CF saved the draft date.
Hi, I'm organizing paid group classes on Dynamic Programming in August. Last year, I did something similar with general problem-solving (link).
There will be two groups of different style and difficulty. Each group gets 8 lessons of 1h30m each, from 28.07.2025 to 24-31.08.2025. Group size up to 12 people. You get access to recordings and problems from both groups, but you should actively attend only one. There's a lot of homework, some to be discussed next lesson. I will create new original CF/Polygon problems, especially for the easy group. These problems will eventually be published for everybody!
Price: 250 EUR with a small country-based discount.
Registration: You should pay via link (Stripe) and choose the group there. I will send you the Discord invite link via e-mail. Contact me if you're from a country outside Europe/USA/India so I could give you a small discount. The price is already set to 20000 INR for India, 20% off.
Platform: Discord for classes, links and extra discussion. Codeforces group (private GYM/mashup contest) for CF+original problems. YouTube for (private) recordings of the class.
Easy group, solving dp problems
Tuesdays and Fridays at 14:00 CEST.
Prerequisites: multi-dimensional arrays; knowing any way to compute N-th Fibonacci number in $$$O(N)$$$; being able to read C++ (so you would understand my code).
You will thoroughly learn iterative DP by solving 50+ easy/medium problems. You will learn how to come up with states and transitions, use multiple dimensions, iterate in correct order. I will often show a few lines of code in order to discuss e.g. array size, initialization, for-loop order, off-by-one errors. We'll cover knapsack variations (e.g. repetitions or small weights), optimal path reconstruction (with and without "breadcrumbs"), and using prefix sums to speed up transitions.
more infoYou can use any programming language. I will use C++ for my examples.
I will teach you the way I think about dp. "What is relevant/important so far?" and push/pull transitions (which is not the same as bottom-up/top-down). You can see some of my way of explaining DP in this old video.
We will use problems from Codeforces (including new original ones) and a few from CSES and AtCoder.
There will be a few non-dp problems to help you distinguish DP vs. Greedy.
Example problem 1There are N stones. A frog wants to get from stone 1 to stone N. There are $$$a_i$$$ candies on stone $$$i$$$. The frog can jump by 1 or by 2 stones to the right, but it cannot make $$$K$$$ consecutive equal jumps ($$$K \leq 10$$$). Find the max possible number of collected candies.
Two solutions: with more dimensions or with more transitions per state.
Example problem 2There are $$$N \leq 300$$$ values (-1e9 <= a[i] <= 1e9) and an integer $$$K \leq 10^9$$$. You can merge two adjacent values into their sum. You need to pay 1 coin if the two merged values differ by more than $$$K$$$. Find minimum total cost to merge everything into 1 value.
Follow-up: What if we are given $$$R \leq N$$$ and we want to finish with $$$R$$$ values instead of one?
Hard group, dp techniques
Tuesdays and Fridays at 16:00 CEST.
Prerequisites: Prefix sums, knapsack, bitmasks. Being able to solve (almost) any easy dp problem. Being able to solve at least half of the problems from AtCoder DP Contest.
This group will be more lecture-style, ofc. with asking questions and suggesting solutions to a problem/issue. But you mainly get to solve problems as homework. We'll cover switching dimension/answer, knapsack without one, last 1-2 tricks/problems from here, bitmask dp (briefly) & broken profile, SOS, small-to-large tree DP, some optimizations from here and tricks from here. We'll solve 2-3 very hard DP problems too.
more infoI will not show much code in this group. I think that it would be a waste of lesson time if I coded a full solution live. I can do a few lines of code/pseudocode though.
We will use problems from different sources, mainly Codeforces. When I don't like existing problems about some technique (e.g. it's overcomplicated and requires many extra steps), I will make a new CF/Polygon problem for you.
The topics include some from USACO Guide Platinum and Advanced.
We will not cover: LIS (too easy), all-directional tree DP (it's more about trees) and digit dp. I'm not sure about CHT and Aliens/Parametric search as it's more about geometry. We'll discuss it and vote on topics on Discord.
One strange/exception problem I want to coverYou are given $$$S \leq 10^9$$$ and three integers/bounds $$$A, B, C \leq 10^9$$$. Count the number of triples of non-negative integers $$$(a, b, c)$$$ such that $$$a \leq A$$$, $$$b \leq B$$$, $$$c \leq C$$$, and $$$a + b + c \leq S$$$.
There is a DP solution :)
LeetCode classes
Starting from August, I will also do weekly Sunday classes where we cover problems from the most recent LeetCode Weekly contest. 150 EUR / month. Registration soon.
Reach out to me (CF or errichto@gmail.com) if you have any questions. Cheers.