Practice: Algorithms and the C ++ Standard Library

Recently, posts rarely appear here, since we are trying to translate quantity into quality. In particular:

from scattered materials on C ++ we collect something like a textbook for beginners (now only the first 4 lessons are ready);
the continuing education textbook should contain the most up-to-date information, but this information is found only at conferences. Collecting materials, we write annotations and summaries to the most interesting reports from conferences – so far they are laid out only in our VKontakte community, but in the future we will comb them (structure) and post them here as a textbook article;
a textbook is good, but to learn to program, you need to program (solve a lot of problems). We took olympiad problems as examples (now you will find exactly 100 analyzed problems by the link). These tasks are structured by topic and tag. However, we decided to choose the most interesting (and useful) tasks – that’s what this article is about.
Both the Olympiad problems and our solutions to them have a number of features:

the essence of Olympiad programming is to find and quickly implement the optimal solution to the problem. Optimality criteria are memory and time. Therefore, in order to fully understand the problems and solutions, look at at least this, or even better, this article about the analysis of algorithms. This is important, since for many problems we provide 3-4 solutions with different computational complexity;
at the Olympiads, you need to quickly write a solution (after all, the timer is ticking). Therefore, the quality of the source code of the Olympiad players often suffers (there are even stories about this). However, we are writing a textbook and teaching how to do well. Some of our solutions are distinguished by the quality of the code, to understand what it is, take a look at the articles “Theory of Clean Code”, “SOLID Principles”;
if we write good code in C ++, then we are trying not to reinvent the wheel and use the standard library (STL) to the fullest, which contains not only containers. Before looking at the solutions, we recommend trying to pass small tests: a test about std :: vector, a test about std :: list.
From these features follow the skills you can learn by familiarizing yourself with our problem solutions.