A collection of competitive programming solutions written in C++. This repository serves as a personal log of solved problems from various platforms like LeetCode, LintCode, and AcWing.
The project is organized by platform, with source and header files for each.
CMakeLists.txt: The main build configuration file for the project.Doxyfile: The configuration file for the Doxygen documentation generator.main.cpp: The entry point for running the Google Test suite.acwing.cpp,leetcode.cpp, etc.: Implementation files containing solutions for problems from the respective platforms.acwing.h,leetcode.h, etc.: Header files declaring the classes and functions for each platform's solutions.*_test.cpp: Test files containing unit tests for the solutions, organized by platform.templates/: Contains reusable code and data structures, such as aBigIntclass.
- A C++20 compatible compiler (e.g., GCC, Clang, MSVC).
- CMake (version 3.21 or newer).
- Doxygen (for generating documentation).
This project uses CMake for building. Google Test is managed via FetchContent and will be downloaded automatically if not found on your system.
-
Clone the repository:
git clone https://github.com/tategotoazarasi/problemscpp.git cd problemscpp -
Configure the build using CMake:
cmake -B build
-
Build the project:
cmake --build build
This will compile the source code and create an executable in the
builddirectory.
The project uses Google Test for unit testing. The tests are discovered automatically by CMake.
To run all tests, execute the binary built in the previous step:
./build/problemscppAlternatively, you can use ctest from within the build directory:
cd build
ctestThe project uses Doxygen to automatically generate API documentation from the comments in the source code.
-
Install Doxygen: Ensure you have Doxygen installed. You can typically install it through your system's package manager (e.g.,
sudo apt-get install doxygen) or from the official website. -
Generate the documentation: Navigate to the project's root directory and run Doxygen:
doxygen Doxyfile
-
View the documentation: The documentation will be generated in the directory specified by
OUTPUT_DIRECTORYandHTML_OUTPUTin theDoxyfile(currently./). Open theindex.htmlfile in your web browser to view the documentation.