04 2021 档案
摘要:字符串abcbc的后缀自动机: endpos: 表示结束位置的集合。 a b c b c 1 2 3 4 5 b: [2, 4], b: [3, 5] == bc: [3, 5],所以b和bc是等价类 后缀自动机所有结点的数量 ≤ 2 * n - 1。 abcbc等价类: 画aababa的等价类图
阅读全文
摘要:#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N = 1e5 + 10, INF = 1e9; int n, m, delta;
阅读全文
摘要:splay、treap、set、红黑树、avl、B树 splay: 平衡二叉树,经过左旋和右旋操作,不会改变中序遍历的顺序。维护的是二叉树的一个中序序列,同时调整树的高度。 右旋要变的信息: 在插入和查询操作x的时候,都会把x变到树根的位置。 核心:每操作一个节点,均将该节点旋转到树根。一个点用到的
阅读全文
摘要:【2488. 树套树-简单版】 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <set> using namespace std; const int N = 5e4 +
阅读全文