This repository contains algorithms for competitive programming. It was created in order to fix wrong codes on E-maxx.
For now we use googletest (gtest) v1.8.1 as an automatic test system.
Also we use Travis CI to provide automatic testing of all branches (see tests badge on top).
More info: cpp/tests/README.md
We use Google C++ Style Guide with some exceptions:
- Source files have
.cpp
extension rather than.cc
As this code can be used by beginners and.cpp
extension is the most popular we don't want to create additional difficulties in understanding where the code is placed (and why do we use.cc
extension). - No need to create header (
.h
) files.
We want to keep structure as simple as possible. One source file with implementation and one with tests. It should be possible to copy an implementation and paste it anywhere. - Possibility of including source (
.cpp
) files
This is due to previous exception.
As the wording is complicated we provide an example:
#include "../binary_power/binary_power_tests.cpp"
- Identation is 4 spaces instead of 2 spaces
Code in this repository shouldn't have big nesting inside it.
4 spaces is more often used by beginners than 2 spaces.
Also you can see much clearer where each block of code goes (this is created out of thin air).