> ## Documentation Index
> Fetch the complete documentation index at: https://resources.devweekends.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 8-Week Roadmap to Specialist

> A structured 8-week plan to go from LeetCode solver to Codeforces Specialist (1400+)

# 8-Week Roadmap: LeetCode to CF Specialist

<img src="https://mintcdn.com/devweeekends/AEOaWh79Ur7CdHHv/images/courses/cp/8-week-roadmap.svg?fit=max&auto=format&n=AEOaWh79Ur7CdHHv&q=85&s=73287cee34d5b0f56b67988338068e96" alt="8-Week Roadmap to Specialist" width="1080" height="1080" data-path="images/courses/cp/8-week-roadmap.svg" />

## Who This Is For

You've solved LeetCode problems. You understand basic DSA. But Codeforces feels like a different universe—weird I/O, tight time limits, cryptic problem statements, and ratings that make no sense.

**This roadmap bridges that gap.**

<Note>
  **Goal**: Reach **Specialist (1400+)** in 8 weeks, then **Expert (1600+)** in 3 more weeks.

  **Prerequisites**:

  * Solved 100+ LeetCode problems (Easy/Medium)
  * Know basic data structures (arrays, stacks, queues, trees)
  * Understand Big O notation
  * Can code in C++ (or willing to switch)
</Note>

***

## The LeetCode → Codeforces Gap

| Aspect             | LeetCode                 | Codeforces                           |
| ------------------ | ------------------------ | ------------------------------------ |
| **I/O**            | Function signature given | Read from stdin, print to stdout     |
| **Time Limit**     | Generous (often 1-2s)    | Tight (1-2s for 10^6 operations)     |
| **Problem Style**  | Clear, structured        | Story-based, need to extract problem |
| **Test Cases**     | Run before submit        | Pretests only, system tests after    |
| **Edge Cases**     | Often handled            | Will fail you brutally               |
| **Speed**          | Accuracy matters         | Speed + Accuracy both matter         |
| **Multiple Tests** | Usually single           | Often T test cases in one run        |

***

## Week-by-Week Breakdown

### Week 1: CF Environment & Speed

