Skip to content

rajshekharbind/Competitive-Programming-Math

Repository files navigation

📘 Competitive Programming Math Roadmap

A structured guide to mastering mathematics for Competitive Programming (CP), Interviews, and Problem Solving.


🎯 Goal

Build strong mathematical intuition step-by-step:

  • 🟢 Beginner → Core fundamentals
  • 🟡 Intermediate → Interview-level mastery
  • 🔴 Advanced → Competitive programming excellence

🟢 BASIC MATH TOPICS (Foundation)

🔹 1. Basic Arithmetic & Properties

  • Prime numbers (Check Prime) ⭐
  • Factors / Divisors of a number
  • GCD (Euclidean Algorithm) ⭐⭐⭐
  • LCM using GCD
  • Even / Odd properties

🔹 2. Modular Arithmetic (Intro)

  • Modulo properties:

    • (a + b) % m
    • (a * b) % m ⭐⭐⭐
  • Handling overflow using modulo

  • Basic modular addition & multiplication

🔹 3. Exponentiation

  • Fast Exponentiation (Binary Exponentiation) ⭐⭐⭐
  • Power with modulo

🔹 4. Counting Basics

  • Factorial
  • Permutations (nPr)
  • Combinations (Basic nCr)

🔹 5. Simple Problem Types

  • Sum of digits
  • Reverse number
  • Palindrome number

👉 Goal: Build strong intuition and speed


🟡 MEDIUM MATH TOPICS (Interview Level)

🔹 1. Prime & Sieve ⭐⭐⭐

  • Sieve of Eratosthenes ⭐⭐⭐
  • Prime factorization
  • Smallest Prime Factor (SPF)

🔹 2. Modular Arithmetic (Advanced) ⭐⭐⭐

  • Modular inverse
  • Fermat’s Little Theorem ⭐⭐⭐
  • Modular division
  • Efficient nCr % MOD

🔹 3. Combinatorics ⭐⭐⭐

  • Pascal’s Triangle
  • Counting ways problems
  • Inclusion-Exclusion Principle ⭐⭐⭐

🔹 4. GCD-Based Problems

  • Extended Euclidean Algorithm ⭐⭐
  • Linear Diophantine Equations

🔹 5. Number Properties

  • Perfect numbers
  • Armstrong numbers
  • Trailing zeros in factorial ⭐⭐

🔹 6. Matrix Basics

  • Matrix multiplication
  • Matrix exponentiation (intro) ⭐⭐⭐

👉 Goal: Solve OA + interview-level problems efficiently


🔴 HARD MATH TOPICS (Advanced / CP Level)

🔸 1. Advanced Number Theory ⭐⭐⭐

  • Euler’s Totient Function φ(n) ⭐⭐⭐
  • Euler’s Theorem
  • Chinese Remainder Theorem ⭐⭐⭐
  • Wilson’s Theorem

🔸 2. Advanced Modular Arithmetic

  • Modular exponentiation (large numbers)
  • Lucas Theorem ⭐⭐⭐
  • Fast nCr for large N

🔸 3. Advanced Combinatorics ⭐⭐⭐

  • Stars and Bars ⭐⭐⭐
  • Catalan Numbers ⭐⭐⭐
  • Derangements

🔸 4. Matrix Exponentiation ⭐⭐⭐

  • Solve recurrence relations
  • Fibonacci in O(log N)

🔸 5. Probability & Expected Value ⭐⭐⭐

  • Basic probability in CP
  • Expected value problems

🔸 6. Game Theory ⭐⭐⭐

  • Grundy Numbers
  • Nim Game

🔸 7. Advanced Techniques

  • FFT (Fast Fourier Transform) ⭐⭐⭐
  • Polynomial multiplication

👉 Goal: Crack competitive programming contests & advanced interviews


🚀 How to Use This Roadmap

  1. Start from Basic Topics and ensure strong fundamentals.
  2. Move to Medium Topics for interview preparation.
  3. Practice Hard Topics for CP contests (Codeforces, AtCoder).
  4. Solve problems daily and revise regularly.

💡 Tips

  • Focus on understanding, not memorization
  • Practice problems after each topic
  • Maintain your own notes
  • Revisit weak areas regularly

📂 Suggested Repository Names

Here are some unique and meaningful repo name ideas:

  • CP-Math-Roadmap
  • Math-for-Competitive-Programming
  • CP-Math-Mastery
  • NumberTheory-Playbook
  • CP-Math-Guide
  • AlgoMath-Notebook
  • MathPrep-CP
  • Competitive-Math-Journey
  • CP-Math-Handbook
  • MathToolkit-CP

⭐ Final Note

Consistency + Practice = Mastery

Happy Coding 🚀