Skip to content

Commit

Permalink
suffix tree; fix doc/test bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
old-yan committed Dec 23, 2023
1 parent 348ffb7 commit 7445a4b
Show file tree
Hide file tree
Showing 102 changed files with 1,782 additions and 285 deletions.
1 change: 0 additions & 1 deletion DS/Accumulator.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@
```c++
#include "DS/Accumulator.h"
#include "IO/FastIO.h"

#include "TEST/std_gcd_lcm.h"

int main() {
Expand Down
4 changes: 3 additions & 1 deletion DS/AdjDiff.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

​ 练习题目:

1. [P2367 语文成绩](https://www.luogu.com.cn/problem/P2367)
1. [Best Reward](https://acm.hdu.edu.cn/showproblem.php?pid=3613)
2. [P2367 语文成绩](https://www.luogu.com.cn/problem/P2367)


### 二、模板功能

Expand Down
6 changes: 3 additions & 3 deletions DS/AdjDiff2D.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

​ 练习题目:

1. [T332686 二维差分](https://www.luogu.com.cn/problem/T332686)
2. [T271585 【模板】二维前缀和](https://www.luogu.com.cn/problem/T271585)
3. [T275009 【模板】二维差分](https://www.luogu.com.cn/problem/T275009)
1. [T271585 【模板】二维前缀和](https://www.luogu.com.cn/problem/T271585)
2. [T275009 【模板】二维差分](https://www.luogu.com.cn/problem/T275009)
3. [T332686 二维差分](https://www.luogu.com.cn/problem/T332686)
4. [U223961 差分矩阵](https://www.luogu.com.cn/problem/U223961)


Expand Down
6 changes: 4 additions & 2 deletions DS/BIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

​ 练习题目:

1. [P3374 【模板】树状数组 1](https://www.luogu.com.cn/problem/P3374)
1. [940. 不同的子序列 II](https://leetcode.cn/problems/distinct-subsequences-ii)
2. [P3368 【模板】树状数组 2](https://www.luogu.com.cn/problem/P3368)
3. [U187320 【模板】树状数组 3](https://www.luogu.com.cn/problem/U187320)
3. [P3374 【模板】树状数组 1](https://www.luogu.com.cn/problem/P3374)
4. [P4178 Tree](https://www.luogu.com.cn/problem/P4178)
5. [U187320 【模板】树状数组 3](https://www.luogu.com.cn/problem/U187320)

### 二、模板功能

Expand Down
8 changes: 4 additions & 4 deletions DS/BIT2d.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

​ 练习题目:

1. [P4514 上帝造题的七分钟](https://www.luogu.com.cn/problem/P4514)
2. [#133. 二维树状数组 1:单点修改,区间查询](https://loj.ac/p/133)
3. [#134. 二维树状数组 2:区间修改,单点查询](https://loj.ac/p/134)
4. [#135. 二维树状数组 3:区间修改,区间查询](https://loj.ac/p/135)
1. [#133. 二维树状数组 1:单点修改,区间查询](https://loj.ac/p/133)
2. [#134. 二维树状数组 2:区间修改,单点查询](https://loj.ac/p/134)
3. [#135. 二维树状数组 3:区间修改,区间查询](https://loj.ac/p/135)
4. [P4514 上帝造题的七分钟](https://www.luogu.com.cn/problem/P4514)

### 二、模板功能

Expand Down
7 changes: 5 additions & 2 deletions DS/FHQTreap.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

1. [P3369 【模板】普通平衡树](https://www.luogu.com.cn/problem/P3369)
2. [P3391 【模板】文艺平衡树](https://www.luogu.com.cn/problem/P3391)
3. [P6136 【模板】普通平衡树(数据加强版)](https://www.luogu.com.cn/problem/P6136)
4. [P5494 【模板】线段树分裂](https://www.luogu.com.cn/problem/P5494)
3. [P3809 【模板】后缀排序](https://www.luogu.com.cn/problem/P3809)
4. [P4036 [JSOI2008] 火星人](https://www.luogu.com.cn/problem/P4036)
5. [P4070 [SDOI2016] 生成魔咒](https://www.luogu.com.cn/problem/P4070)
6. [P5494 【模板】线段树分裂](https://www.luogu.com.cn/problem/P5494)
7. [P6136 【模板】普通平衡树(数据加强版)](https://www.luogu.com.cn/problem/P6136)

### 二、模板功能

Expand Down
4 changes: 3 additions & 1 deletion DS/IntegerSet.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

​ 练习题目:

1. [U156719 Dynamic Predecessor Problem](https://www.luogu.com.cn/problem/U156719)
1. [Hotaru's problem](https://acm.hdu.edu.cn/showproblem.php?pid=5371)
2. [P4070 [SDOI2016] 生成魔咒](https://www.luogu.com.cn/problem/P4070)
3. [U156719 Dynamic Predecessor Problem](https://www.luogu.com.cn/problem/U156719)

### 二、模板功能

Expand Down
6 changes: 3 additions & 3 deletions DS/Leftist.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

​ 练习题目:

1. [P3377 【模板】左偏树(可并堆)](https://www.luogu.com.cn/problem/P3377)
2. [P3378 【模板】](https://www.luogu.com.cn/problem/P3378)
3. [P3261 [JLOI2015] 城池攻占](https://www.luogu.com.cn/problem/P3261)
1. [P3261 [JLOI2015] 城池攻占](https://www.luogu.com.cn/problem/P3261)
2. [P3377 【模板】左偏树(可并堆)](https://www.luogu.com.cn/problem/P3377)
3. [P3378 【模板】堆](https://www.luogu.com.cn/problem/P3378)

### 二、模板功能

Expand Down
11 changes: 9 additions & 2 deletions DS/LinkBucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@

​ 练习题目:

1. [P3261 [JLOI2015] 城池攻占](https://www.luogu.com.cn/problem/P3261)
1. [Hotaru's problem](https://acm.hdu.edu.cn/showproblem.php?pid=5371)
2. [P3261 [JLOI2015] 城池攻占](https://www.luogu.com.cn/problem/P3261)
3. [P4151 [WC2011] 最大XOR和路径](https://www.luogu.com.cn/problem/P4151)
4. [P4211 [LNOI2014] LCA](https://www.luogu.com.cn/problem/P4211)
5. [P4556 [Vani有约会] 雨天的尾巴 /【模板】线段树合并](https://www.luogu.com.cn/problem/P4556)
6. [P5287 [HNOI2019] JOJO](https://www.luogu.com.cn/problem/P5287)
7. [#515. 【UR #19】前进四](https://uoj.ac/problem/515)



### 二、模板功能

Expand Down Expand Up @@ -117,7 +125,6 @@ int main() {
cout << '\n';
}
}

```

