正文
增加 1 行删除 1 行
108 行未改动全部展开1091101111121131141151161171181191201211221238 行未改动108 行未改动全部展开- 极小 $\operatorname{mex}$ 区间只有 $\mathcal{O}(n)$ 个。例题:[P9970](https://www.luogu.com.cn/problem/P9970),[P13693](https://www.luogu.com.cn/problem/P13693)。- 序列本质不同 $cnt$ 个数是 $\mathcal{O}(\sqrt{n})$ 级别的。例题:[P13688](https://www.luogu.com.cn/problem/P13688),[P5072](https://www.luogu.com.cn/problem/P5072)。- 排列问题可以从逆排列入手。例题:[CF2129D](https://codeforces.com/problemset/problem/2129/D),[P3200](https://www.luogu.com.cn/problem/P3200)。- 直方图问题可以建笛卡尔树解决。例题:[P6453](https://www.luogu.com.cn/problem/P6453),[AGC026D](https://atcoder.jp/contests/agc026/tasks/agc026_d),[P7219](https://www.luogu.com.cn/problem/P7219)。- 将字符串 $s$ 排成 $s'=s_1s_ns_2s_{n-1}\cdots s_ns_1$ 可以将 $s$ 的 border 转化成 $s'$ 的左端点在开头处的偶回文串。例题:[P14380](https://www.luogu.com.cn/problem/P14830),[P3546](https://www.luogu.com.cn/problem/P3546)。## 字符串- 平方串(也就是形如 $XX$ 的串)相关问题,考虑枚举 $|X|=len$,在字符串中每隔 $len$ 个位置放一个断点,这样每个长度为 $2len$ 的平方串都会经过恰好 $2$ 个断点,把问题转化为相邻段的 LCP 相关。例题:[P1117](https://www.luogu.com.cn/problem/P1117),[CF319D](https://codeforces.com/problemset/problem/319/D)。- 字符串子串比较可以用 Hash 二分求出 LCP,在 LCP 后一位比较,从而做到 $\mathcal{O}(\log{n})$ 比较,常数较小。- 一个字符串的所有排名在 $[L,R]$ 中的后缀的本质不同前缀个数为 $\sum\limits_{i=L}^r(n-sa_i+1)-\sum\limits_{i=L+1}^Rht_i$。例题:[P4143](https://www.luogu.com.cn/problem/P4143),[P3181](https://www.luogu.com.cn/problem/P3181),[P4248](https://www.luogu.com.cn/problem/P4248)。## 计算几何- 一次函数 $\min/\max$ 考虑维护凸壳。例题:[P12569](https://www.luogu.com.cn/problem/P12569)。8 行未改动108 行未改动全部展开1091101111121131141151161171181191201211221238 行未改动108 行未改动全部展开- 极小 $\operatorname{mex}$ 区间只有 $\mathcal{O}(n)$ 个。例题:[P9970](https://www.luogu.com.cn/problem/P9970),[P13693](https://www.luogu.com.cn/problem/P13693)。- 序列本质不同 $cnt$ 个数是 $\mathcal{O}(\sqrt{n})$ 级别的。例题:[P13688](https://www.luogu.com.cn/problem/P13688),[P5072](https://www.luogu.com.cn/problem/P5072)。- 排列问题可以从逆排列入手。例题:[CF2129D](https://codeforces.com/problemset/problem/2129/D),[P3200](https://www.luogu.com.cn/problem/P3200)。- 直方图问题可以建笛卡尔树解决。例题:[P6453](https://www.luogu.com.cn/problem/P6453),[AGC026D](https://atcoder.jp/contests/agc026/tasks/agc026_d),[P7219](https://www.luogu.com.cn/problem/P7219)。## 字符串- 平方串(也就是形如 $XX$ 的串)相关问题,考虑枚举 $|X|=len$,在字符串中每隔 $len$ 个位置放一个断点,这样每个长度为 $2len$ 的平方串都会经过恰好 $2$ 个断点,把问题转化为相邻段的 LCP 相关。例题:[P1117](https://www.luogu.com.cn/problem/P1117),[CF319D](https://codeforces.com/problemset/problem/319/D)。- 字符串子串比较可以用 Hash 二分求出 LCP,在 LCP 后一位比较,从而做到 $\mathcal{O}(\log{n})$ 比较,常数较小。- 一个字符串的所有排名在 $[L,R]$ 中的后缀的本质不同前缀个数为 $\sum\limits_{i=L}^r(n-sa_i+1)-\sum\limits_{i=L+1}^Rht_i$。例题:[P4143](https://www.luogu.com.cn/problem/P4143),[P3181](https://www.luogu.com.cn/problem/P3181),[P4248](https://www.luogu.com.cn/problem/P4248)。- 将字符串 $s$ 排成 $s'=s_1s_ns_2s_{n-1}\cdots s_ns_1$ 可以将 $s$ 的 border 转化成 $s'$ 的左端点在开头处的偶回文串。例题:[P14380](https://www.luogu.com.cn/problem/P14830),[P3546](https://www.luogu.com.cn/problem/P3546)。## 计算几何- 一次函数 $\min/\max$ 考虑维护凸壳。例题:[P12569](https://www.luogu.com.cn/problem/P12569)。8 行未改动