Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Codeforces Beginner Solutions

A collection of my C++ solutions and explanations for Codeforces problems, starting with beginner-level problems and gradually progressing to harder ones.

This repository is primarily a learning resource for people who are beginning competitive programming and want to understand how a solution works, not just copy the code.


What You'll Find Here

Each problem aims to provide:

  • A simple explanation of the problem
  • The key idea or observation
  • An explanation of the algorithm
  • Time and space complexity
  • A C++ solution

The goal is to make each problem understandable even if you're encountering the underlying idea for the first time.


Problems

The solutions are currently focused on Codeforces 800-rated problems.

They are organized primarily by Codeforces contest, so you can easily find problems in the same contest together.

Current Difficulty

Rating Status
800 In Progress
900+ Coming Later

As I progress through competitive programming, this repository will gradually expand to higher difficulty levels.


Repository Structure

codeforces-beginner-solutions/
│
├── 800/
│   ├── Codeforces Beta Round 1/
│   │   └── ...
│   │
│   ├── Codeforces Beta Round 84/
│   │   └── Div 2/
│   │       └── 110A.cpp
│   │
│   └── ...
│
├── .gitignore
└── README.md

The problem ID is kept in the filename whenever possible.

For example:

110A.cpp

means Codeforces Problem 110A — Nearly Lucky Number.


How to Use This Repository

If you're new to Codeforces, I recommend this approach:

1. Find a problem

Browse the folders or search for the Codeforces problem ID.

2. Try it yourself first

Don't immediately look at the solution.

Give yourself some time to understand the problem and develop an approach.

3. Check the explanation

If you're stuck, read the explanation and focus on the idea, not just the implementation.

4. Study the code

Once you understand the approach, look at the C++ implementation.

5. Try again

Close the solution and implement the algorithm yourself.

This is where most of the learning happens.


Topics Covered

As the repository grows, problems will introduce concepts such as:

  • Basic implementation
  • Input and output
  • Conditionals
  • Loops
  • Arrays
  • Strings
  • Sorting
  • Mathematics
  • Greedy algorithms
  • Brute force
  • Digit manipulation
  • Basic number theory
  • Time and space complexity
  • Problem-solving techniques

Contributions

Contributions are welcome!

If you solved one of these problems and think an explanation could be clearer, you're welcome to improve it.

You can contribute things such as:

  • Better explanations
  • Alternative approaches
  • Clearer mathematical reasoning
  • Correct complexity analysis
  • Corrections to mistakes
  • Typo and formatting fixes

You don't have to be an expert to contribute.

If you can explain an idea in a way that makes it easier for another beginner to understand, your contribution can be valuable.

Before contributing

Please read CONTRIBUTING.md for the contribution guidelines.


A Note About the Solutions

These solutions represent my learning process.

They may not always be the shortest, fastest, or most sophisticated solution possible.

If you know a better approach, feel free to explain it through a contribution rather than simply replacing the code.

The purpose of this repository is learning and understanding, not competing for the smallest number of lines.


Goal

The long-term goal is to build a structured collection of Codeforces problems that a beginner can use to gradually develop:

Problem Understanding -> Algorithmic Thinking -> Implementation -> Analysis

rather than simply collecting accepted solutions.


If This Helps You

If you find this repository useful for your own competitive-programming journey, consider giving it a star.

And if you notice something that could be explained better, feel free to contribute!


Happy Coding!