```
Expand Down
14 changes: 12 additions & 2 deletions DS/MaskRMQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@

​ 练习题目:

1. [P3865 【模板】ST 表](https://www.luogu.com.cn/problem/P3865)
2. [P3793 由乃救爷爷](https://www.luogu.com.cn/problem/P3793)
1. [P2495 [SDOI2011] 消耗战](https://www.luogu.com.cn/problem/P2495)
2. [P3128 [USACO15DEC] Max Flow P](https://www.luogu.com.cn/problem/P3128)
3. [P3258 [JLOI2014] 松鼠的新家](https://www.luogu.com.cn/problem/P3258)
4. [P3379 【模板】最近公共祖先(LCA)](https://www.luogu.com.cn/problem/P3379)
5. [P3793 由乃救爷爷](https://www.luogu.com.cn/problem/P3793)
6. [P3865 【模板】ST 表](https://www.luogu.com.cn/problem/P3865)
7. [P4103 [HEOI2014] 大工程](https://www.luogu.com.cn/problem/P4103)
8. [P4556 [Vani有约会] 雨天的尾巴 /【模板】线段树合并](https://www.luogu.com.cn/problem/P4556)





### 二、模板功能

Expand Down
4 changes: 2 additions & 2 deletions DS/PersistentBiTrie.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

​ 练习题目:

1. [P4735 最大异或和](https://www.luogu.com.cn/problem/P4735)
1. [2935. 找出强数对的最大异或值 II](https://leetcode.cn/problems/maximum-strong-pair-xor-ii/)
2. [P4735 最大异或和](https://www.luogu.com.cn/problem/P4735)

2. [2935. 找出强数对的最大异或值 II](https://leetcode.cn/problems/maximum-strong-pair-xor-ii/)


### 二、模板功能
Expand Down
6 changes: 3 additions & 3 deletions DS/PersistentSegTree.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

​ 练习题目:

1. [P3835 【模板】可持久化平衡树](https://www.luogu.com.cn/problem/P3835)
2. [P3919 【模板】可持久化线段树 1(可持久化数组)](https://www.luogu.com.cn/problem/P3919)
3. [P3834 【模板】可持久化线段树 2](https://www.luogu.com.cn/problem/P3834)
1. [P3834 【模板】可持久化线段树 2](https://www.luogu.com.cn/problem/P3834)
2. [P3835 【模板】可持久化平衡树](https://www.luogu.com.cn/problem/P3835)
3. [P3919 【模板】可持久化线段树 1(可持久化数组)](https://www.luogu.com.cn/problem/P3919)

### 二、模板功能

Expand Down
4 changes: 2 additions & 2 deletions DS/PersistentUnionFind.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ int main() {
cout << u2 << '\n';

auto u3 = u2.copy();
u3.unite_by_size(7, 8);
u3.unite_by_size(9, 10);
u3.unite_by_size(6, 7);
u3.unite_by_size(8, 9);
u3.unite_by_size(7, 8);
cout << u3 << '\n';

auto u4 = u.copy();
Expand Down
4 changes: 2 additions & 2 deletions DS/SegBIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

​ 练习题目:

1. [P3834 【模板】可持久化线段树 2](https://www.luogu.com.cn/problem/P3834)
1. [P2617 Dynamic Rankings](https://www.luogu.com.cn/problem/P2617)
2. [P3380 【模板】二逼平衡树(树套树)](https://www.luogu.com.cn/problem/P3380)
3. [P2617 Dynamic Rankings](https://www.luogu.com.cn/problem/P2617)
3. [P3834 【模板】可持久化线段树 2](https://www.luogu.com.cn/problem/P3834)

### 二、模板功能

Expand Down
12 changes: 8 additions & 4 deletions DS/SegTree.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

​ 练习题目:

1. [P3372 【模板】线段树 1](https://www.luogu.com.cn/problem/P3372)
2. [P3373 【模板】线段树 2](https://www.luogu.com.cn/problem/P3373)
3. [P5494 【模板】线段树分裂](https://www.luogu.com.cn/problem/P5494)
4. [P3369 【模板】普通平衡树](https://www.luogu.com.cn/problem/P3369)
1. [P3369 【模板】普通平衡树](https://www.luogu.com.cn/problem/P3369)
2. [P3372 【模板】线段树 1](https://www.luogu.com.cn/problem/P3372)
3. [P3373 【模板】线段树 2](https://www.luogu.com.cn/problem/P3373)
4. [P3865 【模板】ST 表](https://www.luogu.com.cn/problem/P3865)
5. [P4556 [Vani有约会] 雨天的尾巴 /【模板】线段树合并](https://www.luogu.com.cn/problem/P4556)
6. [P4560 [IOI2014] Wall 砖墙](https://www.luogu.com.cn/problem/P4560)
7. [P5494 【模板】线段树分裂](https://www.luogu.com.cn/problem/P5494)


### 二、模板功能

Expand Down
4 changes: 2 additions & 2 deletions DS/SegTree2d.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

​ 练习题目:

1. [P3834 【模板】可持久化线段树 2](https://www.luogu.com.cn/problem/P3834)
1. [P2617 Dynamic Rankings](https://www.luogu.com.cn/problem/P2617)
2. [P3380 【模板】二逼平衡树(树套树)](https://www.luogu.com.cn/problem/P3380)
3. [P2617 Dynamic Rankings](https://www.luogu.com.cn/problem/P2617)
3. [P3834 【模板】可持久化线段树 2](https://www.luogu.com.cn/problem/P3834)

### 二、模板功能

Expand Down
22 changes: 12 additions & 10 deletions DS/SegmentBeat.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@

​ 练习题目:

1. [Gorgeous Sequence](http://acm.hdu.edu.cn/showproblem.php?pid=5306)
2. [P4145 上帝造题的七分钟 2 / 花神游历各国](https://www.luogu.com.cn/problem/P4145)
3. [P6242 【模板】线段树 3](https://www.luogu.com.cn/problem/P6242)
4. [U180387 CTSN loves segment tree](https://www.luogu.com.cn/problem/U180387)
5. [#6029. 「雅礼集训 2017 Day1」市场](https://loj.ac/p/6029)
6. [#169. 【UR #11】元旦老人与数列](https://uoj.ac/problem/169)
7. [#170. Picks loves segment tree VIII](https://uoj.ac/problem/170)
8. [#228. 基础数据结构练习题](https://uoj.ac/problem/228)
9. [#515. 【UR #19】前进四](https://uoj.ac/problem/515)
10. [And or Max](https://csacademy.com/contest/round-70/task/and-or-max/statistics/)
1. [And or Max](https://csacademy.com/contest/round-70/task/and-or-max/statistics/)
2. [Gorgeous Sequence](http://acm.hdu.edu.cn/showproblem.php?pid=5306)
3. [#6029. 「雅礼集训 2017 Day1」市场](https://loj.ac/p/6029)
4. [#6565. 最假女选手](https://loj.ac/p/6565)
5. [P4145 上帝造题的七分钟 2 / 花神游历各国](https://www.luogu.com.cn/problem/P4145)
6. [P4314 CPU 监控](https://www.luogu.com.cn/problem/P4314)
7. [P6242 【模板】线段树 3](https://www.luogu.com.cn/problem/P6242)
8. [U180387 CTSN loves segment tree](https://www.luogu.com.cn/problem/U180387)
9. [#169. 【UR #11】元旦老人与数列](https://uoj.ac/problem/169)
10. [#170. Picks loves segment tree VIII](https://uoj.ac/problem/170)
11. [#228. 基础数据结构练习题](https://uoj.ac/problem/228)
12. [#515. 【UR #19】前进四](https://uoj.ac/problem/515)

### 二、模板功能

Expand Down
5 changes: 2 additions & 3 deletions DS/SqrtTree.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

​ 练习题目:

1. [P3865 【模板】ST 表](https://www.luogu.com.cn/problem/P3865)
2. [P3793 由乃救爷爷](https://www.luogu.com.cn/problem/P3793)
1. [P3793 由乃救爷爷](https://www.luogu.com.cn/problem/P3793)
2. [P3865 【模板】ST 表](https://www.luogu.com.cn/problem/P3865)

### 二、模板功能

Expand Down Expand Up @@ -339,7 +339,6 @@ right = 2
124999750000
125000250000
125000750000
11 211 470
```

