Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

pedriwnl's blog

By pedriwnl, 4 months ago, In English

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

Hint 1
Hint 2
Hint 3

Problem B — Frog 2

Hint 1

Problem C — Vacation

Hint 1
Hint 2
Hint 3
Hint 4

Problem D — Knapsack 1

Hint 1
Hint 2
Hint 3
Hint 4

Problem E — Knapsack 2

Hint 1
Hint 2
Hint 3
Hint 4

Problem F — LCS

Hint 1
Hint 2

Problem G — Longest Path

Hint 1
Hint 2

Problem H — Grid 1

Hint 1
Hint 2

Problem I — Coins

Hint 1
Hint 2

Problem J — Sushi

Hint 1
Hint 2
Hint 3
Hint 4

Problem K — Stones

Hint 1
Hint 2

Problem L — Deque

Hint 1
Hint 2
Hint 3

Problem M — Candies

Hint 1
Hint 2
Hint 3

Problem N — Slimes

Hint 1
Hint 2

Problem O — Matching

Hint 1
Hint 2
Hint 3

Problem P — Independent Set

Hint 1
Hint 2
Hint 3

Problem Q — Flowers

Hint 1
Hint 2
Hint 3
Hint 4

Problem R — Walk

Hint 1
Hint 2

Problem S — Digit Sum

Hint 1
Hint 2

Problem T — Permutation

Hint 1

Problem U — Grouping

Hint 1
Hint 2

Problem V — Subtree

Hint 1
Hint 2

Problem W — Intervals

Hint 1
Hint 2

Problem X — Tower

Hint 1
Hint 2

Problem Y — Grid 2

Hint 1
Hint 2

Problem Z — Frog 3

Hint 1
Hint 2

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.

  • Vote: I like it
  • +80
  • Vote: I do not like it

»
4 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by pedriwnl (previous revision, new revision, compare).

»
4 months ago, hide # |
← Rev. 2  
Vote: I like it +14 Vote: I do not like it

Exactly the kind of editorial we need.

The hint type, it's best atleast for me!

Thanks!

»
4 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

oh wow thanks a lot actually now days i just started practicing dp so it's so helpful

»
4 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

I didn't even know this kind of contest existed. Thanks for the editorial :) Another opportunity to improve at cp.

»
4 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

Nice material

»
4 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

crazy work

»
4 months ago, hide # |
← Rev. 2  
Vote: I like it +11 Vote: I do not like it

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!

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    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

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

hey, i can't access the links in the editorial. Can you resend the pdf

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Great work. <3

»
2 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Could you send the link to this article from the Editorial?

Rerooting DP blog with introductory problems!