Contest basics
How online judges work, how to read input fast and judge speed from the limits, and the STL tools that most solutions use.
About 4 hours of study
Learning objectives
- Read the verdicts a judge gives
- Choose an algorithm from the limits on n
- Use sort, set, map and lower_bound
Lessons
- 1
Contests, judges and time limits
How an online judge checks your program, the verdicts it gives, fast input in C++, and how to tell from n whether an idea is fast enough.
- 2
The STL toolbox for contests
The handful of STL tools contestants use all the time: sort, vector of pairs, set, map and lower_bound.
Module practice
- CP: Read until the endEasy
- CP: Smallest, largest and how oftenMedium
- CP: The most common valueHard
- CP: Distinct values in orderEasy
- CP: The most common wordMedium
- CP: The closest valueHard