algo — C++23 日本語リファレンス GitHub

algo — C++23 日本語リファレンス

競技プログラミング向け C++23 ヘッダオンリーライブラリの日本語リファレンスです。 公開 API の使い方・前提条件・計算量と、オンラインジャッジによる検証結果をまとめています。 すべてのページはヘッダのコメントから生成しています。

GitHub · リファレンス執筆ガイド

ヘッダ 180 個 · 型と関数 357 個 · 検証プログラム 250 個

algorithm

combinatorics

  • bell ベル数を $B_0$ から $B_n$ まで列挙する
  • combinatorics 二項係数・階乗・順列・多項係数・重複組合せ
  • offline_binomial_sum 複数の二項係数部分和 $\sum_{i=0}^{k}\binom{n}{i}$ をまとめて求める
  • partition_function 分割数を $p(0)$ から $p(n)$ まで列挙する
  • stirling 第1種スターリング数(符号付き)s(n, 0), s(n, 1), ..., s(n, n) を求める(行)
  • stirling_bell 第2種スターリング数・ベル数
  • stirling_small_p_large_n 第1種・第2種スターリング数 mod 小さい素数 p を、n, k が巨大(~1e18)でも求める

convolution

  • fft FFT・実数畳み込み
  • formal_power_series 形式的冪級数 (FPS)
  • garner Garner法で連立合同式の解を指定した法で復元する
  • ntt NTT・畳み込み (convolution)
  • ntt_avx2 Montgomery + AVX2 による NTT 畳み込み (NTT-friendly な 32bit 素数 mod 専用)
  • subset_convolution 部分集合畳み込み $c[S]=\sum_{T\subseteq S}a[T]b[S\setminus T]$ を求める

data_structure

dp

flow

  • bipartite_graph_matching 2 彩色済みの一般の無向グラフを二部マッチング本体(BipartiteMatching)に橋渡しするアダプタ
  • bipartite_matching 二部グラフの最大マッチング(push-relabel 方式、$O(E\sqrt V)$)
  • max_flow 最大流 (mf_graph)
  • min_cost_flow 最小費用流

geometry

  • convex_hull 二次元点集合の凸包を構築する
  • geometry 二次元幾何の点・直線・円と基本演算
  • geometry3d 三次元の点・球と最小包含球
  • kdtree 二次元kd-tree

graph

heap

linalg

number_theory

parser

  • ambiguous_expr 曖昧式の全順序評価 (AmbiguousExpr)
  • cfg_graph グラフ上の文脈自由到達可能性 (CykGraph)
  • hash_cons hash-consing (不変な木/DAG ノードのインターン)
  • parser 汎用式パーサ (ExpressionParser)

persistent_ds

random

segtree

string

tree

internal

template

検証プログラム(250)

test/aoj/alds1

test/aoj/cgl

test/aoj/challenge

test/aoj/course

test/aoj/dpl

test/aoj/dsl

test/aoj/grl

test/aoj/jag

test/aoj/joi

test/aoj/ntl

test/yosupo/big_integer

test/yosupo/convolution

test/yosupo/data_structure

test/yosupo/enumerative_conbinatorics

test/yosupo/geometry

test/yosupo/graph

test/yosupo/math

test/yosupo/matrix

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