Skip to content
Chiify
C++ for Competitive Programming

C++ for Competitive Programming

by Donovan Ross

In a programming contest, correct is not enough. Your solution has to run inside a time limit of a second or two and fit in a few hundred megabytes of memory, or it fails. This book teaches C++ the way contest programmers use it: for speed, for control, and for the standard library that saves you from writing everything by hand.

It starts with what competitive programming is, how the major online judges and their rating systems work, and how to set up a compiler and editor that match what the judges run. Then it builds your toolkit in order: C++ essentials written for efficiency, time and space complexity, the STL's vectors, sets and maps, and the data structures contests actually test, from arrays to trees and graphs. The algorithm chapters cover searching, sorting and the two-pointer technique, greedy and divide-and-conquer strategies, dynamic programming and graph traversals.

The final chapters are about performing under pressure: problem-solving strategies, the classic pitfalls, debugging when the verdict comes back Time Limit Exceeded, and how to structure practice with mock contests.

For programmers who want their solutions accepted, not just compiled.

$5.99