<Steps>
  <Step title="Day 1-2: Setup">
    * Set up VS Code with CP extensions
    * Create your template
    * Learn `ios::sync_with_stdio(false)` and `cin.tie(nullptr)`
    * Practice fast I/O patterns

    **Read**: [Environment Setup](/courses/competitive-programming/02a-environment-setup)
  </Step>

  <Step title="Day 3-4: CF Problem Format">
    * Solve 10 problems rated 800
    * Focus on reading problems correctly
    * Get used to multiple test cases
    * Learn to handle edge cases (n=1, empty input)

    **Practice**: [CF 800 Problems](https://codeforces.com/problemset?order=BY_RATING_ASC\&tags=800-800)
  </Step>

  <Step title="Day 5-7: First Virtual Contest">
    * Do 2-3 virtual Div 4 contests (easier than Div 3, perfect for CF beginners)
    * Focus on solving A, B, C, D
    * Time yourself strictly (2 hours)
    * Upsolve everything you couldn't solve
    * Get familiar with CF interface, submission system, and verdicts
  </Step>
</Steps>

**Weekly Target**: 20 problems solved, 2-3 virtual Div 4 contests

**Problems to Target This Week**:

| Problem                                                                | Rating | Focus               |
| ---------------------------------------------------------------------- | ------ | ------------------- |
| [Watermelon](https://codeforces.com/problemset/problem/4/A)            | 800    | Basic logic         |
| [Way Too Long Words](https://codeforces.com/problemset/problem/71/A)   | 800    | Strings             |
| [Team](https://codeforces.com/problemset/problem/231/A)                | 800    | Counting            |
| [Stones on the Table](https://codeforces.com/problemset/problem/266/A) | 800    | Simulation          |
| [Beautiful Matrix](https://codeforces.com/problemset/problem/263/A)    | 800    | 2D arrays           |
| [Domino piling](https://codeforces.com/problemset/problem/50/A)        | 800    | Math basics         |
| [Next Round](https://codeforces.com/problemset/problem/158/A)          | 800    | Counting            |
| [Boy or Girl](https://codeforces.com/problemset/problem/236/A)         | 800    | Strings             |
| [Word](https://codeforces.com/problemset/problem/59/A)                 | 800    | String manipulation |
| [String Task](https://codeforces.com/problemset/problem/118/A)         | 800    | Strings             |

***

### Week 2: Implementation, Simulation & Basic Bitwise

<Steps>
  <Step title="Day 1-2: Implementation Fundamentals">
    * String manipulation
    * Array operations
    * Simulation problems
    * Following instructions precisely

    **Read**: [Fast I/O & Templates](/courses/competitive-programming/02-fast-io)
  </Step>

  <Step title="Day 3-4: Common Patterns">
    * Frequency counting with maps
    * Finding min/max
    * Working with pairs
    * Coordinate problems
  </Step>

  <Step title="Day 5-6: Basic Bitwise Operations">
    * Understanding AND, OR, XOR
    * Checking if a number is odd/even using `&`
    * Bit shifting basics (`<<`, `>>`)
    * Checking/Setting specific bits
    * XOR properties (a ^ a = 0, a ^ 0 = a)

    **Read**: [Bit Manipulation](/courses/competitive-programming/19-bit-manipulation)
  </Step>

  <Step title="Day 7: Practice + Contest">
    * 1-2 virtual Div 3 contests (step up from Div 4)
    * Focus on solving A, B, C problems
    * Upsolve all problems you couldn't solve
  </Step>
</Steps>

**Weekly Target**: 25 problems (800-1000), 1-2 virtual Div 3 contests

**Concept-Focused Problems**:

| Problem                                                                    | Rating | Concept              |
| -------------------------------------------------------------------------- | ------ | -------------------- |
| [Translation](https://codeforces.com/problemset/problem/41/A)              | 800    | String reversal      |
| [Football](https://codeforces.com/problemset/problem/96/A)                 | 900    | Consecutive counting |
| [Die Roll](https://codeforces.com/problemset/problem/9/A)                  | 800    | Probability/counting |
| [Gravity Flip](https://codeforces.com/problemset/problem/405/A)            | 900    | Simulation + Sorting |
| [Bit++](https://codeforces.com/problemset/problem/282/A)                   | 800    | Simulation           |
| [Vanya and Fence](https://codeforces.com/problemset/problem/677/A)         | 800    | Conditional counting |
| [Lucky Division](https://codeforces.com/problemset/problem/122/A)          | 1000   | Divisibility         |
| [Even Odds](https://codeforces.com/problemset/problem/318/A)               | 900    | Math pattern/parity  |
| [Ultra-Fast Mathematician](https://codeforces.com/problemset/problem/61/A) | 800    | XOR basics           |
| [Wizard of Orz](https://codeforces.com/problemset/problem/1467/A)          | 900    | Pattern recognition  |

***

### Week 3: Math & Number Theory Basics

<Steps>
  <Step title="Day 1-2: Divisibility & GCD">
    * Divisibility rules
    * GCD/LCM calculations
    * Prime checking
    * Factor counting
  </Step>

  <Step title="Day 3-4: Modular Arithmetic">
    * Why we use MOD = 10^9 + 7
    * Modular addition, subtraction, multiplication
    * Avoiding overflow
    * Power function with mod
  </Step>

  <Step title="Day 5-7: Practice">
    * Solve 15 math-tagged problems (800-1000)
    * 1 virtual contest
    * Focus on problems with "math" or "number theory" tags
  </Step>
</Steps>

**Weekly Target**: 20 problems (800-1000), understand mod arithmetic

**Key Problems**:

| Problem                                                                | Rating | Concept           |
| ---------------------------------------------------------------------- | ------ | ----------------- |
| [Nearly Lucky Number](https://codeforces.com/problemset/problem/110/A) | 800    | Digit counting    |
| [Anton and Danik](https://codeforces.com/problemset/problem/734/A)     | 800    | Counting          |
| [Insomnia cure](https://codeforces.com/problemset/problem/148/A)       | 800    | Divisibility      |
| [Even Odds](https://codeforces.com/problemset/problem/318/A)           | 900    | Math pattern      |
| [Petya and Strings](https://codeforces.com/problemset/problem/112/A)   | 800    | String comparison |

***

### Week 4: Sorting & Greedy

<Steps>
  <Step title="Day 1-2: Sorting Techniques">
    * Custom comparators
    * Sorting pairs/tuples
    * Sorting with indices
    * Coordinate compression

    **Read**: [Sorting Strategies](/courses/competitive-programming/07-sorting)
  </Step>

  <Step title="Day 3-5: Greedy Algorithms">
    * When greedy works
    * Exchange argument
    * Interval scheduling
    * Greedy + sorting combo

    **Read**: [Greedy Algorithms](/courses/competitive-programming/09-greedy)
  </Step>

  <Step title="Day 6-7: Contest + Upsolve">
    * 1 virtual Div 2 contest (attempt A, B, C)
    * Upsolve aggressively
  </Step>
</Steps>

**Weekly Target**: 20 problems (900-1100), master greedy intuition

**Key Problems**:

| Problem                                                                 | Rating | Concept             |
| ----------------------------------------------------------------------- | ------ | ------------------- |
| [Helpful Maths](https://codeforces.com/problemset/problem/339/A)        | 800    | Sorting basics      |
| [Presents](https://codeforces.com/problemset/problem/136/A)             | 800    | Inverse permutation |
| [Queue at the School](https://codeforces.com/problemset/problem/266/B)  | 900    | Simulation          |
| [Bear and Big Brother](https://codeforces.com/problemset/problem/791/A) | 800    | Simulation/Math     |
| [Array](https://codeforces.com/problemset/problem/300/A)                | 900    | Sorting + Greedy    |

***

### Week 5: Binary Search & Two Pointers

<Steps>
  <Step title="Day 1-2: Binary Search Fundamentals">
    * Binary search on sorted array
    * Lower bound, upper bound
    * Binary search on answer

    **Read**: [Binary Search](/courses/competitive-programming/06-binary-search)
  </Step>

  <Step title="Day 3-4: Two Pointers">
    * Two pointers on sorted arrays
    * Sliding window
    * Subarray problems

    **Read**: [Two Pointers](/courses/competitive-programming/05-two-pointers)
  </Step>

  <Step title="Day 5-7: Prefix Sums">
    * 1D prefix sum
    * Difference arrays
    * Range sum queries

    **Read**: [Prefix Sum](/courses/competitive-programming/04-prefix-sum)
  </Step>
</Steps>

**Weekly Target**: 20 problems (1000-1200), 2 virtual contests

**Key Problems**:

| Problem                                                                             | Rating | Concept       |
| ----------------------------------------------------------------------------------- | ------ | ------------- |
| [Worms](https://codeforces.com/problemset/problem/474/B)                            | 1200   | Binary Search |
| [Books](https://codeforces.com/problemset/problem/279/B)                            | 1400   | Two Pointers  |
| [Number of Segments with Big Sum](https://codeforces.com/problemset/problem/1118/B) | 1100   | Two Pointers  |
| [Frog Jumps](https://codeforces.com/problemset/problem/1324/C)                      | 1100   | Binary Search |
| [Yet Another Counting Problem](https://codeforces.com/problemset/problem/1342/C)    | 1300   | Prefix Sum    |

***

### Week 6: Graphs Basics

<Steps>
  <Step title="Day 1-2: Graph Representation">
    * Adjacency list
    * Reading graph input
    * Directed vs undirected

    **Read**: [Graph Fundamentals](/courses/competitive-programming/13-graph-fundamentals)
  </Step>

  <Step title="Day 3-4: DFS & BFS">
    * DFS for connectivity
    * BFS for shortest path (unweighted)
    * Connected components
    * Cycle detection
  </Step>

  <Step title="Day 5-7: Grid Graphs">
    * BFS on grids
    * Flood fill
    * 4-directional vs 8-directional
    * Practice + contest
  </Step>
</Steps>

**Weekly Target**: 15 graph problems (1000-1300), solid DFS/BFS skills

**Key Problems**:

| Problem                                                             | Rating | Concept    |
| ------------------------------------------------------------------- | ------ | ---------- |
| [Counting Rooms](https://cses.fi/problemset/task/1192)              | \~1200 | Flood Fill |
| [Labyrinth](https://cses.fi/problemset/task/1193)                   | \~1300 | BFS Path   |
| [Building Roads](https://cses.fi/problemset/task/1666)              | \~1200 | Components |
| [King Escape](https://codeforces.com/problemset/problem/1033/A)     | 1000   | Grid BFS   |
| [Lakes in Berland](https://codeforces.com/problemset/problem/723/D) | 1600   | Flood Fill |

***

### Week 7: Dynamic Programming Introduction

<Steps>
  <Step title="Day 1-2: DP Fundamentals">
    * What is DP? (Memoization vs Tabulation)
    * State and transition
    * Classic problems: Fibonacci, Climbing Stairs

    **Read**: [DP Fundamentals](/courses/competitive-programming/11-dp-fundamentals)
  </Step>

  <Step title="Day 3-4: 1D DP Patterns">
    * Coin change
    * LIS (Longest Increasing Subsequence)
    * Subset sum
    * Unbounded knapsack
  </Step>

  <Step title="Day 5-7: Practice DP">
    * Solve 10 DP problems from CSES/AtCoder
    * Focus on state design
    * 1 virtual contest
  </Step>
</Steps>

**Weekly Target**: 15 DP problems, understand state design

**Key Problems**:

| Problem                                                     | Rating | Concept     |
| ----------------------------------------------------------- | ------ | ----------- |
| [Dice Combinations](https://cses.fi/problemset/task/1633)   | \~1200 | 1D DP       |
| [Minimizing Coins](https://cses.fi/problemset/task/1634)    | \~1300 | Coin Change |
| [Coin Combinations I](https://cses.fi/problemset/task/1635) | \~1300 | Counting    |
| [Boredom](https://codeforces.com/problemset/problem/455/A)  | 1500   | DP          |
| [Vacation](https://atcoder.jp/contests/dp/tasks/dp_c)       | \~1300 | 2D DP       |

***

### Week 8: Contest Strategy & Consolidation

<Steps>
  <Step title="Day 1-2: Contest Strategy">
    * Time management
    * When to skip problems
    * Reading problems effectively
    * Handling pressure

    **Read**: [Contest Strategy](/courses/competitive-programming/20-contest-strategy)
  </Step>

  <Step title="Day 3-4: Common Mistake Review">
    * Review all WA/TLE submissions
    * Create personal mistake log
    * Identify patterns in your errors
  </Step>

  <Step title="Day 5-7: Contest Blitz">
    * 3 virtual Div 2 contests
    * Aim for A, B, C solved
    * Upsolve D problems
    * Participate in 1 live contest
  </Step>
</Steps>

**Weekly Target**: 3 virtual contests, 1 live contest, review all mistakes

***

## Week 9-11: Road to Expert (+3 Weeks)

### Week 9: Advanced DP & Trees

| Day | Focus                | Problems                                                              |
| --- | -------------------- | --------------------------------------------------------------------- |
| 1-2 | 2D DP, Grid DP       | [DP on Grids](/courses/competitive-programming/12-dp-grids-intervals) |
| 3-4 | Tree basics, Tree DP | [Trees](/courses/competitive-programming/15-trees)                    |
| 5-7 | Practice + Contest   | 2 virtual contests                                                    |

### Week 10: Data Structures

| Day | Focus               | Problems                                                           |
| --- | ------------------- | ------------------------------------------------------------------ |
| 1-2 | DSU (Union-Find)    | [DSU](/courses/competitive-programming/16-dsu)                     |
| 3-4 | Segment Tree basics | [Segment Trees](/courses/competitive-programming/17-segment-trees) |
| 5-7 | Practice + Contest  | Focus on 1400-1600 problems                                        |

### Week 11: Advanced Topics & Expert Push

| Day | Focus            | Problems                                                                 |
| --- | ---------------- | ------------------------------------------------------------------------ |
| 1-2 | Bit manipulation | [Bit Manipulation](/courses/competitive-programming/19-bit-manipulation) |
| 3-4 | String basics    | [Strings](/courses/competitive-programming/18-strings)                   |
| 5-7 | Contest marathon | 3 virtual contests, 1-2 live contests                                    |

***

## Daily Schedule Template

```
┌─────────────────────────────────────────────────────┐
│           IDEAL CP DAY (2-3 hours)                  │
├─────────────────────────────────────────────────────┤
│  0:00 - 0:30   Upsolve yesterday's problems         │
│  0:30 - 1:30   Solve 2-3 new problems               │
│  1:30 - 2:00   Read editorial for any you couldn't  │
│  2:00 - 2:30   Review and add to notes              │
│  (Weekend)     Virtual contest + full upsolve       │
└─────────────────────────────────────────────────────┘
```

***

## Progress Tracking

### Rating Milestones

| Week | Expected Rating | Problems Solved | Key Skill              |
| ---- | --------------- | --------------- | ---------------------- |
| 1    | 800-900         | 20              | CF format comfortable  |
| 2    | 900-1000        | 45              | Implementation solid   |
| 3    | 1000-1100       | 65              | Math basics done       |
| 4    | 1100-1200       | 85              | Greedy intuition       |
| 5    | 1150-1250       | 105             | Binary search mastered |
| 6    | 1200-1300       | 120             | Graphs basics          |
| 7    | 1250-1350       | 135             | DP started             |
| 8    | 1300-1400       | 150             | **Specialist!**        |
| 11   | 1500-1600       | 200             | **Expert!**            |

### Self-Assessment Checklist

After 8 weeks, you should be able to:

* [ ] Solve CF Div2 A in under 5 minutes
* [ ] Solve CF Div2 B in under 15 minutes
* [ ] Attempt CF Div2 C with reasonable approach
* [ ] Write fast I/O template from memory
* [ ] Implement DFS/BFS without looking up
* [ ] Recognize greedy vs DP problems
* [ ] Debug using stress testing
* [ ] Read problems carefully (no silly WAs)

***

## Common Pitfalls to Avoid

<Warning>
  **Week 1-2 Mistakes**:

  * Not reading problems fully (missing constraints)
  * Forgetting `long long` for large numbers
  * Not handling multiple test cases properly
  * Submitting without testing edge cases
</Warning>

<Warning>
  **Week 3-4 Mistakes**:

  * Overcomplicating greedy problems
  * Not proving greedy approach works
  * Integer overflow in math problems
  * Off-by-one errors in loops
</Warning>

<Warning>
  **Week 5-8 Mistakes**:

  * Using wrong binary search variant
  * Infinite loops in binary search
  * Not initializing graph arrays
  * DP state design too complex
</Warning>

***

## Resources for Each Week

| Week | Primary Resource     | Backup Resource      |
| ---- | -------------------- | -------------------- |
| 1    | This course + CF 800 | USACO Guide          |
| 2    | CF 800-900 problems  | AtCoder Beginner     |
| 3    | CF Math problems     | CSES Math section    |
| 4    | CF Greedy + Sorting  | CSES Sorting         |
| 5    | CSES Searching       | CF Binary Search tag |
| 6    | CSES Graph           | CF DFS/BFS tag       |
| 7    | AtCoder DP Contest   | CSES DP section      |
| 8    | Virtual contests     | Past Div 2 rounds    |

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Set Up Your Environment" icon="gear" href="/courses/competitive-programming/02a-environment-setup">
    Configure VS Code and create your template before starting.
  </Card>

  <Card title="Understand CF Format" icon="circle-info" href="/courses/competitive-programming/01b-cf-guide">
    Learn how Codeforces works before your first contest.
  </Card>
</CardGroup>