3 changes: 3 additions & 0 deletions DS/UnionFind.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
​ 练习题目:

1. [P3367 【模板】并查集](https://www.luogu.com.cn/problem/P3367)
2. [P3377 【模板】左偏树(可并堆)](https://www.luogu.com.cn/problem/P3377)
3. [P3379 【模板】最近公共祖先(LCA)](https://www.luogu.com.cn/problem/P3379)


### 二、模板功能

Expand Down
8 changes: 5 additions & 3 deletions DS/WaveLet.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

​ 练习题目:

1. [P3834 【模板】可持久化线段树 2](https://www.luogu.com.cn/problem/P3834)
2. [P3865 【模板】ST 表](https://www.luogu.com.cn/problem/P3865)
3. [2935. 找出强数对的最大异或值 II](https://leetcode.cn/problems/maximum-strong-pair-xor-ii/)
1. [2935. 找出强数对的最大异或值 II](https://leetcode.cn/problems/maximum-strong-pair-xor-ii/)
2. [P3834 【模板】可持久化线段树 2](https://www.luogu.com.cn/problem/P3834)
3. [P3865 【模板】ST 表](https://www.luogu.com.cn/problem/P3865)
4. [P4094 [HEOI2016/TJOI2016] 字符串](https://www.luogu.com.cn/problem/P4094)


### 二、模板功能

Expand Down
5 changes: 4 additions & 1 deletion DS/ZkwTree.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

1. [P3372 【模板】线段树 1](https://www.luogu.com.cn/problem/P3372)
2. [P3373 【模板】线段树 2](https://www.luogu.com.cn/problem/P3373)
3. [P4560 [IOI2014] Wall 砖墙](https://www.luogu.com.cn/problem/P4560)
3. [P3865 【模板】ST 表](https://www.luogu.com.cn/problem/P3865)
4. [P4094 [HEOI2016/TJOI2016] 字符串](https://www.luogu.com.cn/problem/P4094)
5. [P4560 [IOI2014] Wall 砖墙](https://www.luogu.com.cn/problem/P4560)


### 二、模板功能

Expand Down
7 changes: 6 additions & 1 deletion DS/ZkwTree2d.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

​ 练习题目:

1. [Check Corners](http://acm.hdu.edu.cn/showproblem.php?pid=2888)
1. [Luck and Love](https://acm.hdu.edu.cn/showproblem.php?pid=1823)
2. [Check Corners](http://acm.hdu.edu.cn/showproblem.php?pid=2888)
3. [Mosaic](https://acm.hdu.edu.cn/showproblem.php?pid=4819)
4. [P2216 [HAOI2007] 理想的正方形](https://www.luogu.com.cn/problem/P2216)



### 二、模板功能

Expand Down
3 changes: 2 additions & 1 deletion GRAPH/BFS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
​ 练习题目:

1. [P1443 马的遍历](https://www.luogu.com.cn/problem/P1443)
2. [P7293 [USACO21JAN] Sum of Distances P](https://www.luogu.com.cn/problem/P7293)


### 二、模板功能
Expand Down Expand Up @@ -172,7 +173,7 @@ void test_solver() {
adj[5].push_back(6);

// 直接建一个可追溯最短路的解答器
OY::BFS::Solver<true, 1000> sol(7);
OY::BFS::Solver<true, 1000> sol(7, 9);
sol.set_distance(0, 0);
// 传递一个遍历边的泛型回调
sol.run([&](int from, auto call) {
Expand Down
4 changes: 2 additions & 2 deletions GRAPH/Dinic.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void test_with_source_and_target() {
cout << "from " << e.m_from << " to " << e.m_to << ": " << flow << endl;
});
cout<<"\nminimum flow from 2 to 3: "<<G.min_flow()<<endl;
cout << "\nminimum flow from 2 to 3: " << G.min_flow() << endl;
G.do_for_flows([&](int i, int flow) {
auto &&e = G.m_graph.m_edges[i];
cout << "from " << e.m_from << " to " << e.m_to << ": " << flow << endl;
Expand All @@ -288,7 +288,7 @@ void test_with_source_and_target() {
G.clear();
G.is_possible();
cout<<"\nmaximum flow from 2 to 3: "<<G.max_flow()<<endl;
cout << "\nmaximum flow from 2 to 3: " << G.max_flow() << endl;
G.do_for_flows([&](int i, int flow) {
auto &&e = G.m_graph.m_edges[i];
cout << "from " << e.m_from << " to " << e.m_to << ": " << flow << endl;
Expand Down
8 changes: 4 additions & 4 deletions GRAPH/Dinic_mcmf.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

​ 练习题目:

1. [P3381 【模板】最小费用最大流](https://www.luogu.com.cn/problem/P3381)
2. [P4553 80人环游世界](https://www.luogu.com.cn/problem/P4553)
3. [P7173 【模板】有负圈的费用流](https://www.luogu.com.cn/problem/P7173)
4. [#102. 最小费用流](https://loj.ac/p/102)
1. [#102. 最小费用流](https://loj.ac/p/102)
2. [P3381 【模板】最小费用最大流](https://www.luogu.com.cn/problem/P3381)
3. [P4553 80人环游世界](https://www.luogu.com.cn/problem/P4553)
4. [P7173 【模板】有负圈的费用流](https://www.luogu.com.cn/problem/P7173)


### 二、模板功能
Expand Down
8 changes: 4 additions & 4 deletions GRAPH/EdmondsKarp_mcmf.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

​ 练习题目:

1. [P3381 【模板】最小费用最大流](https://www.luogu.com.cn/problem/P3381)
2. [P4553 80人环游世界](https://www.luogu.com.cn/problem/P4553)
3. [P7173 【模板】有负圈的费用流](https://www.luogu.com.cn/problem/P7173)
4. [#102. 最小费用流](https://loj.ac/p/102)
1. [#102. 最小费用流](https://loj.ac/p/102)
2. [P3381 【模板】最小费用最大流](https://www.luogu.com.cn/problem/P3381)
3. [P4553 80人环游世界](https://www.luogu.com.cn/problem/P4553)
4. [P7173 【模板】有负圈的费用流](https://www.luogu.com.cn/problem/P7173)


### 二、模板功能
Expand Down
Loading

0 comments on commit 7445a4b

Please sign in to comment.