版本比较
Template
正文
增加 138 行删除 138 行
3 行未改动4567889101011121213141415161617181819202021222223242425262627282829303031323233343435363637383839404041424243444445464647484849505152535454555656575858596060616262636464656666676868697070717272737474757676777878798080818282838484858686878888899090919292939494959696979898991001001011021021031041041051061061071081081091101101111121121131141141151161161171181181191201201211221221231241241251261261271281281291301301311321331341351361361371381381391401401411421421431441441451461461471481481491501501511521521531541541551561561571581581591601601611621621631641641651661661671681681691701701711721721731741741751761761771781781791801801811821821831841841851861861871881881891901901911921921931941941951961961971981981992002002012022022032042042052062062072082082092102102112122122132142152162172182182192202202212222222232242242252262262272282282292302302312322322332342342352362362372382382392402402412422422432442442452462462472482482492502502512522522532542542552562562572582582592602602612622622632642652662672682692702702712722722732742742752762762772782782792802802812822822832842842852862872882882892902902912922922932942942952962962972982982993003003013023033043053063063073 行未改动
- ## 排序算法
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、线性 dp
3、区间 dp
4、树形 dp
5、状压 dp
6、数位 dp
7、动态规划的优化
- ## 其他
1、离散化
2、三分
3、bitset 优化