Skip to content

About

Codeforces Problems Solutions

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

153 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ† Codeforces Problems Solutions

A comprehensive collection of solved Codeforces problems with detailed explanations and optimized solutions. Level up your competitive programming skills!

Problems Solved Languages Last Updated License: MIT

πŸ“š About

This repository contains solutions to 250+ Codeforces problems organized by difficulty level and topic. Each solution includes the problem statement, approach explanation, and optimized code with time/space complexity analysis.

Whether you're preparing for competitive programming contests or sharpening your problem-solving skills, this collection serves as a learning resource and quick reference.

Why This Repo?

  • 🎯 Well-Organized: Sorted by difficulty (A-F) and topics
  • πŸ“– Detailed Explanations: Understand the approach, not just the code
  • ⚑ Optimized Solutions: Focus on efficiency and clean code
  • πŸ§ͺ Tested & Verified: All solutions accepted on Codeforces
  • πŸ“Š Progress Tracking: See your improvement journey

πŸ“‚ Repository Structure

Codeforces/
β”œβ”€β”€ A_Div2/               # Division 2, Level A (Easiest)
β”‚   β”œβ”€β”€ problem-1.cpp
β”‚   β”œβ”€β”€ problem-2.cpp
β”‚   └── ...
β”œβ”€β”€ B_Div2/               # Division 2, Level B
β”‚   β”œβ”€β”€ problem-1.cpp
β”‚   └── ...
β”œβ”€β”€ C_Div2/               # Division 2, Level C
β”œβ”€β”€ D_Div2/               # Division 2, Level D
β”œβ”€β”€ E_Div2/               # Division 2, Level E
β”œβ”€β”€ F_Div2/               # Division 2, Level F (Hardest)
β”œβ”€β”€ A1_Div1/              # Division 1 Problems
β”œβ”€β”€ Topics/               # Organized by Algorithm/Data Structure
β”‚   β”œβ”€β”€ Dynamic_Programming/
β”‚   β”œβ”€β”€ Graph_Theory/
β”‚   β”œβ”€β”€ Greedy/
β”‚   β”œβ”€β”€ Binary_Search/
β”‚   β”œβ”€β”€ Math/
β”‚   └── ...
β”œβ”€β”€ Contests/             # Complete contest solutions
β”‚   β”œβ”€β”€ Codeforces_Round_XXX/
β”‚   └── ...
└── README.md

πŸš€ Quick Navigation

By Difficulty

Level Count Status
A 45+ βœ… Completed
B 60+ βœ… Completed
C 85+ βœ… Completed
D 40+ βœ… Completed
E 15+ πŸ”„ In Progress
F 10+ πŸ”„ In Progress

By Topic

πŸ’‘ How to Use This Repository

1. Browse by Difficulty

Start with Division 2 Level A problems if you're new to competitive programming. Progress to harder levels as you improve.

Beginner? Start here β†’ A_Div2/
Intermediate? β†’ C_Div2/ or B_Div2/
Advanced? β†’ D_Div2/ and above

2. Learn by Topic

Jump to the Topics/ folder to find problems organized by algorithm or data structure:

Learning DP? β†’ Topics/Dynamic_Programming/
Graph problems? β†’ Topics/Graph_Theory/

3. Study Solutions

Each file contains:

  • Problem Link: Direct link to the original problem
  • Approach: Step-by-step explanation
  • Code: Optimized, commented solution
  • Complexity: Time and Space analysis

4. Practice Contests

Found in Contests/ folder - complete solutions for full contests to simulate real competition.

πŸ› οΈ Technologies & Languages

Languages Used

  • C++ - Primary language (faster execution, competitive programming standard)
  • Python - Some solutions for clarity and prototyping

Key Concepts Covered

  • Greedy Algorithms
  • Dynamic Programming
  • Graph Theory (DFS, BFS, Dijkstra, etc.)
  • Binary Search & Ternary Search
  • Number Theory & Combinatorics
  • String Algorithms
  • Segment Trees & Fenwick Trees
  • Union-Find (Disjoint Set Union)
  • Two Pointers & Sliding Window
  • And more!

πŸ“ˆ Statistics

Total Problems Solved:    250+
Success Rate:             98%+
Average Solution Time:    ~15 mins
Difficulty Span:          A β†’ F
Languages:                C++, Python
Last Updated:             May 2026

🎯 Getting Started

Prerequisites

  • Basic knowledge of C++ or Python
  • Familiarity with competitive programming
  • A Codeforces account (optional, but recommended)

Viewing Solutions

  1. Browse on GitHub: Click through folders to find problems
  2. Search by Topic: Use the Topics directory for algorithm focus
  3. Check Complexity: Look at the comments for Time/Space analysis

Running Solutions Locally

# For C++ solutions
g++ -o solution solution.cpp
./solution

# For Python solutions
python3 solution.py

πŸ“ Problem Template

Each solution follows this structure:

/*
PROBLEM: [Problem Name]
LINK: https://codeforces.com/problemset/problem/XXX/X
DIFFICULTY: [Level]
TOPIC: [Algorithm/Data Structure]

APPROACH:
- [Key insight 1]
- [Key insight 2]
- [Solution strategy]

TIME COMPLEXITY: O(...)
SPACE COMPLEXITY: O(...)
*/

#include <bits/stdc++.h>
using namespace std;

int main() {
    // Solution code
    return 0;
}

πŸ”— Useful Resources

🀝 Contributing

Want to add more solutions or improve existing ones?

  1. Fork the repository
  2. Create a feature branch (git checkout -b add/problem-XXX)
  3. Add your solution with proper comments and complexity analysis
  4. Follow the template structure
  5. Push and create a Pull Request

Contribution Guidelines

  • Use consistent naming conventions
  • Include problem links and difficulty levels
  • Add time/space complexity comments
  • Keep code clean and readable
  • Test solutions before submitting

πŸ“Š Progress Tracker

Track your journey through this collection:

[β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘] 80% Complete
- Div2 A: βœ… 45/45
- Div2 B: βœ… 60/60
- Div2 C: βœ… 85/85
- Div2 D: βœ… 40/40
- Div2 E: πŸ”„ 12/15
- Div2 F: πŸ”„ 8/10

πŸ’¬ Tips for Success

  1. Understand, Don't Memorize: Read the approach before looking at code
  2. Solve First: Try solving before checking the solution
  3. Time Yourself: Practice under time constraints
  4. Debug Skills: Learn to find issues in your code
  5. Review Regularly: Revisit harder problems periodically
  6. Discuss: Talk through problems with others

πŸ› Issues & Improvements

Found a bug in a solution? Have a better approach?

  • Report Issues: GitHub Issues
  • Suggest Improvements: Create a PR or discussion
  • Ask Questions: Comment on specific problems

πŸ™ Acknowledgments

  • Thanks to Codeforces for the amazing platform and problems
  • Inspired by competitive programmers worldwide
  • Community contributions and feedback

πŸ“ž Connect


Keep practicing, keep improving! πŸš€

Made with πŸ’ͺ by Salma | View on Codeforces

About

Codeforces Problems Solutions

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages