# clone with submodules
$ git clone --recurse-submodules https://github.com/hareku/cpp-algorithm
You can easily start with VSCode Remote Container without installing dependencies.
If you develop locally or want to use other editors, install some dependencies. Check out Dockerfile.
# create main.cpp
$ cp main.template.cpp main.cpp
# build main.cpp
$ make a.out
# execute binary
$ ./a.out
# bundle `main.cpp` and including libraries for submission (e.g AtCoder)
$ make bundle.cpp
$ cat bundle.cpp # bundled code
Example code for lib/math/divisors.hpp
#include <bits/stdc++.h>
#include "lib/math/divisors.hpp"
using namespace std;
int main() {
int N; cin >> N;
vector<long long> divisors = lib::math::divisors(N);
for(int i = 0; i < int(divisors.size()); ++i) {
cout << divisors[i] << endl;
}
return 0;
}
This library is tested by Verification Helper.
# run all tests
$ oj-verify all
# run specific test
$ oj-verify run test/math/primes.test.cpp