Stage 1 of 10 · 8 lessons · ~3 weeks
C++ for contests
Set up a compiler and a template, learn the STL containers and algorithms contests use every day, and learn to read constraints so you know what complexity you can afford.
Start: Reading constraints and time limitsLessons· one lesson for each topic, in this order
- 1Reading constraints and time limitsLesson
- 2Compiler, editor and flagsLesson
- 3Your template and fast input and outputLesson
- 4Vectors, pairs and sortingLesson
- 5Sets, maps and priority queuesLesson
- 6STL algorithms you will use weeklyLesson
- 7Integer overflow and choosing typesLesson
- 8Hash maps and anti-hash testsLesson
Do this
- Install g++ and an editor, and compile a program with warnings and with sanitizers.
- Write your contest template and type it from memory three times.
- Solve the first 10 CSES Introductory Problems in C++.
- Make an account on Codeforces and on AtCoder.
- Solve 10 problems rated 800 on Codeforces, reading the constraints first each time.
- Keep every accepted solution in a Git repository, one folder per platform.
Start with· follow one of these
- CourseFreeLearnCpp.com
LearnCpp.com · Beginner
Free and thorough: read the chapters on vectors, references, lambdas and the standard library if C++ is new to you
- BookFreeCompetitive Programmer's Handbook
Antti Laaksonen · Beginner
Chapter 1 covers C++ for contests, input and output and working with numbers; Chapter 2 covers complexity
Practise
Keep handy
Also worth your time
A clear walk through time and space complexity, the language you need to read constraints
- USACO GuideGo deeper
The General section has practical pages on choosing a language, fast input and output and debugging
Before moving on: A compiler and editor set up with warnings and sanitizers, a template you can type from memory, and the first two CSES sections or 20 easy Codeforces problems solved in C++.

You probably know most of this already, so skim it. Check that your template is short enough to type at an ICPC site, that you compile with sanitizers when debugging, and that you know how to defend a hash map against anti-hash tests.