Stage 1 of 10 · 7 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
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++.

If C++ is new, learn just enough to read input, use vectors and sort, then learn the rest as problems need it. Python or Java are fine for your first easy problems, but C++ is what most contestants use, because it is fast and its standard library has everything contests need.