ライブラリのドキュメント
環境構築
- Docker, Git, make のインストール
- build (AHCの場合は build_AHC)をコピペ、実行
make build
でDockerイメージをビルドする(初回のみ)
make run
でコンテナを起動して入る
スクリプト
./cmp <file>
<file>
をコンパイルする。
./copy <file>
<file>
にincludeしたライブラリを展開し、./combinded.cpp
に保存する。
./test <solve> <generate> <naive>
ランダムテスト用スクリプト。<solve>
を実行し、<generate>
で生成した入力を与え、<naive>
で生成した出力と比較する。
./contest
カレントディレクトリで作成したファイルを削除する。スクリプトやライブラリは削除しない。コンテスト前に実行する。
使い方
vim a.cpp
./cmp a
./a.out
./copy a
データ構造に載せる代数構造の定義の仕方
例) モノイド
using Type = hoge;
static Type id() { return hoge; }
static Type op(const Type& l, const Type& r) { return hoge; }
};
各構造の要件
- モノイド
Type id()
Type op(const Type& l, const Type& r)
- 半群
Type op(const Type& l, const Type& r)
- 群
Type inv(const Type& x)
Type op(const Type& l, const Type& r)
Type id()
- 作用素
Type id()
Type op(const Type& l, const Type& r)