正文
增加 138 行删除 138 行
3 行未改动4567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073 行未改动- ## 排序算法1、快速排序2、归并排序3、堆排序4、基数排序- ## 字符串1、哈希与哈希表2、KMP- Problem & Code:① [P3375 【模板】KMP](https://www.luogu.com.cn/problem/P3375) & [Code](https://www.luogu.com.cn/paste/9gglhbl6)② [P4391 [BOI2009] Radio Transmission 无线传输](https://www.luogu.com.cn/problem/P4391) & [Code](https://www.luogu.com.cn/paste/s0dk36xz)③ [P2375 [NOI2014] 动物园](https://www.luogu.com.cn/problem/P2375) & [Code](https://www.luogu.com.cn/paste/lkb57st8)- Blog:① [KMP 详解好文](https://zhuanlan.zhihu.com/p/576363046)3、Trie 字典树- Problem & Code:① [P8306 【模板】字典树](https://www.luogu.com.cn/problem/P8306) & [Code](https://www.luogu.com.cn/paste/20ls3672)② [P3879 [TJOI2010] 阅读理解](https://www.luogu.com.cn/problem/P3879) & [Code](https://www.luogu.com.cn/paste/48h971ny)4、AC 自动机- Problem & Code:① [P3808 【模板】AC 自动机(简单版)](https://www.luogu.com.cn/problem/P3808) & [Code](https://www.luogu.com.cn/paste/8hdz1k9i)② [P5357 【模板】AC 自动机(二次加强版)](https://www.luogu.com.cn/problem/P5357) & [Code](https://www.luogu.com.cn/paste/njmkdtkl)5、manacher 算法- ## 数据结构1、单调队列- Problem & Code:① [P1886 滑动窗口 /【模板】单调队列](https://www.luogu.com.cn/problem/P1886) & [Code](https://www.luogu.com.cn/paste/4hai8rj2)② [P2216 [HAOI2007] 理想的正方形](https://www.luogu.com.cn/problem/P2216) & [Code](https://www.luogu.com.cn/paste/o1wk1jz9)2、ST 表- Problem & Code:① [P3865 【模板】ST 表](https://www.luogu.com.cn/problem/P3865) & [Code](https://www.luogu.com.cn/paste/wwhhkeay)② [P2216 [HAOI2007] 理想的正方形](https://www.luogu.com.cn/problem/P2216) & [Code](https://www.luogu.com.cn/paste/q2sps19d)3、树状数组- Problem & Code:① [P3374 【模板】树状数组 1](https://www.luogu.com.cn/problem/P3374) & [Code](https://www.luogu.com.cn/paste/nztavrgb)② [P3368 【模板】树状数组 2](https://www.luogu.com.cn/problem/P3368) & [Code](https://www.luogu.com.cn/paste/wdrh5d4f)4、线段树- Problem & Code:① [P3372 【模板】线段树 1](https://www.luogu.com.cn/problem/P3372) & [Code](https://www.luogu.com.cn/paste/inb2uc0e)② [P3373 【模板】线段树 2](https://www.luogu.com.cn/problem/P3373) & [Code](https://www.luogu.com.cn/paste/vqdp75gk)③ [GSS3 - Can you answer these queries III](https://www.luogu.com.cn/problem/SP1716) & [Code](https://www.luogu.com.cn/paste/q2sps19d)④ [CF1146E Hot is Cold](https://www.luogu.com.cn/problem/CF1146E) & [Code](https://www.luogu.com.cn/paste/4b9110qj)5、分块- Problem & Code:① [P3372 【模板】线段树 1](https://www.luogu.com.cn/problem/P3372) & [Code](https://www.luogu.com.cn/paste/f85pya6o)② [P2801 教主的魔法](https://www.luogu.com.cn/problem/P2801) & [Code](https://www.luogu.com.cn/paste/fg4ymuq1)6、莫队- Problem & Code:① [SP3267 DQUERY - D-query](https://www.luogu.com.cn/problem/SP3267) & [Code](https://www.luogu.com.cn/paste/7un5xskb)② [P1903 [国家集训队] 数颜色 / 维护队列](https://www.luogu.com.cn/problem/P1903) & [Code](https://www.luogu.com.cn/paste/z5xa2ihc)7、平衡树- Problem & Code:① [(Treap)P3369 【模板】普通平衡树](https://www.luogu.com.cn/problem/P3369) & [Code](https://www.luogu.com.cn/paste/5lrsxr5f)② Splay & [Code](https://www.luogu.com.cn/paste/kmqvatlw)③ [P3391 【模板】文艺平衡树](https://www.luogu.com.cn/problem/P3391) & [Code](https://www.luogu.com.cn/paste/kpqzsxj1)8、主席树- Problem & Code:① [P3919 【模板】可持久化线段树 1(可持久化数组)](https://www.luogu.com.cn/problem/P3919) & [Code](https://www.luogu.com.cn/paste/q3a3bw4z)② [P3834 【模板】可持久化线段树 2](https://www.luogu.com.cn/problem/P3834) & [Code](https://www.luogu.com.cn/paste/v9u2luai)③ 区修区查主席树 & [Code](https://www.luogu.com.cn/paste/ds6kaloy)9、树套树- Problem & Code:① [P2617 Dynamic Rankings](https://www.luogu.com.cn/problem/P2617) & [Code](https://www.luogu.com.cn/paste/q3a3bw4z)② 待补- ## 图论1、建图与存图2、并查集- Problem & Code:① [P3367 【模板】并查集](https://www.luogu.com.cn/problem/P3367) & [Code](https://www.luogu.com.cn/paste/d21feef9)3、最小生成树- Problem & Code:① [P3366 【模板】最小生成树](https://www.luogu.com.cn/problem/P3366) & [Code](https://www.luogu.com.cn/paste/pkociux6)② [P1967 [NOIP2013 提高组] 货车运输](https://www.luogu.com.cn/problem/P1967) & [Code](https://www.luogu.com.cn/paste/oqjgzr1d)4、最短路- Problem & Code:① [(Dijkstra)P4779 【模板】单源最短路径(标准版)](https://www.luogu.com.cn/problem/P4779) & [Code](https://www.luogu.com.cn/paste/rx3fhlk3)② Bellman_Ford & [Code](https://www.luogu.com.cn/paste/7djw8hl0)③ SPFA & [Code](https://www.luogu.com.cn/paste/fz2idpiz)5、差分约束- Problem & Code:① [P5960 【模板】差分约束](https://www.luogu.com.cn/problem/P5960) & [Code](https://www.luogu.com.cn/paste/0ehc3j7n)6、负环- Problem & Code:① [P3385 【模板】负环](https://www.luogu.com.cn/problem/P3385) & [Code](https://www.luogu.com.cn/paste/93f2759d)7、拓扑排序- Problem & Code:① [B3644 【模板】拓扑排序 / 家谱树](https://www.luogu.com.cn/problem/B3644)② [P1347 排序](https://www.luogu.com.cn/problem/P1347) & [Code](https://www.luogu.com.cn/paste/weostkbw)③ [P3243 [HNOI2015] 菜肴制作](https://www.luogu.com.cn/problem/P3243) & [Code](https://www.luogu.com.cn/paste/wnr9x19i)8、强连通分量与缩点- Problem & Code:① [P8435 【模板】边双连通分量](https://www.luogu.com.cn/problem/P8436) & [Code](https://www.luogu.com.cn/paste/cz2mkap7)② [P8435 【模板】点双连通分量](https://www.luogu.com.cn/problem/P8435)③ [P3387 【模板】缩点](https://www.luogu.com.cn/problem/P3387) & [Code](https://www.luogu.com.cn/paste/g5eylfdw)9、割点与桥- Problem & Code:① [P3388 【模板】割点(割顶)](https://www.luogu.com.cn/problem/P3388) & [Code](https://www.luogu.com.cn/paste/89encd73)② 桥 & [Code](https://www.luogu.com.cn/paste/pbnznk3u)10、欧拉回路11、二分图匹配- Problem & Code:① [P3386 【模板】二分图最大匹配](https://www.luogu.com.cn/problem/P3386) & [Code](https://www.luogu.com.cn/paste/r6inzvc3)12、2-SAT- Problem & Code:① [P4782 【模板】2-SAT](https://www.luogu.com.cn/problem/P4782) & [Code](https://www.luogu.com.cn/paste/rx25pvf6)- ## 树论1、树的直径与重心- Problem & Code:① [(树的重心)P1395 会议](https://www.luogu.com.cn/problem/P1395) & [Code](https://www.luogu.com.cn/paste/fn2rpqvh)- Blog:① [树的重心](https://zhuanlan.zhihu.com/p/357938161)2、最近公共祖先(LCA)- Problem & Code:① [(倍增)P3379 【模板】最近公共祖先(LCA)](https://www.luogu.com.cn/problem/P3379) & [Code](https://www.luogu.com.cn/paste/d36ub812)② (重链剖分)LCA & [Code](https://www.luogu.com.cn/paste/w21hwkxc)3、树上差分- Problem & Code:① [(树上点差分)P3128 [USACO15DEC] Max Flow P](https://www.luogu.com.cn/problem/P3128) & [Code](https://www.luogu.com.cn/paste/yuqjvg98)4、01 Trie- Problem & Code:① [P4551 最长异或路径](https://www.luogu.com.cn/problem/P4551) & [Code](https://www.luogu.com.cn/paste/lvt61cls)5、笛卡尔树- Problem & Code:① [P5854 【模板】笛卡尔树](https://www.luogu.com.cn/problem/P5854) & [Code](https://www.luogu.com.cn/paste/tu7g0ies)② [P1377 [TJOI2011] 树的序](https://www.luogu.com.cn/problem/P1377) & [Code](https://www.luogu.com.cn/paste/f5440vpb)6、树链剖分 / 重链剖分- Problem & Code:① [P3384 【模板】重链剖分/树链剖分](https://www.luogu.com.cn/problem/P3384) & [Code](https://www.luogu.com.cn/paste/riamnk0a)② [GSS7 - Can you answer these queries VII](https://www.luogu.com.cn/problem/SP6779) & [Code](https://www.luogu.com.cn/paste/1tf5y29r)7、点分治- ## 数论1、线性筛2、最大公约数(gcd)3、快速幂4、裴蜀定理5、扩展欧几里得(exgcd)6、乘法逆元7、矩阵加速8、组合数学基础9、中国剩余定理- ## 动态规划1、背包九讲2、线性 dp3、区间 dp4、树形 dp5、状压 dp6、数位 dp7、动态规划的优化- ## 其他1、离散化2、三分3、bitset 优化3 行未改动4567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073 行未改动- ## 排序算法1、快速排序2、归并排序3、堆排序4、基数排序- ## 字符串1、哈希与哈希表2、KMP- Problem & Code:① [P3375 【模板】KMP](https://www.luogu.com.cn/problem/P3375) & [Code](https://www.luogu.com.cn/paste/9gglhbl6)② [P4391 [BOI2009] Radio Transmission 无线传输](https://www.luogu.com.cn/problem/P4391) & [Code](https://www.luogu.com.cn/paste/s0dk36xz)③ [P2375 [NOI2014] 动物园](https://www.luogu.com.cn/problem/P2375) & [Code](https://www.luogu.com.cn/paste/lkb57st8)- Blog:① [KMP 详解好文](https://zhuanlan.zhihu.com/p/576363046)3、Trie 字典树- Problem & Code:① [P8306 【模板】字典树](https://www.luogu.com.cn/problem/P8306) & [Code](https://www.luogu.com.cn/paste/20ls3672)② [P3879 [TJOI2010] 阅读理解](https://www.luogu.com.cn/problem/P3879) & [Code](https://www.luogu.com.cn/paste/48h971ny)4、AC 自动机- Problem & Code:① [P3808 【模板】AC 自动机(简单版)](https://www.luogu.com.cn/problem/P3808) & [Code](https://www.luogu.com.cn/paste/8hdz1k9i)② [P5357 【模板】AC 自动机(二次加强版)](https://www.luogu.com.cn/problem/P5357) & [Code](https://www.luogu.com.cn/paste/njmkdtkl)5、manacher 算法- ## 数据结构1、单调队列- Problem & Code:① [P1886 滑动窗口 /【模板】单调队列](https://www.luogu.com.cn/problem/P1886) & [Code](https://www.luogu.com.cn/paste/4hai8rj2)② [P2216 [HAOI2007] 理想的正方形](https://www.luogu.com.cn/problem/P2216) & [Code](https://www.luogu.com.cn/paste/o1wk1jz9)2、ST 表- Problem & Code:① [P3865 【模板】ST 表](https://www.luogu.com.cn/problem/P3865) & [Code](https://www.luogu.com.cn/paste/wwhhkeay)② [P2216 [HAOI2007] 理想的正方形](https://www.luogu.com.cn/problem/P2216) & [Code](https://www.luogu.com.cn/paste/q2sps19d)3、树状数组- Problem & Code:① [P3374 【模板】树状数组 1](https://www.luogu.com.cn/problem/P3374) & [Code](https://www.luogu.com.cn/paste/nztavrgb)② [P3368 【模板】树状数组 2](https://www.luogu.com.cn/problem/P3368) & [Code](https://www.luogu.com.cn/paste/wdrh5d4f)4、线段树- Problem & Code:① [P3372 【模板】线段树 1](https://www.luogu.com.cn/problem/P3372) & [Code](https://www.luogu.com.cn/paste/inb2uc0e)② [P3373 【模板】线段树 2](https://www.luogu.com.cn/problem/P3373) & [Code](https://www.luogu.com.cn/paste/vqdp75gk)③ [GSS3 - Can you answer these queries III](https://www.luogu.com.cn/problem/SP1716) & [Code](https://www.luogu.com.cn/paste/q2sps19d)④ [CF1146E Hot is Cold](https://www.luogu.com.cn/problem/CF1146E) & [Code](https://www.luogu.com.cn/paste/4b9110qj)5、分块- Problem & Code:① [P3372 【模板】线段树 1](https://www.luogu.com.cn/problem/P3372) & [Code](https://www.luogu.com.cn/paste/f85pya6o)② [P2801 教主的魔法](https://www.luogu.com.cn/problem/P2801) & [Code](https://www.luogu.com.cn/paste/fg4ymuq1)6、莫队- Problem & Code:① [SP3267 DQUERY - D-query](https://www.luogu.com.cn/problem/SP3267) & [Code](https://www.luogu.com.cn/paste/7un5xskb)② [P1903 [国家集训队] 数颜色 / 维护队列](https://www.luogu.com.cn/problem/P1903) & [Code](https://www.luogu.com.cn/paste/z5xa2ihc)7、平衡树- Problem & Code:① [(Treap)P3369 【模板】普通平衡树](https://www.luogu.com.cn/problem/P3369) & [Code](https://www.luogu.com.cn/paste/5lrsxr5f)② Splay & [Code](https://www.luogu.com.cn/paste/kmqvatlw)③ [P3391 【模板】文艺平衡树](https://www.luogu.com.cn/problem/P3391) & [Code](https://www.luogu.com.cn/paste/kpqzsxj1)8、主席树- Problem & Code:① [P3919 【模板】可持久化线段树 1(可持久化数组)](https://www.luogu.com.cn/problem/P3919) & [Code](https://www.luogu.com.cn/paste/q3a3bw4z)② [P3834 【模板】可持久化线段树 2](https://www.luogu.com.cn/problem/P3834) & [Code](https://www.luogu.com.cn/paste/v9u2luai)③ 区修区查主席树 & [Code](https://www.luogu.com.cn/paste/ds6kaloy)9、树套树- Problem & Code:① [P2617 Dynamic Rankings](https://www.luogu.com.cn/problem/P2617) & [Code](https://www.luogu.com.cn/paste/q3a3bw4z)② 待补- ## 图论1、建图与存图2、并查集- Problem & Code:① [P3367 【模板】并查集](https://www.luogu.com.cn/problem/P3367) & [Code](https://www.luogu.com.cn/paste/d21feef9)3、最小生成树- Problem & Code:① [P3366 【模板】最小生成树](https://www.luogu.com.cn/problem/P3366) & [Code](https://www.luogu.com.cn/paste/pkociux6)② [P1967 [NOIP2013 提高组] 货车运输](https://www.luogu.com.cn/problem/P1967) & [Code](https://www.luogu.com.cn/paste/oqjgzr1d)4、最短路- Problem & Code:① [(Dijkstra)P4779 【模板】单源最短路径(标准版)](https://www.luogu.com.cn/problem/P4779) & [Code](https://www.luogu.com.cn/paste/rx3fhlk3)② Bellman_Ford & [Code](https://www.luogu.com.cn/paste/7djw8hl0)③ SPFA & [Code](https://www.luogu.com.cn/paste/fz2idpiz)5、差分约束- Problem & Code:① [P5960 【模板】差分约束](https://www.luogu.com.cn/problem/P5960) & [Code](https://www.luogu.com.cn/paste/0ehc3j7n)6、负环- Problem & Code:① [P3385 【模板】负环](https://www.luogu.com.cn/problem/P3385) & [Code](https://www.luogu.com.cn/paste/93f2759d)7、拓扑排序- Problem & Code:① [B3644 【模板】拓扑排序 / 家谱树](https://www.luogu.com.cn/problem/B3644)② [P1347 排序](https://www.luogu.com.cn/problem/P1347) & [Code](https://www.luogu.com.cn/paste/weostkbw)③ [P3243 [HNOI2015] 菜肴制作](https://www.luogu.com.cn/problem/P3243) & [Code](https://www.luogu.com.cn/paste/wnr9x19i)8、强连通分量与缩点- Problem & Code:① [P8435 【模板】边双连通分量](https://www.luogu.com.cn/problem/P8436) & [Code](https://www.luogu.com.cn/paste/cz2mkap7)② [P8435 【模板】点双连通分量](https://www.luogu.com.cn/problem/P8435)③ [P3387 【模板】缩点](https://www.luogu.com.cn/problem/P3387) & [Code](https://www.luogu.com.cn/paste/g5eylfdw)9、割点与桥- Problem & Code:① [P3388 【模板】割点(割顶)](https://www.luogu.com.cn/problem/P3388) & [Code](https://www.luogu.com.cn/paste/89encd73)② 桥 & [Code](https://www.luogu.com.cn/paste/pbnznk3u)10、欧拉回路11、二分图匹配- Problem & Code:① [P3386 【模板】二分图最大匹配](https://www.luogu.com.cn/problem/P3386) & [Code](https://www.luogu.com.cn/paste/r6inzvc3)12、2-SAT- Problem & Code:① [P4782 【模板】2-SAT](https://www.luogu.com.cn/problem/P4782) & [Code](https://www.luogu.com.cn/paste/rx25pvf6)- ## 树论1、树的直径与重心- Problem & Code:① [(树的重心)P1395 会议](https://www.luogu.com.cn/problem/P1395) & [Code](https://www.luogu.com.cn/paste/fn2rpqvh)- Blog:① [树的重心](https://zhuanlan.zhihu.com/p/357938161)2、最近公共祖先(LCA)- Problem & Code:① [(倍增)P3379 【模板】最近公共祖先(LCA)](https://www.luogu.com.cn/problem/P3379) & [Code](https://www.luogu.com.cn/paste/d36ub812)② (重链剖分)LCA & [Code](https://www.luogu.com.cn/paste/w21hwkxc)3、树上差分- Problem & Code:① [(树上点差分)P3128 [USACO15DEC] Max Flow P](https://www.luogu.com.cn/problem/P3128) & [Code](https://www.luogu.com.cn/paste/yuqjvg98)4、01 Trie- Problem & Code:① [P4551 最长异或路径](https://www.luogu.com.cn/problem/P4551) & [Code](https://www.luogu.com.cn/paste/lvt61cls)5、笛卡尔树- Problem & Code:① [P5854 【模板】笛卡尔树](https://www.luogu.com.cn/problem/P5854) & [Code](https://www.luogu.com.cn/paste/tu7g0ies)② [P1377 [TJOI2011] 树的序](https://www.luogu.com.cn/problem/P1377) & [Code](https://www.luogu.com.cn/paste/f5440vpb)6、树链剖分 / 重链剖分- Problem & Code:① [P3384 【模板】重链剖分/树链剖分](https://www.luogu.com.cn/problem/P3384) & [Code](https://www.luogu.com.cn/paste/riamnk0a)② [GSS7 - Can you answer these queries VII](https://www.luogu.com.cn/problem/SP6779) & [Code](https://www.luogu.com.cn/paste/1tf5y29r)7、点分治- ## 数论1、线性筛2、最大公约数(gcd)3、快速幂4、裴蜀定理5、扩展欧几里得(exgcd)6、乘法逆元7、矩阵加速8、组合数学基础9、中国剩余定理- ## 动态规划1、背包九讲2、线性 dp3、区间 dp4、树形 dp5、状压 dp6、数位 dp7、动态规划的优化- ## 其他1、离散化2、三分3、bitset 优化