From e6f6c2a8c534f594c0f678f75ae60755dccd0de8 Mon Sep 17 00:00:00 2001 From: GitHub Date: Sat, 29 Jul 2023 07:38:34 +0000 Subject: [PATCH] [auto-verifier] docs commit 014164becd39bbc05c562703b83110c1cbd111cb --- README.md | 11 +- ...st.py.md => mat_pow_global_mod.test.py.md} | 12 +- ...est.py.md => wildcard_matching.test.py.md} | 12 +- ...nTree.test.py.md => JumpOnTree.test.py.md} | 12 +- .../data_structure/ConvexHullTrick.py.md | 24 +++- .../data_structure/DisjointSparseTable.py.md | 14 +- .../data_structure/LazySegmentTree.py.md | 20 ++- .../data_structure/RollbackUnionFind.py.md | 20 ++- expansion/data_structure/SWAG.py.md | 24 +++- expansion/data_structure/SegmentTree.py.md | 4 +- expansion/data_structure/SparseTable.py.md | 15 +- .../data_structure/WeightedUnionFind.py.md | 18 ++- expansion/geometry/arg_sort.py.md | 14 +- expansion/geometry/convex_hull.py.md | 16 ++- expansion/graph/Hungarian.py.md | 17 ++- expansion/graph/SCC.py.md | 15 +- expansion/graph/bellmanFord.py.md | 17 ++- expansion/graph/dijkstra.py.md | 16 ++- expansion/graph/lowLink.py.md | 16 ++- expansion/graph/maxflow.py.md | 20 ++- expansion/math/Combination.py.md | 16 ++- expansion/math/CombinationArbitrary.py.md | 13 +- expansion/math/Garner.py.md | 16 ++- expansion/math/MillerRabin.py.md | 13 +- expansion/math/PollardRho.py.md | 14 +- expansion/math/Quotients.py.md | 13 +- expansion/math/TwoSAT.py.md | 16 ++- expansion/math/cipolla.py.md | 13 +- expansion/math/ext_gcd.py.md | 14 +- expansion/math/floor_sum.py.md | 13 +- expansion/math/mat_exp.py.md | 15 +- expansion/misc/Bitset.py.md | 47 ++++++- expansion/misc/DeletableHeapq.py.md | 23 ++- expansion/misc/FastIO.py.md | 10 +- expansion/misc/MadianHeap.py.md | 20 ++- expansion/misc/Mo.py.md | 19 ++- expansion/misc/TopKHeap.py.md | 17 ++- expansion/misc/make_popcount.py.md | 15 +- expansion/misc/next_permutation.py.md | 25 +++- expansion/misc/popcount.py.md | 18 ++- expansion/polynomial/BostanMori998.py.md | 15 +- .../polynomial/FormalPowerSeries998.py.md | 27 +++- expansion/polynomial/berlekamp_massey.py.md | 15 +- expansion/string/AhoCorasick.py.md | 15 +- expansion/string/KMP.py.md | 14 +- expansion/string/RollingHash.py.md | 15 +- expansion/string/Z_algorithm.py.md | 14 +- expansion/string/manacher.py.md | 16 ++- expansion/string/suffix_array.py.md | 17 ++- ..._mathing.py.md => wildcard_matching.py.md} | 23 ++- expansion/tree/CartesianTree.py.md | 15 +- expansion/tree/CentroidDecomposition.py.md | 21 ++- expansion/tree/HLD.py.md | 23 ++- expansion/tree/Kruskal.py.md | 16 ++- expansion/tree/LCA.py.md | 19 ++- index.md | 133 +++++++++--------- ...st.py.md => mat_pow_global_mod.test.py.md} | 12 +- src/$tests/misc/Mo.test.py.md | 2 +- src/$tests/polynomial/BostanMori.test.py.md | 2 +- ...est.py.md => wildcard_matching.test.py.md} | 20 +-- src/$tests/tree/HLD.test.py.md | 2 +- ...nTree.test.py.md => JumpOnTree.test.py.md} | 12 +- src/convolution/NTT998.py.md | 6 +- src/math/mat_exp_global_mod.py.md | 6 +- src/polynomial/FormalPowerSeries998.py.md | 2 +- src/string/RollingHash.py.md | 6 +- ..._mathing.py.md => wildcard_matching.py.md} | 18 +-- src/tree/LCA.py.md | 6 +- 68 files changed, 819 insertions(+), 340 deletions(-) rename expansion/$tests/math/{mat_pow_gloabal_mod.test.py.md => mat_pow_global_mod.test.py.md} (85%) rename expansion/$tests/string/{wildcard_mathing.test.py.md => wildcard_matching.test.py.md} (96%) rename expansion/$tests/tree/{JumoOnTree.test.py.md => JumpOnTree.test.py.md} (93%) rename expansion/string/{wildcard_mathing.py.md => wildcard_matching.py.md} (94%) rename src/$tests/math/{mat_pow_gloabal_mod.test.py.md => mat_pow_global_mod.test.py.md} (83%) rename src/$tests/string/{wildcard_mathing.test.py.md => wildcard_matching.test.py.md} (85%) rename src/$tests/tree/{JumoOnTree.test.py.md => JumpOnTree.test.py.md} (83%) rename src/string/{wildcard_mathing.py.md => wildcard_matching.py.md} (84%) diff --git a/README.md b/README.md index 9cef4ec..722d40e 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,20 @@ # Library-Python +https://rin204.github.io/Library-Python/ + ## 注意事項 `***_global_mod` と書かれているものは MOD の値をグローバル変数で宣言しているものです. 基本的に 998244353 にしているので,違う値にしたいときは適宜検索をして使いたい値に変更してください +`***_Base` と書かれている / 書かれていないだけの差分があるものがあります.基本的にクラスを扱うのに関数を与えなければいけないもので,書かれていない場合は引数に与える,書かれている場合はクラスを継承して関数を定義することを想定しています. + `src/` と `expansion/` がありますが,コピペして使いたい場合は `expansion/` にあるものを使ってください. MOD 系は 998244353 を暗に仮定しているものがいくつかあるので,適宜変更してください. -個人用競プロ用で作成したライブラリなので,書き方が変なものは一定すうあると思いますが,ご了承ください. +個人用競プロ用で作成したライブラリなので,書き方が変なものは一定数あると思いますが,ご了承ください (& バグがあったらごめんなさい). -一部 `Base_` と末尾についている class があります.これらは,主に引数で与える想定になる関数について, -- `Base_` が付いていない場合:引数に与える -- `Base_` が付いている場合:class を継承して各種関数を作成する +作成者が数学に明るくない人間なので,いくつか誤用等があると思います.ご了承ください. -使い方を想定しています.使用感は https://github.com/Rin204/Library-Python/blob/main/src/%24tests/data_structure/segtree.test.py https://github.com/Rin204/Library-Python/blob/main/src/%24tests/data_structure/segtree2.test.py あたりを見てください. ## expansion.py diff --git a/expansion/$tests/math/mat_pow_gloabal_mod.test.py.md b/expansion/$tests/math/mat_pow_global_mod.test.py.md similarity index 85% rename from expansion/$tests/math/mat_pow_gloabal_mod.test.py.md rename to expansion/$tests/math/mat_pow_global_mod.test.py.md index 265f0a2..de10e40 100644 --- a/expansion/$tests/math/mat_pow_gloabal_mod.test.py.md +++ b/expansion/$tests/math/mat_pow_global_mod.test.py.md @@ -27,15 +27,15 @@ data: \ A[s][t] = 1\n A[t][s] = 1\n\nB = mat_exp_global_mod(A, B, T)\nprint(B[0])\n" dependsOn: [] isVerificationFile: true - path: expansion/$tests/math/mat_pow_gloabal_mod.test.py + path: expansion/$tests/math/mat_pow_global_mod.test.py requiredBy: [] - timestamp: '2023-07-23 08:45:17+09:00' + timestamp: '2023-07-29 13:32:11+09:00' verificationStatus: TEST_WRONG_ANSWER verifiedWith: [] -documentation_of: expansion/$tests/math/mat_pow_gloabal_mod.test.py +documentation_of: expansion/$tests/math/mat_pow_global_mod.test.py layout: document redirect_from: -- /verify/expansion/$tests/math/mat_pow_gloabal_mod.test.py -- /verify/expansion/$tests/math/mat_pow_gloabal_mod.test.py.html -title: expansion/$tests/math/mat_pow_gloabal_mod.test.py +- /verify/expansion/$tests/math/mat_pow_global_mod.test.py +- /verify/expansion/$tests/math/mat_pow_global_mod.test.py.html +title: expansion/$tests/math/mat_pow_global_mod.test.py --- diff --git a/expansion/$tests/string/wildcard_mathing.test.py.md b/expansion/$tests/string/wildcard_matching.test.py.md similarity index 96% rename from expansion/$tests/string/wildcard_mathing.test.py.md rename to expansion/$tests/string/wildcard_matching.test.py.md index 4a21ab4..60fcc1c 100644 --- a/expansion/$tests/string/wildcard_mathing.test.py.md +++ b/expansion/$tests/string/wildcard_matching.test.py.md @@ -133,15 +133,15 @@ data: \ sep=\"\")\n\n\nfor _ in range(int(input())):\n solve()\n" dependsOn: [] isVerificationFile: true - path: expansion/$tests/string/wildcard_mathing.test.py + path: expansion/$tests/string/wildcard_matching.test.py requiredBy: [] - timestamp: '2023-07-23 08:45:17+09:00' + timestamp: '2023-07-29 13:32:11+09:00' verificationStatus: TEST_WRONG_ANSWER verifiedWith: [] -documentation_of: expansion/$tests/string/wildcard_mathing.test.py +documentation_of: expansion/$tests/string/wildcard_matching.test.py layout: document redirect_from: -- /verify/expansion/$tests/string/wildcard_mathing.test.py -- /verify/expansion/$tests/string/wildcard_mathing.test.py.html -title: expansion/$tests/string/wildcard_mathing.test.py +- /verify/expansion/$tests/string/wildcard_matching.test.py +- /verify/expansion/$tests/string/wildcard_matching.test.py.html +title: expansion/$tests/string/wildcard_matching.test.py --- diff --git a/expansion/$tests/tree/JumoOnTree.test.py.md b/expansion/$tests/tree/JumpOnTree.test.py.md similarity index 93% rename from expansion/$tests/tree/JumoOnTree.test.py.md rename to expansion/$tests/tree/JumpOnTree.test.py.md index 33be487..36fb5f3 100644 --- a/expansion/$tests/tree/JumoOnTree.test.py.md +++ b/expansion/$tests/tree/JumpOnTree.test.py.md @@ -52,15 +52,15 @@ data: \ v, k))\n" dependsOn: [] isVerificationFile: true - path: expansion/$tests/tree/JumoOnTree.test.py + path: expansion/$tests/tree/JumpOnTree.test.py requiredBy: [] - timestamp: '2023-07-23 08:45:17+09:00' + timestamp: '2023-07-29 13:32:11+09:00' verificationStatus: TEST_WRONG_ANSWER verifiedWith: [] -documentation_of: expansion/$tests/tree/JumoOnTree.test.py +documentation_of: expansion/$tests/tree/JumpOnTree.test.py layout: document redirect_from: -- /verify/expansion/$tests/tree/JumoOnTree.test.py -- /verify/expansion/$tests/tree/JumoOnTree.test.py.html -title: expansion/$tests/tree/JumoOnTree.test.py +- /verify/expansion/$tests/tree/JumpOnTree.test.py +- /verify/expansion/$tests/tree/JumpOnTree.test.py.html +title: expansion/$tests/tree/JumpOnTree.test.py --- diff --git a/expansion/data_structure/ConvexHullTrick.py.md b/expansion/data_structure/ConvexHullTrick.py.md index e6adcf1..7c5ad3e 100644 --- a/expansion/data_structure/ConvexHullTrick.py.md +++ b/expansion/data_structure/ConvexHullTrick.py.md @@ -30,8 +30,24 @@ data: verifiedWith: [] documentation_of: expansion/data_structure/ConvexHullTrick.py layout: document -redirect_from: -- /library/expansion/data_structure/ConvexHullTrick.py -- /library/expansion/data_structure/ConvexHullTrick.py.html -title: expansion/data_structure/ConvexHullTrick.py +title: ConvexHullTrick --- + +# 概要 +以下のクエリを処理します + +- 1 次関数 $f(x) = ax + b$ を追加 +- 追加された 1 次関数のうち ある x において最小値を取るもの(の $f(x)$ の値)を返す + +ただし, +- 追加する 1 時間数の傾きが単調減少である +- 最小値クエリの x の値が単調増加である + +必要があります.増加 / 減少を逆にしたい場合は適当に -1 をかけて調整してください + + + +## 使い方 +- \_\_init\_\_() := +- add_line(a, b) := $f(x) = ax + b$ を追加します. +- get(x) := x における最小値を返します diff --git a/expansion/data_structure/DisjointSparseTable.py.md b/expansion/data_structure/DisjointSparseTable.py.md index 17e61ad..5dcbce6 100644 --- a/expansion/data_structure/DisjointSparseTable.py.md +++ b/expansion/data_structure/DisjointSparseTable.py.md @@ -37,8 +37,14 @@ data: verifiedWith: [] documentation_of: expansion/data_structure/DisjointSparseTable.py layout: document -redirect_from: -- /library/expansion/data_structure/DisjointSparseTable.py -- /library/expansion/data_structure/DisjointSparseTable.py.html -title: expansion/data_structure/DisjointSparseTable.py +title: DisjointSparseTable --- + +# 概要 +- $f(a, f(b, c)) = f(f(a, b), c)$ + +を満たす二項演算を処理します. + +## 使い方 +- \_\_init\_\_(A, ope) := 配列 A と条件を満たす演算 ope を与えて初期化します. +- prod(l, r) := 区間 [l, r) の演算結果を返します. diff --git a/expansion/data_structure/LazySegmentTree.py.md b/expansion/data_structure/LazySegmentTree.py.md index 62fbf98..23b460f 100644 --- a/expansion/data_structure/LazySegmentTree.py.md +++ b/expansion/data_structure/LazySegmentTree.py.md @@ -84,8 +84,20 @@ data: verifiedWith: [] documentation_of: expansion/data_structure/LazySegmentTree.py layout: document -redirect_from: -- /library/expansion/data_structure/LazySegmentTree.py -- /library/expansion/data_structure/LazySegmentTree.py.html -title: expansion/data_structure/LazySegmentTree.py +title: LazySegmentTree --- + +# 概要 +主に 区間更新と区間に対する演算に高速に答えるためのデータ構造です._Base がついている方の使用法に関しては,SegmentTree の方と基本的に同様です + +## 使い方 +- \_\_init\_\_(n, ope, e, mapping, composition, id_ init=None) := 長さ $n$ の配列 A を作成します.各変数については [ac-library](https://atcoder.github.io/ac-library/master/document_ja/lazysegtree.html) のものと同様のものを想定しているので,それを参考にしてください.`init=None`に長さ$n$の配列を指定した場合はそれが初期値に,そうでない場合は `e` が初期値になります. +- set(i, x) := i 番目の値を x に変更します. +- get(i) := A[i] の値を求めます. +- \_\_getitem\_\_(i) := `get(i)` と同じ +- \_\_setitem\_\_(i) := `set(i, x)` と同じ +- prod(l, r) := 区間 $[l, r)$ の演算結果を返します. +- apply(l, r, f) := 区間 $[l, r)$ を.mapping で指定した更新ルールで更新します +- apply(x, f) := 区間 $[x, x + 1)$ を.mapping で指定した更新ルールで更新します +- max_right(self, l, f) := 関数 f を与えて segtree 上で二分探索をします.[ac-library](https://atcoder.github.io/ac-library/master/document_ja/lazysegtree.html) にあるものと同じ仕様です. +- max_left(self, r, f) := 関数 f を与えて segtree 上で二分探索をします.[ac-library](https://atcoder.github.io/ac-library/master/document_ja/lazysegtree.html) にあるものと同じ仕様です. diff --git a/expansion/data_structure/RollbackUnionFind.py.md b/expansion/data_structure/RollbackUnionFind.py.md index a43e310..3745c0b 100644 --- a/expansion/data_structure/RollbackUnionFind.py.md +++ b/expansion/data_structure/RollbackUnionFind.py.md @@ -36,8 +36,20 @@ data: verifiedWith: [] documentation_of: expansion/data_structure/RollbackUnionFind.py layout: document -redirect_from: -- /library/expansion/data_structure/RollbackUnionFind.py -- /library/expansion/data_structure/RollbackUnionFind.py.html -title: expansion/data_structure/RollbackUnionFind.py +title: RollbackUnionFind --- + +# 概要 +UnionFind に Rollback 機能を付けたものです. + +## 使い方 +- \_\_init\_\_(n) := 長さ $N$ で初期化します. +- find(x) := x の代表元を返します. +- unite(x, y) := x の属する集合と y の属する集合を合併し,True を返します.もともと同じ集合に属した場合 False を返します. +- size(x) := x の属する集合の大きさを返します. +- same(x, y) := x と y が同じ集合に属するなら True を,そうでないなら False を返します. +- group := 現在の集合の個数を返します. +- undo() := 1 手状態を戻します +- get_state() := 現在の状態を返します.(unite を行った回数) +- rollback(state) := ↑で取得した状態に戻します + diff --git a/expansion/data_structure/SWAG.py.md b/expansion/data_structure/SWAG.py.md index fad14fa..72e1eef 100644 --- a/expansion/data_structure/SWAG.py.md +++ b/expansion/data_structure/SWAG.py.md @@ -31,8 +31,24 @@ data: verifiedWith: [] documentation_of: expansion/data_structure/SWAG.py layout: document -redirect_from: -- /library/expansion/data_structure/SWAG.py -- /library/expansion/data_structure/SWAG.py.html -title: expansion/data_structure/SWAG.py +title: SWAG --- + +# 概要 +deque に対して要素の追加 / 削除 / 現在の列に対する演算結果取得 を処理します. + +演算については +- $f(a, f(b, c)) = f(f(a, b), c)$ +- 単位元が存在する + +ものを想定しています.(本当は単位元はいらないはずなんですが,実装の都合上要求しているので,ない場合は適当に取りえない値を設定して演算の中で if 文を入れてください) + + +## 使い方 +- \_\_init\_\_(ope, e) := 扱う演算を定義します +- push(x) := deque の末尾に x を追加します. +- pop(x) := deque の先頭の要素を削除します. +- prod() := 現在の deque 列に対する演算結果を返します +- size() := deque 列の長さを返します. +- \_\_len\_\_ := 上記同様 +- clear() := deque を空にします. diff --git a/expansion/data_structure/SegmentTree.py.md b/expansion/data_structure/SegmentTree.py.md index f2d3e83..df345b6 100644 --- a/expansion/data_structure/SegmentTree.py.md +++ b/expansion/data_structure/SegmentTree.py.md @@ -69,5 +69,5 @@ title: SegmentTree - \_\_getitem\_\_(i) := `get(i)` と同じ - \_\_setitem\_\_(i) := `set(i, x)` と同じ - prod(l, r) := 区間 $[l, r)$ の演算結果を返します. -- max_right(self, l, f) := 関数 f を与えて segtree 上で二分探索をします.ac-library にあるものと同じ仕様です. -- max_left(self, r, f) := 関数 f を与えて segtree 上で二分探索をします.ac-library にあるものと同じ仕様です. +- max_right(self, l, f) := 関数 f を与えて segtree 上で二分探索をします.[ac-library](https://atcoder.github.io/ac-library/master/document_ja/segtree.html) にあるものと同じ仕様です. +- max_left(self, r, f) := 関数 f を与えて segtree 上で二分探索をします.[ac-library](https://atcoder.github.io/ac-library/master/document_ja/segtree.html) にあるものと同じ仕様です. diff --git a/expansion/data_structure/SparseTable.py.md b/expansion/data_structure/SparseTable.py.md index aaaec48..59d7641 100644 --- a/expansion/data_structure/SparseTable.py.md +++ b/expansion/data_structure/SparseTable.py.md @@ -33,8 +33,15 @@ data: verifiedWith: [] documentation_of: expansion/data_structure/SparseTable.py layout: document -redirect_from: -- /library/expansion/data_structure/SparseTable.py -- /library/expansion/data_structure/SparseTable.py.html -title: expansion/data_structure/SparseTable.py +title: SparseTable --- + +# 概要 +- $f(x, x) = x$ +- $f(a, f(b, c)) = f(f(a, b), c)$ + +を満たす二項演算を処理します. + +## 使い方 +- \_\_init\_\_(A, ope) := 配列 A と条件を満たす演算 ope を与えて初期化します. +- prod(l, r) := 区間 [l, r) の演算結果を返します. diff --git a/expansion/data_structure/WeightedUnionFind.py.md b/expansion/data_structure/WeightedUnionFind.py.md index b3d6704..f4337fc 100644 --- a/expansion/data_structure/WeightedUnionFind.py.md +++ b/expansion/data_structure/WeightedUnionFind.py.md @@ -37,8 +37,18 @@ data: verifiedWith: [] documentation_of: expansion/data_structure/WeightedUnionFind.py layout: document -redirect_from: -- /library/expansion/data_structure/WeightedUnionFind.py -- /library/expansion/data_structure/WeightedUnionFind.py.html -title: expansion/data_structure/WeightedUnionFind.py +title: WeightedUnionFind --- + +# 概要 +UnionFind の各辺に重みを付けたものです. +各頂点に重みD[i]があるのを想定して差分を管理したりします + +## 使い方 +- \_\_init\_\_(n) := 長さ $N$ で初期化します. +- find(x) := x の代表元を返します. +- unite(x, y, d) := x の属する集合と y の属する集合を合併し,True を返します.もともと同じ集合に属した場合 False を返します.ここで,D[x] - D[y] = d となるように合併を行い,既に合併済みかつ長さ制約に矛盾がある場合は assert で落ちます +- size(x) := x の属する集合の大きさを返します. +- same(x, y) := x と y が同じ集合に属するなら True を,そうでないなら False を返します. +- group := 現在の集合の個数を返します. +- diff(x, y) := D[x] - D[y] を返します.x, y の属する集合が異なる場合は None を返します. diff --git a/expansion/geometry/arg_sort.py.md b/expansion/geometry/arg_sort.py.md index b92050c..3e8be05 100644 --- a/expansion/geometry/arg_sort.py.md +++ b/expansion/geometry/arg_sort.py.md @@ -35,8 +35,14 @@ data: verifiedWith: [] documentation_of: expansion/geometry/arg_sort.py layout: document -redirect_from: -- /library/expansion/geometry/arg_sort.py -- /library/expansion/geometry/arg_sort.py.html -title: expansion/geometry/arg_sort.py +title: "\u504F\u89D2\u30BD\u30FC\u30C8" --- + +# 概要 +与えられた頂点群を偏角ソートします. + +## 使い方 + +``` +sorted_points = arg_sort(points) +``` diff --git a/expansion/geometry/convex_hull.py.md b/expansion/geometry/convex_hull.py.md index 9cea29b..388baac 100644 --- a/expansion/geometry/convex_hull.py.md +++ b/expansion/geometry/convex_hull.py.md @@ -29,8 +29,16 @@ data: verifiedWith: [] documentation_of: expansion/geometry/convex_hull.py layout: document -redirect_from: -- /library/expansion/geometry/convex_hull.py -- /library/expansion/geometry/convex_hull.py.html -title: expansion/geometry/convex_hull.py +title: "\u51F8\u5305" --- + +# 概要 +凸包を求めます. +$[(x_1, y_1), (x_2, y_2), \ldots]$ +の形式で頂点を与えてください. + +## 使い方 + +``` +convex_hull_points = convex_hull(points) +``` diff --git a/expansion/graph/Hungarian.py.md b/expansion/graph/Hungarian.py.md index 03b5649..0507b22 100644 --- a/expansion/graph/Hungarian.py.md +++ b/expansion/graph/Hungarian.py.md @@ -38,8 +38,17 @@ data: verifiedWith: [] documentation_of: expansion/graph/Hungarian.py layout: document -redirect_from: -- /library/expansion/graph/Hungarian.py -- /library/expansion/graph/Hungarian.py.html -title: expansion/graph/Hungarian.py +title: Hungarian --- + +# 概要 +割り当て問題を解きます. + +$N \times M, (N \le M)$ の行列 $A$ があるときに。 +$\sum_{i = 0}^{N - 1} A_{i, p_i}$ を最小化する $p_i$ (重複なし) を構成します。 + +## 使い方 +inf は十分に大きい値を適当に設定してください +``` +cost, assignment = Hungarian(A, inf=1 << 60): +``` diff --git a/expansion/graph/SCC.py.md b/expansion/graph/SCC.py.md index d97bc69..0f43093 100644 --- a/expansion/graph/SCC.py.md +++ b/expansion/graph/SCC.py.md @@ -52,8 +52,15 @@ data: verifiedWith: [] documentation_of: expansion/graph/SCC.py layout: document -redirect_from: -- /library/expansion/graph/SCC.py -- /library/expansion/graph/SCC.py.html -title: expansion/graph/SCC.py +title: SCC --- + +# 概要 +強連結成分分解をします. + +## 使い方 + +- \_\_init\_\_(n, edges=None) := 頂点数 n でグラフを初期化します.edges を与える場合は,$edges = [(from_1, to_1), (from_2, to_2), \ldots]$ の形式で与えてください +- add_edge(u, v) := u -> v の有向辺を追加します. +- read_edges(m, indexed=1) := m 辺の情報を標準入力として受け取ります. +- build() := 構築します.強連結成分の個数と,各頂点がどの連結成分に属するかを返します.連結成分の番号はトポロジカル順序です. diff --git a/expansion/graph/bellmanFord.py.md b/expansion/graph/bellmanFord.py.md index dac9085..07755b2 100644 --- a/expansion/graph/bellmanFord.py.md +++ b/expansion/graph/bellmanFord.py.md @@ -26,8 +26,17 @@ data: verifiedWith: [] documentation_of: expansion/graph/bellmanFord.py layout: document -redirect_from: -- /library/expansion/graph/bellmanFord.py -- /library/expansion/graph/bellmanFord.py.html -title: expansion/graph/bellmanFord.py +title: bellmanFord --- + +# 概要 +ベルマンフォードです. + +$edges = [(from1, to1, cost1), (from2, to2, cost2), ...)]$の形式で辺情報を与えてください + +## 使い方 +inf は十分に大きい値を適当に設定してください +``` +dist = bellmanFord(n, edges, s, inf=1 << 60) +``` +負閉路がある場合は None を返します. diff --git a/expansion/graph/dijkstra.py.md b/expansion/graph/dijkstra.py.md index 5f3797b..4287bbb 100644 --- a/expansion/graph/dijkstra.py.md +++ b/expansion/graph/dijkstra.py.md @@ -28,8 +28,16 @@ data: verifiedWith: [] documentation_of: expansion/graph/dijkstra.py layout: document -redirect_from: -- /library/expansion/graph/dijkstra.py -- /library/expansion/graph/dijkstra.py.html -title: expansion/graph/dijkstra.py +title: dijkstra --- + +# 概要 +ダイクストラ法です. + +$edges[from] = [(to1, cost1), (to2, cost2), ...)]$の形式で辺情報を与えてください + +## 使い方 +inf は十分に大きい値を適当に設定してください +``` +dist = dijkstra(edges, s=0, inf=1 << 60) +``` diff --git a/expansion/graph/lowLink.py.md b/expansion/graph/lowLink.py.md index 036edf3..0036caa 100644 --- a/expansion/graph/lowLink.py.md +++ b/expansion/graph/lowLink.py.md @@ -45,8 +45,16 @@ data: verifiedWith: [] documentation_of: expansion/graph/lowLink.py layout: document -redirect_from: -- /library/expansion/graph/lowLink.py -- /library/expansion/graph/lowLink.py.html -title: expansion/graph/lowLink.py +title: lowLink --- + +# 概要 +グラフの橋と関節点を見つけます. + +$ edges[from] = [to1, to2, ...]$の形式で辺情報を与えてください + +## 使い方 +``` +isartic, bridge = lowLink(edges) +``` +isartic は各頂点が関節点かどうかを表す bool 列です. diff --git a/expansion/graph/maxflow.py.md b/expansion/graph/maxflow.py.md index b678754..0cccb0c 100644 --- a/expansion/graph/maxflow.py.md +++ b/expansion/graph/maxflow.py.md @@ -67,8 +67,20 @@ data: verifiedWith: [] documentation_of: expansion/graph/maxflow.py layout: document -redirect_from: -- /library/expansion/graph/maxflow.py -- /library/expansion/graph/maxflow.py.html -title: expansion/graph/maxflow.py +title: maxflow --- + +# 概要 +最大流です. + +Python のバージョン次第でコメントアウトしている `dataclass` が使えます. +`from` が Python の予約語なので,`from_` を用いています. + +## 使い方 +- \_\_init\_\_(n) := 頂点数 n でグラフを初期化します. +- add_edge(from_, to, cap) := u -> v の容量 cap の有向辺を追加します. +- get_edge(i) := i 番目に追加した辺の現在の状態を取得します. +- edges() := 現在の辺の状態を全て取得します. +- change_edge(i, new_cap, new_flow) := i 番目に追加した辺の状態を更新します +- flow(s, t, flow_limit=1 << 60) := s から t に最大で flow_limit の流量を流します.実際に流せた流量を返します. +- min_cut(s) := 頂点 s からたどり着けるかどうかを表した bool 配列を返します. diff --git a/expansion/math/Combination.py.md b/expansion/math/Combination.py.md index 2830e61..1579c4e 100644 --- a/expansion/math/Combination.py.md +++ b/expansion/math/Combination.py.md @@ -40,8 +40,16 @@ data: verifiedWith: [] documentation_of: expansion/math/Combination.py layout: document -redirect_from: -- /library/expansion/math/Combination.py -- /library/expansion/math/Combination.py.html -title: expansion/math/Combination.py +title: Combination --- + +# 概要 +素数 MOD の二項係数関連を求めます + +## 使い方 + +- \_\_init\_\_(n, MOD=998244353) := n の上限を指定します.(範囲外参照をしそうになると勝手に拡張してくれますが(fact, invfact を直接見る場合を除く),初めから十分な範囲を確保しておいた方が安心です.) +- nPk(n, k) := nPk(n, k) を求めます +- nCk(n, k) := nCk(n, k) を求めます +- nHk(n, k) := nHk(n, k) を求めます +- Catalan(n) := カタラン数を求めます. diff --git a/expansion/math/CombinationArbitrary.py.md b/expansion/math/CombinationArbitrary.py.md index 25dfaf9..64f88cc 100644 --- a/expansion/math/CombinationArbitrary.py.md +++ b/expansion/math/CombinationArbitrary.py.md @@ -88,8 +88,13 @@ data: verifiedWith: [] documentation_of: expansion/math/CombinationArbitrary.py layout: document -redirect_from: -- /library/expansion/math/CombinationArbitrary.py -- /library/expansion/math/CombinationArbitrary.py.html -title: expansion/math/CombinationArbitrary.py +title: CombinationArbitrary --- + +# 概要 +任意 MOD の二項係数を求めます + +## 使い方 + +- \_\_init\_\_(MOD, n=-1) := n の上限を指定します.MOD を素因数分解した結果の 各 $P_i ^ {e_i}$ について,$P_i ^ {e_i} \le n$ の場合,上限関係なくすべての値を求められます (-1 の場合これ) +- nCk(n, k) := nCk(n, k) を求めます diff --git a/expansion/math/Garner.py.md b/expansion/math/Garner.py.md index 9e6449c..a1b25fe 100644 --- a/expansion/math/Garner.py.md +++ b/expansion/math/Garner.py.md @@ -31,8 +31,16 @@ data: verifiedWith: [] documentation_of: expansion/math/Garner.py layout: document -redirect_from: -- /library/expansion/math/Garner.py -- /library/expansion/math/Garner.py.html -title: expansion/math/Garner.py +title: Garner --- + +# 概要 +$R = [R_1, R_2, \ldots]$, $M = [M_1, M_2, \ldots]$ + +が与えられたときに, +$x \% M_i = R_i$ を満たす x (なければ -1) と M の最小公倍数 を返します. + +## 使い方 +```python +x, m = Garner(R, M) +``` diff --git a/expansion/math/MillerRabin.py.md b/expansion/math/MillerRabin.py.md index cd1fbca..151e5ba 100644 --- a/expansion/math/MillerRabin.py.md +++ b/expansion/math/MillerRabin.py.md @@ -29,8 +29,13 @@ data: verifiedWith: [] documentation_of: expansion/math/MillerRabin.py layout: document -redirect_from: -- /library/expansion/math/MillerRabin.py -- /library/expansion/math/MillerRabin.py.html -title: expansion/math/MillerRabin.py +title: MillerRabin --- + +# 概要 +1 つの整数に対して素数判定をします. + +## 使い方 +``` +isprime = MillerRabin(n) +``` diff --git a/expansion/math/PollardRho.py.md b/expansion/math/PollardRho.py.md index 5f9859b..aa7892d 100644 --- a/expansion/math/PollardRho.py.md +++ b/expansion/math/PollardRho.py.md @@ -49,8 +49,14 @@ data: verifiedWith: [] documentation_of: expansion/math/PollardRho.py layout: document -redirect_from: -- /library/expansion/math/PollardRho.py -- /library/expansion/math/PollardRho.py.html -title: expansion/math/PollardRho.py +title: PollardRho --- + +# 概要 +素因数分解をします + +## 使い方 +```python +primes = primefact(n) // 素因数分解の結果を list で返す +primes = primedict(n) // 素因数分解の結果を dist で返す +``` diff --git a/expansion/math/Quotients.py.md b/expansion/math/Quotients.py.md index 6f42024..1a06974 100644 --- a/expansion/math/Quotients.py.md +++ b/expansion/math/Quotients.py.md @@ -24,8 +24,13 @@ data: verifiedWith: [] documentation_of: expansion/math/Quotients.py layout: document -redirect_from: -- /library/expansion/math/Quotients.py -- /library/expansion/math/Quotients.py.html -title: expansion/math/Quotients.py +title: Quotients --- + +# 概要 +各 $(x, l, r)$ が $(n // i) = x ~~ \forall i \in [l, r) $ を満たすような $[(x_i, l_i, r_i) \ldots]$ を列挙します + +## 使い方 +```python +quotients = Quotients(n) +``` diff --git a/expansion/math/TwoSAT.py.md b/expansion/math/TwoSAT.py.md index 38a28e5..028f798 100644 --- a/expansion/math/TwoSAT.py.md +++ b/expansion/math/TwoSAT.py.md @@ -65,8 +65,16 @@ data: verifiedWith: [] documentation_of: expansion/math/TwoSAT.py layout: document -redirect_from: -- /library/expansion/math/TwoSAT.py -- /library/expansion/math/TwoSAT.py.html -title: expansion/math/TwoSAT.py +title: 2SAT --- + +# 概要 +2SAT です. + +## 使い方 + +- \_\_init\_\_(n) := 変数の個数を n で初期化します. +- add_clause(i, pos_i, j, pos_j) := $(x_i == pos_i) \cup (x_j == pos_j)$ の条件を追加します. +- check() := 2SAT が充足可能かを判定します. +- assign() := 充足可能である場合,有効な割り当ての1つを返します.充足不 +可能な場合は未定義です. diff --git a/expansion/math/cipolla.py.md b/expansion/math/cipolla.py.md index fd7f03a..93cf228 100644 --- a/expansion/math/cipolla.py.md +++ b/expansion/math/cipolla.py.md @@ -29,8 +29,13 @@ data: verifiedWith: [] documentation_of: expansion/math/cipolla.py layout: document -redirect_from: -- /library/expansion/math/cipolla.py -- /library/expansion/math/cipolla.py.html -title: expansion/math/cipolla.py +title: cipolla --- + +# 概要 +$x ^ 2 \equiv y \pmod P$ を満たす x を返します. + +## 使い方 +```python +x = cipolla(y, P) +``` diff --git a/expansion/math/ext_gcd.py.md b/expansion/math/ext_gcd.py.md index f82831b..30eb975 100644 --- a/expansion/math/ext_gcd.py.md +++ b/expansion/math/ext_gcd.py.md @@ -23,8 +23,14 @@ data: verifiedWith: [] documentation_of: expansion/math/ext_gcd.py layout: document -redirect_from: -- /library/expansion/math/ext_gcd.py -- /library/expansion/math/ext_gcd.py.html -title: expansion/math/ext_gcd.py +title: ext_gcd --- + +# 概要 +$ax + by = gcd(a, b)$ を満たす $x, y, gcd(a, b)$ を返します. + + +## 使い方 +```python +x, y, g = ext_gcd(a, b) +``` diff --git a/expansion/math/floor_sum.py.md b/expansion/math/floor_sum.py.md index 6d25f01..9576249 100644 --- a/expansion/math/floor_sum.py.md +++ b/expansion/math/floor_sum.py.md @@ -27,8 +27,13 @@ data: verifiedWith: [] documentation_of: expansion/math/floor_sum.py layout: document -redirect_from: -- /library/expansion/math/floor_sum.py -- /library/expansion/math/floor_sum.py.html -title: expansion/math/floor_sum.py +title: floor_sum --- + +# 概要 +$\sum_{i=0}^{n-1} ((a*i+b)//m)$ を求めます + +## 使い方 +```python +res = floor_sum(n, m, a, b) +``` diff --git a/expansion/math/mat_exp.py.md b/expansion/math/mat_exp.py.md index a28ef0e..cc78652 100644 --- a/expansion/math/mat_exp.py.md +++ b/expansion/math/mat_exp.py.md @@ -29,8 +29,15 @@ data: verifiedWith: [] documentation_of: expansion/math/mat_exp.py layout: document -redirect_from: -- /library/expansion/math/mat_exp.py -- /library/expansion/math/mat_exp.py.html -title: expansion/math/mat_exp.py +title: "\u884C\u5217\u7D2F\u4E57" --- + +# 概要 +$n * n$ 行列 $A$,$n * 1$ 行列 $B$ が与えられたときに +$A^k B$ を求めます +ただし,B は 2 次元リストではなく, 1 次元リストで与えてください,($B'_i = B_{i, 0}$) + +## 使い方 +```python +C = mat_exp(A, B, MOD) +``` diff --git a/expansion/misc/Bitset.py.md b/expansion/misc/Bitset.py.md index 8e9fe33..10c4f73 100644 --- a/expansion/misc/Bitset.py.md +++ b/expansion/misc/Bitset.py.md @@ -117,8 +117,47 @@ data: verifiedWith: [] documentation_of: expansion/misc/Bitset.py layout: document -redirect_from: -- /library/expansion/misc/Bitset.py -- /library/expansion/misc/Bitset.py.html -title: expansion/misc/Bitset.py +title: Bitset --- + +# 概要 +C++ の bitset を真似したものです. + +## 使い方 +
std::bitset 対応表 + +[参考](https://cpprefjp.github.io/reference/bitset/bitset.html) + +| std::bitset | 自作Bitset | +| --- | --- | +| `operator&` | `__and__` | +| `operator&=` | `__iand__` | +| `operator\|` | `__or__` | +| `operator\|=` | `__ior__` | +| `operator^` | `__xor__` | +| `operator^=` | `__ixor__` | +| `operator<<` | `__lshift__` | +| `operator<<=` | `__ilshift__` | +| `operator>>` | `__rshift__` | +| `operator>>=` | `__irshift__` | +| `set` | `__setitem__(k=1)` | +| `reset()` | なし | +| `reset(size_t pos)` | `__setitem__(k=0)` | +| `operator~`, `flip()` | なし | +| `flip(size_t pos)` | `rev` | +| `operator[]` | `__getitem__` | +| `count` | `count`, `__sum__` | +| `size` | `__len__`, `.size` | +| `test` | `__getitem__` | +| `all` | `count == size` | +| `any` | `count != 0` | +| `none` | `count == 0` | +| `to_ulong`, `to_ullong` | なし | +| `to_string` | `__str__` | +| `operator==`, `operator!=` | なし | +| なし | `resize` | +| なし | `and_count` | +| なし | `or_count` | +| なし | `xor_count` | + +
diff --git a/expansion/misc/DeletableHeapq.py.md b/expansion/misc/DeletableHeapq.py.md index 2d4ea39..a5a65b3 100644 --- a/expansion/misc/DeletableHeapq.py.md +++ b/expansion/misc/DeletableHeapq.py.md @@ -43,8 +43,23 @@ data: verifiedWith: [] documentation_of: expansion/misc/DeletableHeapq.py layout: document -redirect_from: -- /library/expansion/misc/DeletableHeapq.py -- /library/expansion/misc/DeletableHeapq.py.html -title: expansion/misc/DeletableHeapq.py +title: "\u524A\u9664\u53EF\u80FD heapq" --- + +# 概要 +削除可能 heapq です.内部で hashDict を使っているので,hack 対策に rnd() を一様に足してあげると良いかもしれません + +## 使い方 + +- \_\_init\_\_(lst=None, reverse=False) := lstに要素を指定すると初期の配列を作ってくれます +reverse=Trueにすると最大値取得に,Falseにすると最小値取得になります. +- \_\_bool\_\_() := 現在の配列長が1以上かどうかを返します. +- \_\_len\_\_() :=現在の配列長を返します. +- top() := heapqの先頭の要素を返します.要素が1つもない場合,`None`を返します. +- \_\_getitem\_\_(i) := hq[0] で top()と同じものをかえします.hq[1]のように,index番号が0で無いケースは対応してません. +- push(x) := heapqにxを追加します. +- pop() := heapqの先頭の要素を削除し,返り値とします. +要素が1つもない場合,`None`を返します. +- remove(x) := heapqからxを削除します. +削除できた場合は`True`を, +削除できなかった場合($x$が存在しなかった場合)は`False`を返します. diff --git a/expansion/misc/FastIO.py.md b/expansion/misc/FastIO.py.md index 1311e6b..d00fd16 100644 --- a/expansion/misc/FastIO.py.md +++ b/expansion/misc/FastIO.py.md @@ -42,8 +42,10 @@ data: verifiedWith: [] documentation_of: expansion/misc/FastIO.py layout: document -redirect_from: -- /library/expansion/misc/FastIO.py -- /library/expansion/misc/FastIO.py.html -title: expansion/misc/FastIO.py +title: FastIO --- + +# 概要 +https://github.com/Tsuzat/fast-IO-for-python です. + +~~なんかめちゃくちゃ早かった記憶があったんですが,最近調べたら sys.stdin.readline とほとんど変わらなかったです~~ diff --git a/expansion/misc/MadianHeap.py.md b/expansion/misc/MadianHeap.py.md index 885ad71..1953795 100644 --- a/expansion/misc/MadianHeap.py.md +++ b/expansion/misc/MadianHeap.py.md @@ -60,8 +60,20 @@ data: verifiedWith: [] documentation_of: expansion/misc/MadianHeap.py layout: document -redirect_from: -- /library/expansion/misc/MadianHeap.py -- /library/expansion/misc/MadianHeap.py.html -title: expansion/misc/MadianHeap.py +title: "\u6570\u5217\u3092\u4E0A\u4F4D\u534A\u5206\u3068\u4E0B\u4F4D\u534A\u5206\u306B\ + \u5206\u3051\u3066\u4E2D\u592E\u5024\u3092\u7BA1\u7406\u3059\u308B\u3084\u3064" --- + +# 概要 +中央値を管理する用のものです.内部で hashDict を使っているので,hack 対策に rnd() を一様に足してあげると良いかもしれません + +## 使い方 + +- \_\_init\_\_(A=None) := Aに要素を指定すると初期の配列を作ってくれます +- \_\_len\_\_() :=現在の配列長を返します. +- push(x) := xを追加します. +- remove(x) := xを削除します.存在しない場合未定義です +- get_med(self) + - 数列長が奇数 (2n+1) の場合: 0-indexed で [A[n], A[n]] を返します. + - 数列長が偶数 (2n) の場合: 0-indexed で [A[n - 1], A[n]] を返します. +- abs_sum() := 「数列Aが与えられる.$\sum_{a \in A} |a-x|$ の最小値を求めろ」の答えを返します.x の値は get_med() の返り値がそのまま下限と上限です. diff --git a/expansion/misc/Mo.py.md b/expansion/misc/Mo.py.md index 8524a6c..c5a57af 100644 --- a/expansion/misc/Mo.py.md +++ b/expansion/misc/Mo.py.md @@ -35,8 +35,19 @@ data: verifiedWith: [] documentation_of: expansion/misc/Mo.py layout: document -redirect_from: -- /library/expansion/misc/Mo.py -- /library/expansion/misc/Mo.py.html -title: expansion/misc/Mo.py +title: Mo --- + +# 概要 +Mo algorithm です. +static な数列の区間クエリ Q 個に答えます. + +## 使い方 +- \_\_init\_\_(ope, n, Q) := 数列の長さとクエリ数を与えて初期化します.(数列自身は与えない想定) +- insert(l, r) := 区間[l, r) に対するクエリを追加します. +- run(add_left, add_right, delete_left, delete_right, rem) := 以下の 5 つの関数を定義して 追加した各クエリの答えを求めます. + - add_left(l) := 区間を [l, r) から [l - 1, r) にしたときの状態遷移を各関数 + - add_right(l) := 区間を [l, r) から [l, r + 1) にしたときの状態遷移を各関数 + - delete_left(l) := 区間を [l, r) から [l + 1, r) にしたときの状態遷移を各関数 + - delete_right(l) := 区間を [l, r) から [l, r - 1) にしたときの状態遷移を各関数 + - rem(i) := 区間 i の答えを記録する関数 diff --git a/expansion/misc/TopKHeap.py.md b/expansion/misc/TopKHeap.py.md index afb4825..46fdc5a 100644 --- a/expansion/misc/TopKHeap.py.md +++ b/expansion/misc/TopKHeap.py.md @@ -55,8 +55,17 @@ data: verifiedWith: [] documentation_of: expansion/misc/TopKHeap.py layout: document -redirect_from: -- /library/expansion/misc/TopKHeap.py -- /library/expansion/misc/TopKHeap.py.html -title: expansion/misc/TopKHeap.py +title: "\u6570\u5217\u3092\u4E0A\u4F4Dk\u500B\u3092\u7BA1\u7406\u3059\u308B\u3084\u3064" --- + +# 概要 +数列の(最大)上位 K 個を管理しておく用のやつです.内部で hashDict を使っているので,hack 対策に rnd() を一様に足してあげると良いかもしれません + +## 使い方 + +- \_\_init\_\_(K, reverse=False, A=None) := reverse=True にすると大きいほうから,False にすると小さいほうから K 個を管理します.Aに要素を指定すると初期の配列を作ってくれます +- \_\_len\_\_() :=現在の配列長を返します. +- tot := 上位 K 個の合計を返します. +- sum := 上位 K 個の合計を返します.(tot と同じ) +- push(x) := xを追加します. +- remove(x) := xを削除します.存在しない場合未定義です diff --git a/expansion/misc/make_popcount.py.md b/expansion/misc/make_popcount.py.md index 95489d4..9f936f5 100644 --- a/expansion/misc/make_popcount.py.md +++ b/expansion/misc/make_popcount.py.md @@ -29,8 +29,15 @@ data: verifiedWith: [] documentation_of: expansion/misc/make_popcount.py layout: document -redirect_from: -- /library/expansion/misc/make_popcount.py -- /library/expansion/misc/make_popcount.py.html -title: expansion/misc/make_popcount.py +title: make_popcount --- + +# 概要 +popcount を求めるための関数を出力します. + +## 使い方 + +``` +make_popcount(n) +``` +で n bit までの popcount を求めることができる関数を出力します. diff --git a/expansion/misc/next_permutation.py.md b/expansion/misc/next_permutation.py.md index 327b07a..cd18e41 100644 --- a/expansion/misc/next_permutation.py.md +++ b/expansion/misc/next_permutation.py.md @@ -38,8 +38,25 @@ data: verifiedWith: [] documentation_of: expansion/misc/next_permutation.py layout: document -redirect_from: -- /library/expansion/misc/next_permutation.py -- /library/expansion/misc/next_permutation.py.html -title: expansion/misc/next_permutation.py +title: next_permutation --- + +# 概要 +C++ にある next_permutation を真似して作ったやつです. + +## 使い方 + +### next_permutation(P) +P を与えた際に,P の並び替えのうち,辞書順で P の次に大きいものに変更して True を返します..存在しない場合,False を返します.破壊的変更を行います. + +### prev_permutation(P) +P を与えた際に,P の並び替えのうち,辞書順で P の次に小さいものに変更して True を返します..存在しない場合,False を返します.破壊的変更を行います. + +### all_permutations(P) +``` +for Q in all_permutations(P) +``` +とすると,P の並び替えのうち,P + P 寄りも辞書順で後ろのものを全て列挙します.Q に変更を加えると P 側にも変更が加わるので注意してください.回る順番は辞書順です. + +### rev_all_permutations(P) +`all_permutations` の逆順です. diff --git a/expansion/misc/popcount.py.md b/expansion/misc/popcount.py.md index 53180eb..4780f69 100644 --- a/expansion/misc/popcount.py.md +++ b/expansion/misc/popcount.py.md @@ -29,8 +29,18 @@ data: verifiedWith: [] documentation_of: expansion/misc/popcount.py layout: document -redirect_from: -- /library/expansion/misc/popcount.py -- /library/expansion/misc/popcount.py.html -title: expansion/misc/popcount.py +title: popcount --- + +# 概要 +popcount を求めます + +## 使い方 + +``` +pc = popcount32(bit) // 最大 32 bit 用 +``` + +``` +pc = popcount64(bit) // 最大 64 bit 用 +``` diff --git a/expansion/polynomial/BostanMori998.py.md b/expansion/polynomial/BostanMori998.py.md index 4c6cd42..1f876b7 100644 --- a/expansion/polynomial/BostanMori998.py.md +++ b/expansion/polynomial/BostanMori998.py.md @@ -102,8 +102,15 @@ data: verifiedWith: [] documentation_of: expansion/polynomial/BostanMori998.py layout: document -redirect_from: -- /library/expansion/polynomial/BostanMori998.py -- /library/expansion/polynomial/BostanMori998.py.html -title: expansion/polynomial/BostanMori998.py +title: BostanMori --- + +# 概要 +母関数 $\frac{P(x)}{Q(x)}$ の第`N`項を求めます. + +MOD 998244353 用のものしか作っていません.他の MOD にする場合は適当に変数を変更してください. + +## 使い方 +```python +ans = BostanMori(P, Q, n) +``` diff --git a/expansion/polynomial/FormalPowerSeries998.py.md b/expansion/polynomial/FormalPowerSeries998.py.md index 9b0c805..55ac6a0 100644 --- a/expansion/polynomial/FormalPowerSeries998.py.md +++ b/expansion/polynomial/FormalPowerSeries998.py.md @@ -194,8 +194,27 @@ data: verifiedWith: [] documentation_of: expansion/polynomial/FormalPowerSeries998.py layout: document -redirect_from: -- /library/expansion/polynomial/FormalPowerSeries998.py -- /library/expansion/polynomial/FormalPowerSeries998.py.html -title: expansion/polynomial/FormalPowerSeries998.py +title: FormalPowerSeries --- + +# 概要 +FormalPowerSeries です.MOD 998244353 用の者しか作っていません.他の MOD にする場合は適当に変数を変更してください. + +list を継承しているので,list に関する演算は割と使います.(オーバーライドしているものを除く) + +https://maspypy.com/%E5%A4%9A%E9%A0%85%E5%BC%8F%E3%83%BB%E5%BD%A2%E5%BC%8F%E7%9A%84%E3%81%B9%E3%81%8D%E7%B4%9A%E6%95%B0-%E9%AB%98%E9%80%9F%E3%81%AB%E8%A8%88%E7%AE%97%E3%81%A7%E3%81%8D%E3%82%8B%E3%82%82%E3%81%AE +https://nyaannyaan.github.io/library/fps/formal-power-series.hpp + + +## 使い方 +- \_\_init\_\_(n: int) := 長さ n,初期値 0 のリストで初期化します. +- \_\_init\_\_(A: list[int]) := A で初期化します.A の各要素が [0, MOD) に収まることを仮定しています. +- resize(n) := 長さを n に変更します. +- \_\_add\_\_, \_\_iadd\_\_, \_\_sub\_\_, \_\_isub\_\_, \_\_mul\_\_, \_\_imul\_\_, \_\_floordiv\_\_ := FPS における四則演算です +- inv() := $1/f$ を求めます. +- differential() := 微分します +- integral() := 積分します +- log() := $\log{f}$ を求めます +- exp() := $\exp{f}$ を求めます +- pow(k) := $f^n$ を求めます +- sqrt() := $g^2\equiv f$ を満たす$g$を求めます diff --git a/expansion/polynomial/berlekamp_massey.py.md b/expansion/polynomial/berlekamp_massey.py.md index e4a8a30..15ee98a 100644 --- a/expansion/polynomial/berlekamp_massey.py.md +++ b/expansion/polynomial/berlekamp_massey.py.md @@ -34,8 +34,15 @@ data: verifiedWith: [] documentation_of: expansion/polynomial/berlekamp_massey.py layout: document -redirect_from: -- /library/expansion/polynomial/berlekamp_massey.py -- /library/expansion/polynomial/berlekamp_massey.py.html -title: expansion/polynomial/berlekamp_massey.py +title: berlekamp_massey --- + +# 概要 +数列$A = [a_0, a_1, ...]$が与えられた時, + +$a_i \equiv \sum_{j=1}^d c_j a_{i-j} \pmod {\rm MOD}$を満たす長さ$d$の数列$C$を求めます.$d$は可能な限り最小なものを求めます. + +## 使い方 +```python +C = berlekamp_massey(A, MOD) +``` diff --git a/expansion/string/AhoCorasick.py.md b/expansion/string/AhoCorasick.py.md index d0372c1..48199df 100644 --- a/expansion/string/AhoCorasick.py.md +++ b/expansion/string/AhoCorasick.py.md @@ -42,8 +42,15 @@ data: verifiedWith: [] documentation_of: expansion/string/AhoCorasick.py layout: document -redirect_from: -- /library/expansion/string/AhoCorasick.py -- /library/expansion/string/AhoCorasick.py.html -title: expansion/string/AhoCorasick.py +title: AhoCorasick --- + +# 概要 +AhoCorasick です. + +## 使い方 +- \_\_init\_\_(words=None) := words を指定すると,それをあらかじめ登録してくれます. +- register(word) := word を登録します +- build() := 与えられた word を用いて王地区します. +- search(text) := 以下の2次元配列の形式で登録した word と match する箇所を返します. + - matched[i] := $[j_1, j_2, \ldots]$ ($j_1, j_2, \ldots$ はtext$[i:i+|word_j|] = words[j]$ であるもの全て) diff --git a/expansion/string/KMP.py.md b/expansion/string/KMP.py.md index 6e8d4c6..b9013a7 100644 --- a/expansion/string/KMP.py.md +++ b/expansion/string/KMP.py.md @@ -31,8 +31,14 @@ data: verifiedWith: [] documentation_of: expansion/string/KMP.py layout: document -redirect_from: -- /library/expansion/string/KMP.py -- /library/expansion/string/KMP.py.html -title: expansion/string/KMP.py +title: KMP --- + +# 概要 +KMP です. + +## 使い方 + +```python +res = kmp_search(text, word) +``` diff --git a/expansion/string/RollingHash.py.md b/expansion/string/RollingHash.py.md index 4d93882..94c24e5 100644 --- a/expansion/string/RollingHash.py.md +++ b/expansion/string/RollingHash.py.md @@ -38,8 +38,15 @@ data: verifiedWith: [] documentation_of: expansion/string/RollingHash.py layout: document -redirect_from: -- /library/expansion/string/RollingHash.py -- /library/expansion/string/RollingHash.py.html -title: expansion/string/RollingHash.py +title: RollingHash --- + +# 概要 +https://qiita.com/keymoon/items/11fac5627672a6d6a9f6 +MOD $2^{61} - 1$ のローリングハッシュです. + +## 使い方 + +- \_\_init\_\_(S) := 文字列Sにたいして初期化します. +- get(l, r) := 区間[l, r) の hash 値を取得します. + diff --git a/expansion/string/Z_algorithm.py.md b/expansion/string/Z_algorithm.py.md index 45cc1bc..393adf5 100644 --- a/expansion/string/Z_algorithm.py.md +++ b/expansion/string/Z_algorithm.py.md @@ -26,8 +26,14 @@ data: verifiedWith: [] documentation_of: expansion/string/Z_algorithm.py layout: document -redirect_from: -- /library/expansion/string/Z_algorithm.py -- /library/expansion/string/Z_algorithm.py.html -title: expansion/string/Z_algorithm.py +title: Z_algorithm --- + +# 概要 +Z_algorithm です. + +## 使い方 + +```python +res = Z_algorithm(S) +``` diff --git a/expansion/string/manacher.py.md b/expansion/string/manacher.py.md index 4f18d57..57f2633 100644 --- a/expansion/string/manacher.py.md +++ b/expansion/string/manacher.py.md @@ -27,8 +27,16 @@ data: verifiedWith: [] documentation_of: expansion/string/manacher.py layout: document -redirect_from: -- /library/expansion/string/manacher.py -- /library/expansion/string/manacher.py.html -title: expansion/string/manacher.py +title: manacher --- + +# 概要 +manacher です. + +(0-indexed で) 返り値の 2i 番目の値は i 番目の文字を中心とする回文の最大長を,2i + 1 番目の値は i 番目の文字と i + 1 番目の文字の区切れ目を中心とする回文の最大長です. + +## 使い方 + +```python +res = manacher(S) +``` diff --git a/expansion/string/suffix_array.py.md b/expansion/string/suffix_array.py.md index 62704b5..5c51b60 100644 --- a/expansion/string/suffix_array.py.md +++ b/expansion/string/suffix_array.py.md @@ -80,8 +80,17 @@ data: verifiedWith: [] documentation_of: expansion/string/suffix_array.py layout: document -redirect_from: -- /library/expansion/string/suffix_array.py -- /library/expansion/string/suffix_array.py.html -title: expansion/string/suffix_array.py +title: suffix_array, LCP --- + +# 概要 +suffix_array と LCP です. + +$NAIVE_THR$, $DOUBLING_THR$ は愚直でやるかダブリングでやるか sa-is でやるかの閾値です. +## 使い方 + +```python +sa = suffix_array(S, NAIVE_THR=10, DOUBLING_THR=40) + +lcp = lcp_array(S, sa) +``` diff --git a/expansion/string/wildcard_mathing.py.md b/expansion/string/wildcard_matching.py.md similarity index 94% rename from expansion/string/wildcard_mathing.py.md rename to expansion/string/wildcard_matching.py.md index d7f58ec..8c06739 100644 --- a/expansion/string/wildcard_mathing.py.md +++ b/expansion/string/wildcard_matching.py.md @@ -97,15 +97,24 @@ data: \n return res\n" dependsOn: [] isVerificationFile: false - path: expansion/string/wildcard_mathing.py + path: expansion/string/wildcard_matching.py requiredBy: [] - timestamp: '2023-07-17 18:11:17+09:00' + timestamp: '2023-07-29 13:32:11+09:00' verificationStatus: LIBRARY_NO_TESTS verifiedWith: [] -documentation_of: expansion/string/wildcard_mathing.py +documentation_of: expansion/string/wildcard_matching.py layout: document -redirect_from: -- /library/expansion/string/wildcard_mathing.py -- /library/expansion/string/wildcard_mathing.py.html -title: expansion/string/wildcard_mathing.py +title: wildcard_matching --- + +# 概要 +文字列のワイルドカード付マッチングです. + +MOD 998 の畳み込みを用いているので,非常に低い確率で落ちます. + +## 使い方 + +```python +res = wildcard_matching(S, T, wild="?") +``` +res[i] = True のとき,$S[i:i+|T|] = T$ です. diff --git a/expansion/tree/CartesianTree.py.md b/expansion/tree/CartesianTree.py.md index 1ddc17f..110d4e1 100644 --- a/expansion/tree/CartesianTree.py.md +++ b/expansion/tree/CartesianTree.py.md @@ -26,8 +26,15 @@ data: verifiedWith: [] documentation_of: expansion/tree/CartesianTree.py layout: document -redirect_from: -- /library/expansion/tree/CartesianTree.py -- /library/expansion/tree/CartesianTree.py.html -title: expansion/tree/CartesianTree.py +title: CartesianTree --- + +# 概要 +与えられた数列からCartesianTreeを求めます. +返り値は親の index 値を持つ形式(自分自身が親の場合,自分自身の index) + + +## 使い方 +``` +par = CartesianTree(A) +``` diff --git a/expansion/tree/CentroidDecomposition.py.md b/expansion/tree/CentroidDecomposition.py.md index 66bec44..d4dd630 100644 --- a/expansion/tree/CentroidDecomposition.py.md +++ b/expansion/tree/CentroidDecomposition.py.md @@ -77,8 +77,21 @@ data: verifiedWith: [] documentation_of: expansion/tree/CentroidDecomposition.py layout: document -redirect_from: -- /library/expansion/tree/CentroidDecomposition.py -- /library/expansion/tree/CentroidDecomposition.py.html -title: expansion/tree/CentroidDecomposition.py +title: CentroidDecomposition --- + +# 概要 +重心分解 です. + +## 使い方 + +- \_\_init\_\_(n, edges=None) := 頂点数 n で初期化します.辺情報を与える場合は,$ edges[from] = [to1, to2, ...]$の形式で与えてください. +- add_edge(u, v) := u -> v の有向辺を追加します. +- read_edges(indexed=1) := n - 1 辺の情報を標準入力として受け取ります. +- build(root) := 根を root として構築します +- cent_ind_dist(u) := 頂点 u + 重心分解木における u の各先祖の [頂点番号, u からの距離] を返します. + + + +- self.par := 重心分解木における各頂点の親です. +- self.centroids[i] := 重心分解木における深さがiの頂点の一覧です diff --git a/expansion/tree/HLD.py.md b/expansion/tree/HLD.py.md index a0d3088..268c5ff 100644 --- a/expansion/tree/HLD.py.md +++ b/expansion/tree/HLD.py.md @@ -73,8 +73,23 @@ data: verifiedWith: [] documentation_of: expansion/tree/HLD.py layout: document -redirect_from: -- /library/expansion/tree/HLD.py -- /library/expansion/tree/HLD.py.html -title: expansion/tree/HLD.py +title: HLD --- + +# 概要 +HLD です. + +## 使い方 + +- \_\_init\_\_(n, edges=None) := 頂点数 n で初期化します.辺情報を与える場合は,$ edges[from] = [to1, to2, ...]$の形式で与えてください +- add_edge(u, v) := u -> v の有向辺を追加します. +- read_edges(indexed=1) := n - 1 辺の情報を標準入力として受け取ります. +- build(root) := 根を root として構築します +- get_path(u, v) := 頂点 u-v 間のpath を返します. +- lca(u, v) := 頂点 u-v の LCA を求めます +- dist(u, v) := 頂点 u-v 間の距離を求めます +- reorder(A, rev=False) := 与えられた配列 A をdfs順序に並び替えます.rev=True の場合反転します + + + +- self.L := dfs の行きがけ順序です diff --git a/expansion/tree/Kruskal.py.md b/expansion/tree/Kruskal.py.md index d0e1716..1bfa3ec 100644 --- a/expansion/tree/Kruskal.py.md +++ b/expansion/tree/Kruskal.py.md @@ -36,8 +36,16 @@ data: verifiedWith: [] documentation_of: expansion/tree/Kruskal.py layout: document -redirect_from: -- /library/expansion/tree/Kruskal.py -- /library/expansion/tree/Kruskal.py.html -title: expansion/tree/Kruskal.py +title: Kruskal --- + +# 概要 +最小全域木の重み総和を求めます. + +$edges = [(from1, to1, cost1), (from2, to2, cost2), ...)]$の形式で辺情報を与えてください + +## 使い方 +``` +cost = Kruskal(n, edges, is_sorted=False) +``` +全体が連結でない場合は -1 を返します. diff --git a/expansion/tree/LCA.py.md b/expansion/tree/LCA.py.md index 33f9648..5f76a60 100644 --- a/expansion/tree/LCA.py.md +++ b/expansion/tree/LCA.py.md @@ -53,8 +53,19 @@ data: verifiedWith: [] documentation_of: expansion/tree/LCA.py layout: document -redirect_from: -- /library/expansion/tree/LCA.py -- /library/expansion/tree/LCA.py.html -title: expansion/tree/LCA.py +title: LCA --- + +# 概要 +LCA です. + +## 使い方 + +- \_\_init\_\_(n, root=0, edges=None) := 頂点数 n で初期化します.辺情報を与える場合は,$ edges[from] = [to1, to2, ...]$の形式で与えてください. +- add_edge(u, v) := u -> v の有向辺を追加します. +- read_edges(indexed=1) := n - 1 辺の情報を標準入力として受け取ります. +- build(root) := 根を root として構築します +- get_path(u, v) := 頂点 u-v 間のpath を返します. +- lca(u, v) := 頂点 u-v の LCA を求めます +- dist(u, v) := 頂点 u-v 間の距離を求めます +- jump(u, v, k) := 頂点 u から v の方向に k だけ移動した頂点を返します.ただし dist(u, v) < k の場合 -1 を返します. diff --git a/index.md b/index.md index 51681f8..5d79ae1 100644 --- a/index.md +++ b/index.md @@ -34,25 +34,25 @@ data: title: BIT - icon: '' path: expansion/data_structure/ConvexHullTrick.py - title: expansion/data_structure/ConvexHullTrick.py + title: ConvexHullTrick - icon: '' path: expansion/data_structure/DisjointSparseTable.py - title: expansion/data_structure/DisjointSparseTable.py + title: DisjointSparseTable - icon: '' path: expansion/data_structure/DisjointSparseTableBase_.py title: expansion/data_structure/DisjointSparseTableBase_.py - icon: '' path: expansion/data_structure/LazySegmentTree.py - title: expansion/data_structure/LazySegmentTree.py + title: LazySegmentTree - icon: '' path: expansion/data_structure/LazySegmentTreeBase_.py title: expansion/data_structure/LazySegmentTreeBase_.py - icon: '' path: expansion/data_structure/RollbackUnionFind.py - title: expansion/data_structure/RollbackUnionFind.py + title: RollbackUnionFind - icon: '' path: expansion/data_structure/SWAG.py - title: expansion/data_structure/SWAG.py + title: SWAG - icon: '' path: expansion/data_structure/SWAGBase_.py title: expansion/data_structure/SWAGBase_.py @@ -64,7 +64,7 @@ data: title: SegmentTreeBase_ - icon: '' path: expansion/data_structure/SparseTable.py - title: expansion/data_structure/SparseTable.py + title: SparseTable - icon: '' path: expansion/data_structure/SparseTableBase_.py title: expansion/data_structure/SparseTableBase_.py @@ -73,7 +73,7 @@ data: title: UnionFind - icon: '' path: expansion/data_structure/WeightedUnionFind.py - title: expansion/data_structure/WeightedUnionFind.py + title: WeightedUnionFind - name: expansion/data_structure/segtree_ pages: - icon: '' @@ -83,30 +83,30 @@ data: pages: - icon: '' path: expansion/geometry/arg_sort.py - title: expansion/geometry/arg_sort.py + title: "\u504F\u89D2\u30BD\u30FC\u30C8" - icon: '' path: expansion/geometry/convex_hull.py - title: expansion/geometry/convex_hull.py + title: "\u51F8\u5305" - name: expansion/graph pages: - icon: '' path: expansion/graph/Hungarian.py - title: expansion/graph/Hungarian.py + title: Hungarian - icon: '' path: expansion/graph/SCC.py - title: expansion/graph/SCC.py + title: SCC - icon: '' path: expansion/graph/bellmanFord.py - title: expansion/graph/bellmanFord.py + title: bellmanFord - icon: '' path: expansion/graph/dijkstra.py - title: expansion/graph/dijkstra.py + title: dijkstra - icon: '' path: expansion/graph/lowLink.py - title: expansion/graph/lowLink.py + title: lowLink - icon: '' path: expansion/graph/maxflow.py - title: expansion/graph/maxflow.py + title: maxflow - icon: '' path: expansion/graph/mincostflow.py title: expansion/graph/mincostflow.py @@ -114,40 +114,40 @@ data: pages: - icon: '' path: expansion/math/Combination.py - title: expansion/math/Combination.py + title: Combination - icon: '' path: expansion/math/CombinationArbitrary.py - title: expansion/math/CombinationArbitrary.py + title: CombinationArbitrary - icon: '' path: expansion/math/EnumeratePrimes.py title: expansion/math/EnumeratePrimes.py - icon: '' path: expansion/math/Garner.py - title: expansion/math/Garner.py + title: Garner - icon: '' path: expansion/math/MillerRabin.py - title: expansion/math/MillerRabin.py + title: MillerRabin - icon: '' path: expansion/math/PollardRho.py - title: expansion/math/PollardRho.py + title: PollardRho - icon: '' path: expansion/math/Quotients.py - title: expansion/math/Quotients.py + title: Quotients - icon: '' path: expansion/math/TwoSAT.py - title: expansion/math/TwoSAT.py + title: 2SAT - icon: '' path: expansion/math/cipolla.py - title: expansion/math/cipolla.py + title: cipolla - icon: '' path: expansion/math/ext_gcd.py - title: expansion/math/ext_gcd.py + title: ext_gcd - icon: '' path: expansion/math/floor_sum.py - title: expansion/math/floor_sum.py + title: floor_sum - icon: '' path: expansion/math/mat_exp.py - title: expansion/math/mat_exp.py + title: "\u884C\u5217\u7D2F\u4E57" - icon: '' path: expansion/math/mat_exp_global_mod.py title: expansion/math/mat_exp_global_mod.py @@ -158,45 +158,48 @@ data: pages: - icon: '' path: expansion/misc/Bitset.py - title: expansion/misc/Bitset.py + title: Bitset - icon: '' path: expansion/misc/DeletableHeapq.py - title: expansion/misc/DeletableHeapq.py + title: "\u524A\u9664\u53EF\u80FD heapq" - icon: '' path: expansion/misc/FastIO.py - title: expansion/misc/FastIO.py + title: FastIO - icon: '' path: expansion/misc/MadianHeap.py - title: expansion/misc/MadianHeap.py + title: "\u6570\u5217\u3092\u4E0A\u4F4D\u534A\u5206\u3068\u4E0B\u4F4D\u534A\u5206\ + \u306B\u5206\u3051\u3066\u4E2D\u592E\u5024\u3092\u7BA1\u7406\u3059\u308B\u3084\ + \u3064" - icon: '' path: expansion/misc/Mo.py - title: expansion/misc/Mo.py + title: Mo - icon: '' path: expansion/misc/MoBase_.py title: expansion/misc/MoBase_.py - icon: '' path: expansion/misc/TopKHeap.py - title: expansion/misc/TopKHeap.py + title: "\u6570\u5217\u3092\u4E0A\u4F4Dk\u500B\u3092\u7BA1\u7406\u3059\u308B\u3084\ + \u3064" - icon: '' path: expansion/misc/make_popcount.py - title: expansion/misc/make_popcount.py + title: make_popcount - icon: '' path: expansion/misc/next_permutation.py - title: expansion/misc/next_permutation.py + title: next_permutation - icon: '' path: expansion/misc/popcount.py - title: expansion/misc/popcount.py + title: popcount - name: expansion/polynomial pages: - icon: '' path: expansion/polynomial/BostanMori998.py - title: expansion/polynomial/BostanMori998.py + title: BostanMori - icon: '' path: expansion/polynomial/FormalPowerSeries998.py - title: expansion/polynomial/FormalPowerSeries998.py + title: FormalPowerSeries - icon: '' path: expansion/polynomial/berlekamp_massey.py - title: expansion/polynomial/berlekamp_massey.py + title: berlekamp_massey - icon: '' path: expansion/polynomial/berlekamp_massey_global_mod.py title: expansion/polynomial/berlekamp_massey_global_mod.py @@ -204,42 +207,42 @@ data: pages: - icon: '' path: expansion/string/AhoCorasick.py - title: expansion/string/AhoCorasick.py + title: AhoCorasick - icon: '' path: expansion/string/KMP.py - title: expansion/string/KMP.py + title: KMP - icon: '' path: expansion/string/RollingHash.py - title: expansion/string/RollingHash.py + title: RollingHash - icon: '' path: expansion/string/Z_algorithm.py - title: expansion/string/Z_algorithm.py + title: Z_algorithm - icon: '' path: expansion/string/manacher.py - title: expansion/string/manacher.py + title: manacher - icon: '' path: expansion/string/suffix_array.py - title: expansion/string/suffix_array.py + title: suffix_array, LCP - icon: '' - path: expansion/string/wildcard_mathing.py - title: expansion/string/wildcard_mathing.py + path: expansion/string/wildcard_matching.py + title: wildcard_matching - name: expansion/tree pages: - icon: '' path: expansion/tree/CartesianTree.py - title: expansion/tree/CartesianTree.py + title: CartesianTree - icon: '' path: expansion/tree/CentroidDecomposition.py - title: expansion/tree/CentroidDecomposition.py + title: CentroidDecomposition - icon: '' path: expansion/tree/HLD.py - title: expansion/tree/HLD.py + title: HLD - icon: '' path: expansion/tree/Kruskal.py - title: expansion/tree/Kruskal.py + title: Kruskal - icon: '' path: expansion/tree/LCA.py - title: expansion/tree/LCA.py + title: LCA - name: . pages: - icon: '' @@ -468,8 +471,8 @@ data: path: src/string/suffix_array.py title: src/string/suffix_array.py - icon: '' - path: src/string/wildcard_mathing.py - title: src/string/wildcard_mathing.py + path: src/string/wildcard_matching.py + title: src/string/wildcard_matching.py - name: src/tree pages: - icon: '' @@ -646,8 +649,8 @@ data: path: expansion/$tests/math/mat_pow.test.py title: expansion/$tests/math/mat_pow.test.py - icon: '' - path: expansion/$tests/math/mat_pow_gloabal_mod.test.py - title: expansion/$tests/math/mat_pow_gloabal_mod.test.py + path: expansion/$tests/math/mat_pow_global_mod.test.py + title: expansion/$tests/math/mat_pow_global_mod.test.py - name: expansion/$tests/misc pages: - icon: '' @@ -715,8 +718,8 @@ data: path: expansion/$tests/string/suffix_array.test.py title: expansion/$tests/string/suffix_array.test.py - icon: '' - path: expansion/$tests/string/wildcard_mathing.test.py - title: expansion/$tests/string/wildcard_mathing.test.py + path: expansion/$tests/string/wildcard_matching.test.py + title: expansion/$tests/string/wildcard_matching.test.py - name: expansion/$tests/tree pages: - icon: '' @@ -732,8 +735,8 @@ data: path: expansion/$tests/tree/HLD_lca.test.py title: expansion/$tests/tree/HLD_lca.test.py - icon: '' - path: expansion/$tests/tree/JumoOnTree.test.py - title: expansion/$tests/tree/JumoOnTree.test.py + path: expansion/$tests/tree/JumpOnTree.test.py + title: expansion/$tests/tree/JumpOnTree.test.py - icon: '' path: expansion/$tests/tree/Kruskal.test.py title: expansion/$tests/tree/Kruskal.test.py @@ -898,8 +901,8 @@ data: path: src/$tests/math/mat_pow.test.py title: src/$tests/math/mat_pow.test.py - icon: '' - path: src/$tests/math/mat_pow_gloabal_mod.test.py - title: src/$tests/math/mat_pow_gloabal_mod.test.py + path: src/$tests/math/mat_pow_global_mod.test.py + title: src/$tests/math/mat_pow_global_mod.test.py - name: src/$tests/misc pages: - icon: '' @@ -967,8 +970,8 @@ data: path: src/$tests/string/suffix_array.test.py title: src/$tests/string/suffix_array.test.py - icon: '' - path: src/$tests/string/wildcard_mathing.test.py - title: src/$tests/string/wildcard_mathing.test.py + path: src/$tests/string/wildcard_matching.test.py + title: src/$tests/string/wildcard_matching.test.py - name: src/$tests/tree pages: - icon: '' @@ -984,8 +987,8 @@ data: path: src/$tests/tree/HLD_lca.test.py title: src/$tests/tree/HLD_lca.test.py - icon: '' - path: src/$tests/tree/JumoOnTree.test.py - title: src/$tests/tree/JumoOnTree.test.py + path: src/$tests/tree/JumpOnTree.test.py + title: src/$tests/tree/JumpOnTree.test.py - icon: '' path: src/$tests/tree/Kruskal.test.py title: src/$tests/tree/Kruskal.test.py diff --git a/src/$tests/math/mat_pow_gloabal_mod.test.py.md b/src/$tests/math/mat_pow_global_mod.test.py.md similarity index 83% rename from src/$tests/math/mat_pow_gloabal_mod.test.py.md rename to src/$tests/math/mat_pow_global_mod.test.py.md index 5b516dc..27a6a3a 100644 --- a/src/$tests/math/mat_pow_gloabal_mod.test.py.md +++ b/src/$tests/math/mat_pow_global_mod.test.py.md @@ -25,15 +25,15 @@ data: dependsOn: - src/math/mat_exp_global_mod.py isVerificationFile: true - path: src/$tests/math/mat_pow_gloabal_mod.test.py + path: src/$tests/math/mat_pow_global_mod.test.py requiredBy: [] - timestamp: '2023-07-23 08:45:17+09:00' + timestamp: '2023-07-29 13:32:11+09:00' verificationStatus: TEST_WRONG_ANSWER verifiedWith: [] -documentation_of: src/$tests/math/mat_pow_gloabal_mod.test.py +documentation_of: src/$tests/math/mat_pow_global_mod.test.py layout: document redirect_from: -- /verify/src/$tests/math/mat_pow_gloabal_mod.test.py -- /verify/src/$tests/math/mat_pow_gloabal_mod.test.py.html -title: src/$tests/math/mat_pow_gloabal_mod.test.py +- /verify/src/$tests/math/mat_pow_global_mod.test.py +- /verify/src/$tests/math/mat_pow_global_mod.test.py.html +title: src/$tests/math/mat_pow_global_mod.test.py --- diff --git a/src/$tests/misc/Mo.test.py.md b/src/$tests/misc/Mo.test.py.md index aac86af..a527b5c 100644 --- a/src/$tests/misc/Mo.test.py.md +++ b/src/$tests/misc/Mo.test.py.md @@ -34,8 +34,8 @@ data: \n\ndef rem(i):\n ans[i] = inv\n\n\nmo.run(add_left, add_right, delete_left,\ \ delete_right, rem)\nprint(*ans, sep=\"\\n\")\n" dependsOn: - - src/misc/Mo.py - src/data_structure/BIT.py + - src/misc/Mo.py isVerificationFile: true path: src/$tests/misc/Mo.test.py requiredBy: [] diff --git a/src/$tests/polynomial/BostanMori.test.py.md b/src/$tests/polynomial/BostanMori.test.py.md index 9adbf06..ff81831 100644 --- a/src/$tests/polynomial/BostanMori.test.py.md +++ b/src/$tests/polynomial/BostanMori.test.py.md @@ -50,8 +50,8 @@ data: ' dependsOn: - - src/convolution/NTT998.py - src/polynomial/BostanMori998.py + - src/convolution/NTT998.py isVerificationFile: true path: src/$tests/polynomial/BostanMori.test.py requiredBy: [] diff --git a/src/$tests/string/wildcard_mathing.test.py.md b/src/$tests/string/wildcard_matching.test.py.md similarity index 85% rename from src/$tests/string/wildcard_mathing.test.py.md rename to src/$tests/string/wildcard_matching.test.py.md index b16087b..e2dd293 100644 --- a/src/$tests/string/wildcard_mathing.test.py.md +++ b/src/$tests/string/wildcard_matching.test.py.md @@ -5,8 +5,8 @@ data: path: src/string/RollingHash.py title: src/string/RollingHash.py - icon: '' - path: src/string/wildcard_mathing.py - title: src/string/wildcard_mathing.py + path: src/string/wildcard_matching.py + title: src/string/wildcard_matching.py _extendedRequiredBy: [] _extendedVerifiedWith: [] _isVerificationFailed: true @@ -21,7 +21,7 @@ data: , line 108, in bundle\n raise NotImplementedError\nNotImplementedError\n" code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/2231\nfrom\ \ pathlib import Path\nimport sys\n\nsys.path.append(str(Path(__file__).resolve().parent.parent.parent.parent))\n\ - \nfrom src.string.RollingHash import RollingHash\nfrom src.string.wildcard_mathing\ + \nfrom src.string.RollingHash import RollingHash\nfrom src.string.wildcard_matching\ \ import wildcard_matching\n\n\ndef solve():\n n, m = map(int, input().split())\n\ \ S = list(input())\n T = list(input())\n res = wildcard_matching(S,\ \ T)\n if not res:\n print(-1)\n return\n\n for i in range(n):\n\ @@ -39,18 +39,18 @@ data: \ ind = res[i]\n\n for i in range(m):\n S[i + ind] = T[i]\n print(*S,\ \ sep=\"\")\n\n\nfor _ in range(int(input())):\n solve()\n" dependsOn: - - src/string/wildcard_mathing.py - src/string/RollingHash.py + - src/string/wildcard_matching.py isVerificationFile: true - path: src/$tests/string/wildcard_mathing.test.py + path: src/$tests/string/wildcard_matching.test.py requiredBy: [] - timestamp: '2023-07-23 08:45:17+09:00' + timestamp: '2023-07-29 13:32:11+09:00' verificationStatus: TEST_WRONG_ANSWER verifiedWith: [] -documentation_of: src/$tests/string/wildcard_mathing.test.py +documentation_of: src/$tests/string/wildcard_matching.test.py layout: document redirect_from: -- /verify/src/$tests/string/wildcard_mathing.test.py -- /verify/src/$tests/string/wildcard_mathing.test.py.html -title: src/$tests/string/wildcard_mathing.test.py +- /verify/src/$tests/string/wildcard_matching.test.py +- /verify/src/$tests/string/wildcard_matching.test.py.html +title: src/$tests/string/wildcard_matching.test.py --- diff --git a/src/$tests/tree/HLD.test.py.md b/src/$tests/tree/HLD.test.py.md index 9d0fce6..8a25ab0 100644 --- a/src/$tests/tree/HLD.test.py.md +++ b/src/$tests/tree/HLD.test.py.md @@ -30,8 +30,8 @@ data: \ v):\n l = G.L[l]\n r = G.L[r]\n if l > r:\n\ \ l, r = r, l\n ans += bit.sum(l, r + 1)\n print(ans)\n" dependsOn: - - src/tree/HLD.py - src/data_structure/BIT.py + - src/tree/HLD.py isVerificationFile: true path: src/$tests/tree/HLD.test.py requiredBy: [] diff --git a/src/$tests/tree/JumoOnTree.test.py.md b/src/$tests/tree/JumpOnTree.test.py.md similarity index 83% rename from src/$tests/tree/JumoOnTree.test.py.md rename to src/$tests/tree/JumpOnTree.test.py.md index 7e24762..1c4908e 100644 --- a/src/$tests/tree/JumoOnTree.test.py.md +++ b/src/$tests/tree/JumpOnTree.test.py.md @@ -24,15 +24,15 @@ data: dependsOn: - src/tree/LCA.py isVerificationFile: true - path: src/$tests/tree/JumoOnTree.test.py + path: src/$tests/tree/JumpOnTree.test.py requiredBy: [] - timestamp: '2023-07-23 08:45:17+09:00' + timestamp: '2023-07-29 13:32:11+09:00' verificationStatus: TEST_WRONG_ANSWER verifiedWith: [] -documentation_of: src/$tests/tree/JumoOnTree.test.py +documentation_of: src/$tests/tree/JumpOnTree.test.py layout: document redirect_from: -- /verify/src/$tests/tree/JumoOnTree.test.py -- /verify/src/$tests/tree/JumoOnTree.test.py.html -title: src/$tests/tree/JumoOnTree.test.py +- /verify/src/$tests/tree/JumpOnTree.test.py +- /verify/src/$tests/tree/JumpOnTree.test.py.html +title: src/$tests/tree/JumpOnTree.test.py --- diff --git a/src/convolution/NTT998.py.md b/src/convolution/NTT998.py.md index 23ad37f..6db6aba 100644 --- a/src/convolution/NTT998.py.md +++ b/src/convolution/NTT998.py.md @@ -9,8 +9,8 @@ data: path: src/polynomial/FormalPowerSeries998.py title: src/polynomial/FormalPowerSeries998.py - icon: '' - path: src/string/wildcard_mathing.py - title: src/string/wildcard_mathing.py + path: src/string/wildcard_matching.py + title: src/string/wildcard_matching.py _extendedVerifiedWith: - icon: '' path: src/$tests/convolution/NTT998.test.py @@ -100,7 +100,7 @@ data: isVerificationFile: false path: src/convolution/NTT998.py requiredBy: - - src/string/wildcard_mathing.py + - src/string/wildcard_matching.py - src/polynomial/FormalPowerSeries998.py - src/polynomial/BostanMori998.py timestamp: '2023-07-17 17:18:40+09:00' diff --git a/src/math/mat_exp_global_mod.py.md b/src/math/mat_exp_global_mod.py.md index 7e3f1e9..0a6940f 100644 --- a/src/math/mat_exp_global_mod.py.md +++ b/src/math/mat_exp_global_mod.py.md @@ -4,8 +4,8 @@ data: _extendedRequiredBy: [] _extendedVerifiedWith: - icon: '' - path: src/$tests/math/mat_pow_gloabal_mod.test.py - title: src/$tests/math/mat_pow_gloabal_mod.test.py + path: src/$tests/math/mat_pow_global_mod.test.py + title: src/$tests/math/mat_pow_global_mod.test.py _isVerificationFailed: true _pathExtension: py attributes: @@ -29,7 +29,7 @@ data: timestamp: '2023-07-16 19:41:28+09:00' verificationStatus: LIBRARY_ALL_WA verifiedWith: - - src/$tests/math/mat_pow_gloabal_mod.test.py + - src/$tests/math/mat_pow_global_mod.test.py documentation_of: src/math/mat_exp_global_mod.py layout: document redirect_from: diff --git a/src/polynomial/FormalPowerSeries998.py.md b/src/polynomial/FormalPowerSeries998.py.md index 31cc08f..a5597a4 100644 --- a/src/polynomial/FormalPowerSeries998.py.md +++ b/src/polynomial/FormalPowerSeries998.py.md @@ -111,8 +111,8 @@ data: \ l = 1\n while l < deg:\n l *= 2\n g = (g\ \ + self[:l] * g.inv(l)) * inv2\n del g[l:]\n\n return g[:deg]\n" dependsOn: - - src/math/modinv.py - src/convolution/NTT998.py + - src/math/modinv.py - src/math/Combination.py - src/math/cipolla.py isVerificationFile: false diff --git a/src/string/RollingHash.py.md b/src/string/RollingHash.py.md index 7c878d4..42bd221 100644 --- a/src/string/RollingHash.py.md +++ b/src/string/RollingHash.py.md @@ -7,8 +7,8 @@ data: path: src/$tests/string/RollingHash.test.py title: src/$tests/string/RollingHash.test.py - icon: '' - path: src/$tests/string/wildcard_mathing.test.py - title: src/$tests/string/wildcard_mathing.test.py + path: src/$tests/string/wildcard_matching.test.py + title: src/$tests/string/wildcard_matching.test.py _isVerificationFailed: true _pathExtension: py attributes: @@ -43,7 +43,7 @@ data: timestamp: '2023-06-12 00:17:20+09:00' verificationStatus: LIBRARY_ALL_WA verifiedWith: - - src/$tests/string/wildcard_mathing.test.py + - src/$tests/string/wildcard_matching.test.py - src/$tests/string/RollingHash.test.py documentation_of: src/string/RollingHash.py layout: document diff --git a/src/string/wildcard_mathing.py.md b/src/string/wildcard_matching.py.md similarity index 84% rename from src/string/wildcard_mathing.py.md rename to src/string/wildcard_matching.py.md index e44e321..d78b08e 100644 --- a/src/string/wildcard_mathing.py.md +++ b/src/string/wildcard_matching.py.md @@ -7,8 +7,8 @@ data: _extendedRequiredBy: [] _extendedVerifiedWith: - icon: '' - path: src/$tests/string/wildcard_mathing.test.py - title: src/$tests/string/wildcard_mathing.test.py + path: src/$tests/string/wildcard_matching.test.py + title: src/$tests/string/wildcard_matching.test.py _isVerificationFailed: true _pathExtension: py attributes: @@ -35,16 +35,16 @@ data: dependsOn: - src/convolution/NTT998.py isVerificationFile: false - path: src/string/wildcard_mathing.py + path: src/string/wildcard_matching.py requiredBy: [] - timestamp: '2023-07-17 18:11:17+09:00' + timestamp: '2023-07-29 13:32:11+09:00' verificationStatus: LIBRARY_ALL_WA verifiedWith: - - src/$tests/string/wildcard_mathing.test.py -documentation_of: src/string/wildcard_mathing.py + - src/$tests/string/wildcard_matching.test.py +documentation_of: src/string/wildcard_matching.py layout: document redirect_from: -- /library/src/string/wildcard_mathing.py -- /library/src/string/wildcard_mathing.py.html -title: src/string/wildcard_mathing.py +- /library/src/string/wildcard_matching.py +- /library/src/string/wildcard_matching.py.html +title: src/string/wildcard_matching.py --- diff --git a/src/tree/LCA.py.md b/src/tree/LCA.py.md index 77768e4..e5badae 100644 --- a/src/tree/LCA.py.md +++ b/src/tree/LCA.py.md @@ -4,8 +4,8 @@ data: _extendedRequiredBy: [] _extendedVerifiedWith: - icon: '' - path: src/$tests/tree/JumoOnTree.test.py - title: src/$tests/tree/JumoOnTree.test.py + path: src/$tests/tree/JumpOnTree.test.py + title: src/$tests/tree/JumpOnTree.test.py - icon: '' path: src/$tests/tree/LCA.test.py title: src/$tests/tree/LCA.test.py @@ -58,7 +58,7 @@ data: verificationStatus: LIBRARY_ALL_WA verifiedWith: - src/$tests/tree/LCA.test.py - - src/$tests/tree/JumoOnTree.test.py + - src/$tests/tree/JumpOnTree.test.py documentation_of: src/tree/LCA.py layout: document redirect_from: