Collection of Codeforces problem solutions (mostly C++). Organized by rounds and individual problem files.
gameOnarray.cpp,incermentalSubarray.cpp,primeGaming.cpp, ... — standalone C++ solutions in the root.educationalRound182/,pinelyRound/,Round1049/,round1052/, ... — folders for round-specific solutions. Each folder contains individual problem source files (usually.cpp).
Most files are single-file C++ solutions (no external dependencies). Examples below assume you have a C++ compiler installed (g++ from MinGW/MSYS2, or Visual Studio cl).
Using g++ (MinGW / MSYS2 / WSL):
# compile
g++ -std=c++17 -O2 -pipe path\to\solution.cpp -o solution.exe
# run with optional input redirection
.\solution.exe < input.txtUsing Microsoft Visual C++ (Developer Command Prompt / proper environment):
# compile (from Developer Command Prompt where cl is available)
cl /std:c++17 /O2 path\to\solution.cpp /Fe:solution.exe
# run
.\solution.exe < input.txtNotes:
- Replace
path\to\solution.cppwith the actual file path (for exampleround1056\sol3.cpp). - If you use WSL, build/run commands are the same as on Linux (use
g++in WSL shell).
- Open the folder in VS Code.
- Edit or choose a solution file (for example
round1056/sol3.cpp). - Compile via the integrated terminal using the commands above.
- Run with sample input using
.\solution.exe < sample_input.txt.
- Add small, well-tested changes. Name new files clearly (e.g.,
roundXXXX/solY.cpp). - Keep solutions focused and single-file where possible.
If you want improvements or have questions, create an issue or contact the repository owner.