Hi everyone, I became grandmaster today so I decided to go down memory lane and review every problem I have ever done in a CodeForces contest to look back and see every technique/algorithm I had to use to become a grandmaster. I am not sure how useful this is, I mostly think it's fun to look at all the old solutions I wrote and how different it was from how I write code now. I think the main takeaway is that, as many people have said before, you don't need to know or memorize a bunch of advanced algorithms to become grandmaster. As you will see, there are many popular algorithms that I have never needed in a CodeForces contest despite being a grandmaster. There are also many problems where I just say I use "ad hoc reasoning," meaning there's not a standard technique I used to solve the problem and you just need to be able to make certain observations (this blog about "forcing" by -is-this-fft- explains what I mean by "observation") and find certain invariants to solve the problem.
This isn't to say that learning algorithms is bad—I love reading cp-algorithms.com and learning new algorithms—but for the purpose of getting better at competitive programming, at least on CodeForces, practicing consistently and getting better and better at your general problem-solving abilities matters much more.
CodeForces Round #362 (Div. 2): Rating went from 1500 to 1504 (back then, default rating was 1500 instead of 0)
Codeforces Round #363 (Div. 2): Rating went from 1504 to 1536 (+36)
- Problem A: Brute force
- Problem B: Brute force
- Problem C: Ad hoc reasoning and basic bitmasks (there is a dynamic programming solution, but that's not how I solved it)
Codeforces Round #553 (Div. 2): Rating went from 1540 to 1566 (+26)
- Problem A: Brute force
- Problem B: Brute force and bitwise operations
- Problem B: Ad hoc reasoning and math
Codeforces Round #570 (Div. 3): Rating went from 1566 to 1732 (+166)
- Problem A: Basic number theory
- Problem B: Ad hoc reasoning and math
- Problem C: Ad hoc reasoning and math
- Problem D: Greedy and priority queue
- Problem E: Ad hoc reasoning with strings (there is a BFS solution, but that's not how I solved it)
- Problem H: Dynamic programming (I used the count unique subsequences of a given length algorithm)