Stage 1 · Lesson 2 of 7
Compiler, editor and flags
Install a C++ compiler, usually (the GNU compiler), and an editor you like, such as VS Code. On Windows, WSL (a Linux environment inside Windows) or MSYS2 gives you g++ easily; on macOS and Linux it is a short install. Compile from the terminal with warnings on, and learn a second command with : compiler options that stop the program with a message when you read outside an array or overflow an integer.
Keep a folder per contest with a file per problem and an input file for the samples. Choose the same C++ standard, such as C++20, that your judge offers.
Common traprelying on an online IDE, where you cannot use sanitizers and lose your code when the tab closes.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
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