Codeforces Playbook¶
Track Snapshot¶
Codeforces rewards fast shipping, compact modeling, and disciplined post-round upsolving.
Unlike USACO, IOI / OI, or ICPC, this track is not one single fixed contest format.
Common current shapes include:
Div. 2: about2 hours, usually5-6problemsEducational/ manyDiv. 3andDiv. 4rounds: extendedICPCscoring with10minute penalties and an open-hack phase afterward- special rounds that may explicitly use
no hacks, custom scoring, or extra contest-specific rules
So the first Codeforces habit is not “assume the platform always behaves one way.”
It is:
- read the round announcement
- check whether the round has hacks or not
- check whether interactive tasks may appear
- and recheck the current AI rule before the contest
Who This Is For¶
Use this page if:
- you already solve some core topics, but short rounds still feel noisy
- your main misses come from shipping too slowly, weak anti-hack discipline, or chaotic upsolving
- you want a repeatable route for
before / during / aftera Codeforces round instead of improvising every time
Do not use this page as your first exposure to contest programming.
Go back first if:
- your compile / run / debug loop is still shaky
- you still miss too many banker problems because of syntax or indexing mistakes
- most misses come from missing the topic entirely rather than from round execution
What To Optimize¶
The highest-payoff Codeforces skills are:
short-round shippingstatement compression into one clean primitiveanti-hack and rejudge awarenessvalidator-first discipline on constructive or many-answer taskspost-round upsolve quality
The key mentality shift is:
- do not ask only “what is the hardest idea I can find?”
- ask “what can I ship cleanly in this format, and what can survive rejudge or hacks?”
Repo Route¶
| Layer | Best doors | Why |
|---|---|---|
| Topics | Constructive, Prefix Constraints, Binary Search, Sorting, 2-SAT | CF short rounds often reward quick reframing, feasibility checks, and one compact primitive more than broad theorem-hunting |
| Ladders | Constructive ladder, Greedy ladders, Foundations ladders, 2-SAT ladder | best route when one round exposes one narrow family that should become routine |
| Mixed rounds | Codeforces Short Round 01, Contest Core Switching 01 | best current repo drills for short-round shipping and banker-first pacing |
| Anchor notes | Build the Permutation, Prefix Sum Addicts, Giant Pizza | compact, high-signal notes that mirror common CF transforms: construction, feasibility, late-slot graph modeling |
| Notebook | Contest Checklist, Anti-Hack Workflow, Foundations cheatsheet | best retrieval layer when the issue is not theory depth but round execution discipline |
| Workflow | Stress Testing Workflow, Special Judge / Output Protocol Workflow, Local Judge Workflow, Anti-Hack Workflow | the right loop depends on whether the risk is raw correctness, predicate-checked output, interactive protocol, or hack sensitivity |
| Templates | Template Library, contest-main.cpp, fast-io.cpp |
the Codeforces default should still be a small, trusted kit rather than a giant contest blob |
Training Rhythm¶
A strong weekly Codeforces rhythm usually looks like:
- one live or simulated
short-roundblock - one
upsolve worksheetpass on that block - one
anti-hack / validator-firstsession on the leakiest missed problem - one focused
topic reinforcementblock for the weakest family exposed by the round
The default loop should be:
- round first
- then diagnosis
- then one exact reinforcement
not:
- random editorial binge
- then no behavior change next round
Before A Contest¶
Default checklist:
- read the specific round announcement
- check:
- duration
- scoring shape
- whether hacks exist
- whether interactive tasks may appear
- whether any special rules or AI wording were repeated there
- warm up on one banker-style implementation, not one hard puzzle
- keep retrieval small:
- one cheatsheet
- one workflow page
- one or two topic families only
- decide your default policy for the round:
ship firsthack later only if EV is real
Exact Drill Doors¶
- Start here: Codeforces Short Round 01
- Pair it with: Codeforces Upsolve Worksheet
- If constructive or many-valid-answers tasks keep leaking: Codeforces Constructive / Validator-First Clinic 01
- If medium implementation slots keep leaking: Codeforces Implementation Clinic 01
- If the main fear is hacks or rejudge fragility: Anti-Hack Workflow
- If interactive tasks keep leaking to flush, budget, or transcript discipline: Interactive Protocol Clinic 01
Treat the short round as the executable session, the worksheet as the review artifact, and the clinics as targeted repair loops.
During A Contest¶
Opening 10 Minutes¶
Read all problems quickly and classify each as:
ship nowone idea awaypark
Then choose:
- the safest first solve
- and the safest second solve
Many Codeforces losses start when contestants spend the first 25-35 minutes admiring a future slot instead of shipping an actual current one.
Shipping Rule¶
Default rule:
- bank the clean points first
- keep accepted-looking code stable
- and only reopen a “finished” slot when the EV is clearly better than the next solve
This is especially important in short rounds where one extra shipped task often matters more than one almost-solved late slot.
Hack / Rejudge Rule¶
If the round has an open-hack phase or post-round rejudge dynamics:
- remember that pretests are not the finish line
- run one short anti-hack pass after the solution looks done
- look for:
- smallest legal case
- all-equal / duplicate-heavy case
- parity or count boundary
- “already sorted / reverse sorted / one bad block”
- impossible case hidden by optimistic assumptions
- overflow or type-width edge
If another clean solve is available, do not spend large chunks of live contest time guessing hacks blindly.
Use hack time only when you have:
- a precise vulnerable assumption
- or a concrete failing family to test
Constructive / Many-Valid-Answers Rule¶
On constructive or multi-answer tasks, do not compare against one reference output and feel done.
Instead:
- write the output contract first
- write the smallest local validator or predicate check you can
- only then trust your construction
This is why the repo pairs Codeforces constructive work with:
Interactive Rule¶
If the round announcement says an interactive problem may appear:
- reopen the official guide before the round if you are rusty
- treat flushing, transcript discipline, and query counts as first-class constraints
- route live repairs through Interactive Protocol Clinic 01 plus Local Judge Workflow if the harness is not already trustworthy
Do not rely on memory fragments from one old interactive problem.
Late Round Rule¶
In the last 20-30 minutes:
- prefer one stable extra solve over one theatrical new investment
- if the round has hacks, only switch into hack mode when the next solve really looks dead
- leave one-line restart notes before abandoning a parked problem
After A Contest¶
Default review loop:
- fill Codeforces Upsolve Worksheet
- classify each miss by its first real leak:
- reading
- model
- implementation
- anti-hack / rejudge
- proof / correctness
- time allocation
- finish the closest missed problem first
- then do one editorial reconstruction for the hardest meaningful miss
- end with one durable system patch:
- notebook reminder
- workflow change
- one new edge-family check
- one new topic revisit
If your post-round review ends with “I should get stronger,” it is too vague.
Common Failure Modes¶
- treating all Codeforces rounds as if they share one exact ruleset
- shipping code that passes samples but has never seen one adversarial edge-family pass
- using hacks as an excuse to avoid solving
- comparing one constructive output against one reference answer instead of validating the actual contract
- reading editorials too early and learning the final idea without diagnosing the first personal leak
- doing no clean upsolve classification, so the next short round repeats the same failure
Failure -> Next Repo Door¶
| Failure | Reopen |
|---|---|
| got hacked or fear rejudge on “accepted-looking” code | Anti-Hack Workflow |
| constructive or many-answer task kept leaking | Codeforces Constructive / Validator-First Clinic 01, Constructive, and Special Judge / Output Protocol Workflow |
| interactive task kept leaking to flush, budget, transcript, or stop-condition mistakes | Interactive Protocol Clinic 01 and Local Judge Workflow |
| medium implementation slots keep leaking | Codeforces Implementation Clinic 01 and Stress Testing Workflow |
| can solve after the round but not inside it | Codeforces Short Round 01 and Contest Engineering |
| the missed family is genuinely weak | the corresponding ladder in Ladders, then come back through the worksheet |
Progress Markers¶
You are using this playbook well when:
- you can tag the set quickly and name the first two likely ships without drama
- your first accepted solution arrives earlier and more reliably than before
- hack-sensitive tasks now get one real adversarial pass before you trust them
- your upsolve notes separate
model,implementation, andanti-hackmisses instead of lumping them together - the next round changes because of one concrete system patch from the last one
Move back to core ladders if:
- most misses are still plain topic-recognition misses
- your banker problems still die mostly to syntax or local workflow issues
- every “round skill” diagnosis is really a missing family underneath
References And Repo Anchors¶
Research sweep refreshed on 2026-04-24.
Official / primary:
- Codeforces Contest Rules
- Rule Restricting the Use of AI [revision 2024-09-14]
- Interactive Problems: Guide for Participants
- Educational Codeforces Round 188 announcement
- Codeforces Round 1090 (Div. 4) announcement
Repo anchors: