Hi everyone, I became grandmaster today so I decided to 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. The main thing I want to show here is that you don't need to know or memorize a bunch of advanced algorithms to become grandmaster, because as you will see, there are many popular algorithms that I have never needed in a CodeForces contest. 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): - Problem A: Basic math and implementation