Hello, Codeforces!
Introduction
Searching for editorials for this contest can be surprisingly annoying, since there is no official editorial on the AtCoder website.
Because of this, my friends (murkat and GuilhermeKK) and I felt it was necessary to put together a unified guide all in one place. We essentially wanted to create the editorial we wish we had when we were first solving these problems!
Who is this for?
This contest covers all the fundamental DP techniques and optimizations. If you are not familiar with DP (and you definitely should be, since it is one of the most common topics in cp), the first few problems will be perfect for you to understand the reasoning behind it.
If you know the basics of DP but feel like you are always one step away from finding the right state or transition, there are a lot of great problems here for you to practice. If you are looking for DP optimizations, the most important ones are all covered.
If you already handle complex transition and know the classic optimizations, a quick skim through the final problems can still be a great way to recap and solidify your DP skills.
Hints
When learning a new technique, spending time with some problems is necessary. Because of that, it doesn't make much sense to jump straight into the full editorial without putting in some effort first.
If you are stuck, consider reading these hints before going to the full solutions.
Problem A — Frog 1
Problem B — Frog 2
Problem C — Vacation
Problem D — Knapsack 1
Problem E — Knapsack 2
Problem F — LCS
Problem G — Longest Path
Problem H — Grid 1
Problem I — Coins
Problem J — Sushi
Problem K — Stones
Problem L — Deque
Problem M — Candies
Problem N — Slimes
Problem O — Matching
Problem P — Independent Set
Problem Q — Flowers
Problem R — Walk
Problem S — Digit Sum
Problem T — Permutation
Problem U — Grouping
Problem V — Subtree
Problem W — Intervals
Problem X — Tower
Problem Y — Grid 2
Problem Z — Frog 3
The Full Editorial
The complete solutions and detailed explanations can be found in this PDF: Editorial_Atcoder_Educational_DP_contest.pdf. Once again, we highly encourage you to only read the full solution for a problem after you have genuinely struggled with it and checked the hints!
Conclusion
Writing this guide was really fun, and we put a lot of effort into making it as clear as possible. If you liked it, have any suggestions, or even if you found any mistakes, please let us know in the comments!
We would love to know if you found this useful, as we are currently planning to write more editorials for ICPC-style contests that lack official solutions.








Auto comment: topic has been updated by pedriwnl (previous revision, new revision, compare).
Exactly the kind of editorial we need.
The hint type, it's best atleast for me!
Thanks!
Thanks for your feedback!
Just asking, if you plan to make this kind of editorial for Next DP contest as well?
Yes! Next DP is more advanced, but it also shares a lot of common techniques
oh wow thanks a lot actually now days i just started practicing dp so it's so helpful
Happy to help! This contest is amazing for a first contact.
I didn't even know this kind of contest existed. Thanks for the editorial :) Another opportunity to improve at cp.
Thanks!
Nice material
crazy work
Actually we need this type of editorials. Maximum people fear from dp and that dp contest of Atcoder is a good option to master it. But lacks of perfect editorial makes it hard to practice effectively. Additionally, I personally feel that for dp problems specially for beginners hints are crucial because only seeing editorial makes no sense. That is why hints are very necessary as it helps us to think systematically.
Many many thanks to pedriwnl!
We are really happy to help. I think the problems I learned the most were the ones I couldn't find a solution before reading some hints, that's why we put effort on doing it
hey, i can't access the links in the editorial. Can you resend the pdf
Great work. <3
Could you send the link to this article from the Editorial?
Rerooting DP blog with introductory problems!