pedriwnl's blog

By pedriwnl, history, 2 months ago, In English

Hello, Codeforces!

Introduction

Recently, we had the opportunity to prepare an editorial for problems from the USP Tryouts 2025.

My friends (murkat and GuilhermeKK) and I put a lot of effort into creating a detailed editorial, trying to teach the used techniques.

Who is this for?

The contest has problems ranging from relatively straightforward observations and standard algorithms to much more complex data structures and techniques.

If you are still building your competitive programming foundations, the easiest problems are a good opportunity to practice identifying the main idea and turning it into a clean implementation.

If you already have more experience, the most difficult problems cover advanced techniques(try problem C and E).

Even if you have already solved the contest, reading through the editorial can still be useful for comparing approaches and finding different ways to reason about the problems.

The Full Editorial

We prepared the editorial in both Portuguese and English. Both versions contain detailed explanations of the main ideas, complexity analysis, and complete C++ implementations.

The Portuguese version can be found here:

Editorial em Português

The English version can be found here:

Editorial in English

We recommend spending some time thinking about each problem before reading its full solution. Some of the most interesting parts of this contest are precisely the observations that lead to the intended approaches! If you are stuck, we highly recommend you to not read the complete solution, maybe reading a little bit it's enough for you to solve the entire problem!

Conclusion

If you liked the contest, have any suggestions, found an alternative solution, or noticed any mistakes in the editorial, please let us know in the comments!

Full text and comments »

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

By pedriwnl, 3 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.

Full text and comments »

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