Codeforces Survival Guide
From LeetCode to Codeforces
You’ve grinded LeetCode. You understand algorithms. But Codeforces? It’s a different beast. This guide will help you survive and thrive.Understanding the Rating System
Rating Colors & Titles
| Rating | Title | Color | What It Means |
|---|---|---|---|
| 0-1199 | Newbie | Gray | Just starting out |
| 1200-1399 | Pupil | Green | Understand basics |
| 1400-1599 | Specialist | Cyan | Solid fundamentals |
| 1600-1899 | Expert | Blue | Strong problem solver |
| 1900-2099 | Candidate Master | Violet | Very strong |
| 2100-2299 | Master | Orange | Top competitor |
| 2300-2399 | International Master | Orange | Elite |
| 2400-2599 | Grandmaster | Red | World class |
| 2600-2999 | International Grandmaster | Red | Legend |
| 3000+ | Legendary Grandmaster | Black/Red | Mythical |
Rating Changes
Contest Types
Division 4 (Div 4)
- Who: Rated < 1400
- Difficulty: A (800) to G (1400)
- Duration: 2 hours, 7-8 problems
- Strategy: Solve A-E quickly, attempt F-G
- Best for: Complete beginners, first-time CF users, building confidence
- Frequency: Every 4-6 months (less frequent than Div 2/3)
Division 3 (Div 3)
- Who: Rated < 1600
- Difficulty: A (800) to F (1600)
- Duration: 2 hours, 6-7 problems
- Strategy: Solve A-D quickly, attempt E-F
- Best for: Beginners who are comfortable with basics
Division 2 (Div 2)
- Who: Rated < 2100
- Difficulty: A (800-1000) to E/F (2000+)
- Duration: 2 hours, 5-6 problems
- Strategy: Solve A-C, attempt D
- Best for: Reaching Specialist/Expert
Division 1+2 (Combined)
- Who: Everyone is rated (no rating cutoff)
- Difficulty: A (1000-1200) to F/G (2400+)
- Duration: 2-2.5 hours, 6-7 problems
- Strategy: Same problems for all participants
- Best for: Intermediate difficulty between Div 2 and Div 1
- Note: A-B problems are harder than typical Div 2 A-B
Division 1 (Div 1)
- Who: Rated ≥ 1900
- Difficulty: Starts at ~1700
- Best for: Expert+ grinders
Educational Rounds
- Rated: For all < 2100
- Special: 12-hour hacking phase after
- Format: Similar to Div 2
Global Rounds
- Who: Everyone rated
- Difficulty: Wide range
- Duration: Usually 2.5-3 hours
The Contest Interface
Before Contest
During Contest
Verdict Meanings
| Verdict | Meaning | What to Do |
|---|---|---|
| AC | Accepted (pretests) | Wait for system test |
| WA | Wrong Answer | Check logic, edge cases |
| TLE | Time Limit Exceeded | Optimize algorithm |
| MLE | Memory Limit Exceeded | Use less memory |
| RE | Runtime Error | Array bounds, division by zero |
| CE | Compilation Error | Syntax error |
Reading CF Problems
Anatomy of a CF Problem
How to Read (The Right Way)
1
Skim the Story (10 seconds)
Most CF problems have elaborate stories. Skim for keywords.
2
Read Constraints FIRST (30 seconds)
This tells you what complexity is acceptable.
- n ≤ 100 → O(n³) OK
- n ≤ 10⁵ → Need O(n log n) or O(n)
- n ≤ 10⁶ → Must be O(n)
3
Read Problem Statement (1-2 minutes)
Understand what you need to compute/output.
4
Study Examples (1 minute)
Trace through by hand. Read the Note section!
5
Check Edge Cases
What if n=1? What if all elements are same?
Input/Output Differences from LeetCode
LeetCode Style
Codeforces Style
Multiple Test Cases
Most CF problems have multiple test cases!Common CF Input Patterns
Pattern 1: Single Line of Numbers
Pattern 2: Matrix/Grid
Pattern 3: String Grid
Pattern 4: Graph Edges
Pattern 5: Queries
Output Patterns
YES/NO Questions
Impossible Cases
Floating Point
Multiple Values
Debugging on Codeforces
Using Custom Test
- After submitting (or before), go to problem page
- Scroll down to “Custom Test”
- Enter your test case
- Run and see output
Creating Test Cases
When you get WA, try:- Edge cases: n=1, n=2, all same, all different
- Boundary values: Maximum n, minimum values
- Special patterns: Sorted, reverse sorted, alternating
Stress Testing
Compare your solution with a brute force on random inputs:Your First Week Checklist
1
Create Account
Register at codeforces.com
2
Set Up Environment
Install VS Code + extensions + template
3
Solve 10 Problems Rated 800
Get comfortable with the format
4
Do a Virtual Contest
Go to Contests → Pick a past contest → Click “Virtual Participation” on the right sidebar
5
Participate in Live Contest
Register for next Div 3 or Div 4
6
Upsolve
Solve problems you couldn’t during contest
Essential Links
| Resource | Purpose |
|---|---|
| Problemset | Filter by rating/tags |
| Gym | Practice contests |
| EDU Section | Interactive courses |
| Blog | Editorials, discussions |
| CSES | Structured problem set |
Key Takeaways
Read Constraints First
Constraints tell you what algorithm to use.
Handle Test Cases
Most problems have multiple test cases.
Use Fast I/O
Always use sync_with_stdio(false).
Upsolve Everything
Learning happens after the contest.
Next Up
Fast I/O & Templates
Set up your competitive programming template.