shogo-library

競技プログラミング用の C++ ライブラリ

View the Project on GitHub shogo314/shogo-library

shogo-library

競技プログラミング用の C++ ライブラリです。 ソースコードは shogo314/shogo-library にあります。

src/ を include パスに追加して、必要なヘッダを include します。

#include "data_structures/segtree.hpp"
#include "math/modint.hpp"

C++17 以上の GNU 拡張つき (-std=gnu++17 など。AtCoder の GCC と同じ) で使うことを前提にしています。__int128 を整数型として扱うところがあるので、-std=c++17 のような厳密な規格モードではコンパイルできないことがあります。

using namespace std; は使わないでください。このライブラリには sort・max・rank など std と同じ名前のグローバル関数があり、using namespace std; があると呼び出しが曖昧になってコンパイルできないことがあります。std のものは std:: を付けて書きます。

データ構造には algebra/ のモノイドを渡します。ラムダ式から作ることもできます。

SegTree<monoid::Max<int>> seg(n);
SegTree seg2(v, Monoid([](int a, int b) { return a + b; }, 0));
LazySegTree<acted_monoid::AffineSum<mint>> lseg(v);

Library Files

src/algebra

src/base

src/data_structures

src/dp

src/geometry

src/geometry/internal

src/graph

src/math

src/offline

src/string

src/utility

tools

Verification Files

test/aoj/alds1

test/aoj/cgl

test/aoj/dpl

test/aoj/dsl

test/aoj/grl

test/aoj/itp1

test/aoj/itp2

test/aoj/ntl

test/aoj/volume0

test/aoj/volume1

test/aoj/volume11

test/aoj/volume12

test/aoj/volume15

test/aoj/volume26

test/aoj/volume28

test/aoj/volume29

test/aoj/volume33

test/unittest/algebra

test/unittest/base

test/unittest/data_structures

test/unittest/dp

test/unittest/geometry

test/unittest/graph

test/unittest/math

test/unittest/offline

test/unittest/string

test/unittest/utility

test/yosupo/convolution

test/yosupo/data_structure

test/yosupo/enumerative_combinatorics

test/yosupo/geo

test/yosupo/graph

test/yosupo/linear_algebra

test/yosupo/number_theory

test/yosupo/other

test/yosupo/polynomial

test/yosupo/sample

test/yosupo/set_power_series

test/yosupo/string

test/yosupo/tree

test/yukicoder