Getting started
Getting started
%%{init: {
"themeCSS": "
.edgeLabel {
background-color: transparent !important;
}
.edgeLabel p {
background-color: transparent !important;
padding: 0 4px !important;
}
"
}}%%
flowchart LR
ZCO --> INOI
ZIO --> INOI
INOI --> IOITC
INOI -->|top 60| inoimed[Medals]
inoimed -->|top 10| inoigold[Gold]
inoimed -->|top 30| inoisilver[Silver]
inoimed -->|top 60| inoibronze[Bronze]
IOITC -->|top 4| IOI
IOI --> ioimed[Medals]
INOI -->|top 60| APIO
APIO -->|top 6| apiooff[Official Participants]
apiooff --> apiomed[Medals]
INOI --> egoitsts[EGOI Team Selection]
egoitsts -->|top 4| EGOI
EGOI --> egoimed[Medals]
classDef medals fill:#60A5FA,stroke:#2563EB,color:#000
classDef gold fill:#FFD700,stroke:#D4A900,color:#000
classDef silver fill:#C0C0C0,stroke:#808080,color:#000
classDef bronze fill:#CD7F32,stroke:#9A5A24,color:#000
classDef pink fill:#FFB6C1,stroke:#FF69B4,color:#000
classDef main fill:#C4B5FD,stroke:#7C3AED,color:#000
class inoimed,ioimed,apiomed,egoimed medals
class EGOI,egoitsts pink
class ZCO,INOI,IOITC,IOI main
class inoigold gold
class inoisilver silver
class inoibronze bronze
Roadmap
Olympiad preparation is not easy, and is definitely time consuming. For some steps, I’ll also include a ‘recommended time to spend’ so you have some sort of guideline to follow.
- Introduction
- Learn C++ (1 week):
- YouTube video (recommended)
- Or if you prefer something structured as a course: this may go into additional unrequired depth, for example the information about build systems is unnecessary for competitive programming
- (optional) After you’ve learned the language, if you still have time left over, play around with the language (make mini projects). This will really help you get comfortable.
- (more optional) I’d recommend learning the following features specifically
- some STL algorithms like
std::sortandstd::find- we’ll learn specifically useful ones as we progress
class/structtemplate <typename T>
- some STL algorithms like
- (more optional) I’d recommend learning the following features specifically
- Built-in data structures
- Linear search
- Basic implementation
Our main strategy will be to use CSES along with AtCoder (here, we’ll be giving AtCoder beginner contests). You can also give contests on Codeforces, but we believe that modern-day Codeforces is not as relevant to OI as AtCoder is, especially in the earlier stages.
Note that most CSES solutions can be found in CPH (although this book describes some solutions a bit too concisely, sometimes not enough to learn a concept).
- AtCoder: beginner contests are held every Saturday at 5:30 IST. You should participate in all of them and aim to get A-D for ZCO and A-F for INOI.
- Static range queries
- Constructive algorithms
- Greedy algorithms
- Binary search
- Dynamic programming
- Solve problems from the AtCoder DP Contest
- Also solve problems from the CSES ‘Dynamic Programming’ section.
- In general, this playlist is pretty good for solutions for CSES.
- You should try solving a problem, and if you can’t, watch the solution.
- Graphs
- Almost all problems from the CSES ‘Graph Algorithms’ section are relevant. You can probably skip these ones though:
- Giant Pizza: uses 2-SAT
- Mail Delivery, De Bruijn Sequence , and Teleporters Path : use the concept of an Eulerian tour/path
- And you can probably skip the last 4 problems (they use flows), although the newer IOI syllabus does now include them
- Almost all problems from the CSES ‘Graph Algorithms’ section are relevant. You can probably skip these ones though:
- Segment trees
- This article also covers Fenwick trees, which you could also learn. They are easier to code, but much harder conceptually to understand
- This SPOI lecture also covers segment trees
- Solve problems from the CSES ‘Range Queries’ section
- Disjoint set union:
- Here’s an SPOI lecture that covers this, go to ~1:42:00
- If you prefer a text resource, you can use this
- Sparse tables: closely related to binary lifting
- Trees
- The CSES ‘Tree Algorithms’ section has relevant problems
- You should be able to skip Path Queries II if you’re only preparing for ZCO (this problem uses a technique called heavy-light decomposition); all other problems are relevant
- Lowest common ancestor
- The CSES ‘Tree Algorithms’ section has relevant problems
- Binary lifting: some parts of this article overlap with the video above, you should ideally watch both the video and read this article!
- Heavy-light-decomposition: [todo: make good resource]
- Coordinate compression: [todo: make good resource]
- Bit manipulation: [todo: make good resource]