OSDN Git Service

www.luogu.org -> www.luogu.com.cn
authorHenry-ZHR <51886614+Henry-ZHR@users.noreply.github.com>
Sat, 9 May 2020 08:06:36 +0000 (16:06 +0800)
committerHenry-ZHR <51886614+Henry-ZHR@users.noreply.github.com>
Sat, 9 May 2020 08:06:36 +0000 (16:06 +0800)
85 files changed:
docs/basic/binary.md
docs/basic/construction.md
docs/basic/greedy.md
docs/basic/prefix-sum.md
docs/dp/dynamic.md
docs/dp/interval.md
docs/dp/knapsack.md
docs/dp/number.md
docs/dp/opt/monotonous-queue-stack.md
docs/dp/opt/quadrangle.md
docs/dp/opt/slope.md
docs/dp/state.md
docs/dp/tree.md
docs/ds/block-array.md
docs/ds/dsu.md
docs/ds/hash.md
docs/ds/kdt.md
docs/ds/lct.md
docs/ds/leftist-tree.md
docs/ds/odt.md
docs/ds/persistent-balanced.md
docs/ds/persistent-trie.md
docs/ds/seg-in-seg.md
docs/ds/seg.md
docs/ds/sparse-table.md
docs/ds/splay.md
docs/ds/treap.md
docs/ds/tree-decompose.md
docs/geometry/convex-hull.md
docs/geometry/distance.md
docs/geometry/half-plane.md
docs/geometry/random-incremental.md
docs/graph/chord.md
docs/graph/cut.md
docs/graph/diff-constraints.md
docs/graph/dynamic-tree-divide.md
docs/graph/euler.md
docs/graph/flow/min-cost.md
docs/graph/flow/min-cut.md
docs/graph/hld.md
docs/graph/kth-path.md
docs/graph/lca.md
docs/graph/matrix-tree.md
docs/graph/mst.md
docs/graph/node.md
docs/graph/tree-divide.md
docs/graph/tree-hash.md
docs/graph/virtual-tree.md
docs/intro/resources.md
docs/intro/wsl.md
docs/lang/python.md
docs/math/bsgs.md
docs/math/catalan.md
docs/math/crt.md
docs/math/dictionary.md
docs/math/du.md
docs/math/euclidean.md
docs/math/inverse.md
docs/math/lucas.md
docs/math/matrix.md
docs/math/mobius.md
docs/math/poly/lagrange.md
docs/math/quick-pow.md
docs/math/simplex.md
docs/misc/expression.md
docs/misc/frac-programming.md
docs/misc/gray-code.md
docs/misc/hill-climbing.md
docs/misc/largest-matrix.md
docs/misc/modifiable-mo-algo.md
docs/misc/parallel-binsearch.md
docs/misc/random.md
docs/misc/simulated-annealing.md
docs/search/astar.md
docs/search/bidirectional.md
docs/search/dfs.md
docs/search/heuristic.md
docs/search/idastar.md
docs/string/ac-automaton.md
docs/string/manacher.md
docs/string/pam.md
docs/string/sa.md
docs/string/sam.md
docs/string/trie.md
docs/topic/problemsetting.md

index a166701..5217f55 100644 (file)
@@ -58,7 +58,7 @@ int binary_search(int start, int end, int key) {
 
 解题的时候往往会考虑枚举答案然后检验枚举的值是否正确。如果我们把这里的枚举换成二分,就变成了“二分答案”。
 
-来看一看一道例题 [Luogu P1873 砍树](https://www.luogu.org/problemnew/show/P1873) ,我们可以在 1 到 1000000000(10 亿)中枚举答案,但是这种朴素写法肯定拿不到满分,因为从 1 跑到 10 亿太耗时间。我们可以对答案进行 1 到 10 亿的二分,其中,每次都对其进行检查可行性(一般都是使用贪心法)。 **这就是二分答案。** 
+来看一看一道例题 [Luogu P1873 砍树](https://www.luogu.com.cn/problemnew/show/P1873) ,我们可以在 1 到 1000000000(10 亿)中枚举答案,但是这种朴素写法肯定拿不到满分,因为从 1 跑到 10 亿太耗时间。我们可以对答案进行 1 到 10 亿的二分,其中,每次都对其进行检查可行性(一般都是使用贪心法)。 **这就是二分答案。** 
 
 下面就是例题的参考答案。
 
index 4ff0046..301fa2e 100644 (file)
@@ -30,7 +30,7 @@
 
 #### 题面
 
- [Luogu P3599 Koishi Loves Construction](https://www.luogu.org/problemnew/show/P3599) 
+ [Luogu P3599 Koishi Loves Construction](https://www.luogu.com.cn/problemnew/show/P3599) 
 
 #### 做法
 
index f03e61f..54a0ac6 100644 (file)
@@ -21,7 +21,7 @@
 
 用排序法常见的情况是输入一个包含几个(一般一到两个)权值的数组,通过排序然后遍历模拟计算的方法求出最优值。
 
-有些题的排序方法非常显然,如 [「USACO1.3」修理牛棚 Barn Repair](https://www.luogu.org/problemnew/show/P1209) 就是将输入数组差分后排序模拟求值。
+有些题的排序方法非常显然,如 [「USACO1.3」修理牛棚 Barn Repair](https://www.luogu.com.cn/problemnew/show/P1209) 就是将输入数组差分后排序模拟求值。
 
 然而有些时候很难直接一下子看出排序方法,比如 [NOIP 2012 国王游戏](https://vijos.org/p/1779) 就很容易凭直觉而错误地以 $a$ 或 $b$ 为关键字排序,过样例之后提交就发现 WA 了 QAQ。一个常见办法就是尝试交换数组相邻的两个元素来 **推导** 出正确的排序方法。我们假设这题输入的俩个数用一个结构体来保存
 
@@ -84,11 +84,11 @@ struct uv {
 };
 ```
 
-如果看懂了就可以尝试下一道类似的题: [Luogu P2123 皇后游戏](https://www.luogu.org/problemnew/show/P2123) 
+如果看懂了就可以尝试下一道类似的题: [Luogu P2123 皇后游戏](https://www.luogu.com.cn/problemnew/show/P2123) 
 
 ## 后悔法
 
-??? note " 例题[「USACO09OPEN」工作调度 Work Scheduling](https://www.luogu.org/problemnew/show/P2949)"
+??? note " 例题[「USACO09OPEN」工作调度 Work Scheduling](https://www.luogu.com.cn/problemnew/show/P2949)"
 
 贪心思想:
 
index c00ce27..185ac97 100644 (file)
@@ -53,10 +53,10 @@ int main() {
 
 ### 习题
 
--    [洛谷 U53525 前缀和(例题)](https://www.luogu.org/problemnew/show/U53525) 
--    [洛谷 U69096 前缀和的逆](https://www.luogu.org/problemnew/show/U69096) 
--    [AT2412 最大の和](https://www.luogu.org/problemnew/show/AT2412) 
--    [「USACO16JAN」子共七 Subsequences Summing to Sevens](https://www.luogu.org/problemnew/show/P3131) 
+-    [洛谷 U53525 前缀和(例题)](https://www.luogu.com.cn/problemnew/show/U53525) 
+-    [洛谷 U69096 前缀和的逆](https://www.luogu.com.cn/problemnew/show/U69096) 
+-    [AT2412 最大の和](https://www.luogu.com.cn/problemnew/show/AT2412) 
+-    [「USACO16JAN」子共七 Subsequences Summing to Sevens](https://www.luogu.com.cn/problemnew/show/P3131) 
 
 ### 参考
 
@@ -90,7 +90,7 @@ int main() {
 第二个问题就是如何应用,譬如求 $(x1,y1) - (x2,y2)$ 子矩阵的和。  
 那么,根据类似的思考过程,易得答案为 $sum_{x2,y2} - sum_{x1 - 1,y2} - sum_{x2,y1 - 1} + sum_{x1 - 1,y1 - 1}$ 。
 
-下面给出 [洛谷 P1387 最大正方形](https://www.luogu.org/problemnew/show/P1387) 这道题目的参考程序来帮助大家理解二维前缀和。
+下面给出 [洛谷 P1387 最大正方形](https://www.luogu.com.cn/problemnew/show/P1387) 这道题目的参考程序来帮助大家理解二维前缀和。
 
 ```cpp
 #include <algorithm>
@@ -195,4 +195,4 @@ int main() {
 
 ### 习题
 
--    [洛谷 3128. 最大流](https://www.luogu.org/problemnew/show/P3128) 
+-    [洛谷 3128. 最大流](https://www.luogu.com.cn/problemnew/show/P3128) 
index a4530a6..98bf3d9 100644 (file)
@@ -8,7 +8,7 @@
 
 以这道模板题为例子讲解一下动态 DP 的过程。
 
-??? note " 例题[洛谷 P4719 【模板】动态 DP](https://www.luogu.org/problem/P4719) "
+??? note " 例题[洛谷 P4719 【模板】动态 DP](https://www.luogu.com.cn/problem/P4719) "
     给定一棵 $n$ 个点的树,点带点权。有 $m$ 次操作,每次操作给定 $x,y$ 表示修改点 $x$ 的权值为 $y$ 。你需要在每次操作之后求出这棵树的最大权独立集的权值大小。
 
 #### 广义矩阵乘法
index e52bb1c..93c818f 100644 (file)
@@ -50,4 +50,4 @@ for (len = 1; len <= n; len++)
 
  [NOIP 2007 矩阵取数游戏](https://vijos.org/p/1378) 
 
- [「IOI2000」邮局](https://www.luogu.org/problemnew/show/P4767) 
+ [「IOI2000」邮局](https://www.luogu.com.cn/problemnew/show/P4767) 
index 0259988..a632cb5 100644 (file)
@@ -4,7 +4,7 @@ author: hydingsy, Link-cute, Ir1d, greyqz, LuoshuiTianyi, Odeinjul
 
 在具体讲何为“背包 dp”前,先来看如下的例题:
 
-??? note "[「USACO07 DEC」Charm Bracelet](https://www.luogu.org/problemnew/show/P2871)"
+??? note "[「USACO07 DEC」Charm Bracelet](https://www.luogu.com.cn/problemnew/show/P2871)"
     题意概要:有 $n$ 个物品和一个容量为 $W$ 的背包,每个物品有重量 $w_{i}$ 和价值 $v_{i}$ 两种属性,要求选若干物品放入背包使背包中物品的总价值最大且背包中物品的总重量不超过背包的容量。
 
 在上述例题中,由于每个物体只有 $2$ 种可能的状态(取与不取),正如二进制中的 $0$ 和 $1$ ,这类问题便被称为“0-1 背包问题”。
@@ -98,7 +98,7 @@ $$
 
 与 0-1 背包相同地,我们可以将第一维去掉来优化空间复杂度。如果理解了 0-1 背包的优化方式,就不难明白压缩后的循环是正向的(也就是上文中提到的错误优化)。
 
-??? note "[「Luogu P1616」疯狂的采药](https://www.luogu.org/problemnew/show/P1616)"
+??? note "[「Luogu P1616」疯狂的采药](https://www.luogu.com.cn/problemnew/show/P1616)"
     题意概要:有 $n$ 种物品和一个容量为 $W$ 的背包,每种物品有重量 $w_{i}$ 和价值 $v_{i}$ 两种属性,要求选若干个物品放入背包使背包中物品的总价值最大且背包中物品的总重量不超过背包的容量。
 
 ??? 例题代码
@@ -173,7 +173,7 @@ $$
 
 见 [单调队列/单调栈优化](opt/monotonous-queue-stack.md) 。
 
-习题: [「Luogu P1776」宝物筛选\_NOI 导刊 2010 提高(02)](https://www.luogu.org/problemnew/show/P1776) 
+习题: [「Luogu P1776」宝物筛选\_NOI 导刊 2010 提高(02)](https://www.luogu.com.cn/problemnew/show/P1776) 
 
 ## 混合背包
 
@@ -192,12 +192,12 @@ for (循环物品种类) {
 }
 ```
 
-??? note "[「Luogu P1833」樱花](https://www.luogu.org/problemnew/show/P1833)"
+??? note "[「Luogu P1833」樱花](https://www.luogu.com.cn/problemnew/show/P1833)"
     题意概要:有 $n$ 种樱花树和长度为 $T$ 的时间,有的樱花树只能看一遍,有的樱花树最多看 $A{i}$ 遍,有的樱花树可以看无数遍。每棵樱花树都有一个美学值 $C{i}$ ,求在 $T$ 的时间内看哪些樱花树能使美学值最高。
 
 ## 二维费用背包
 
-先来一道例题: [「Luogu P1855」榨取 kkksc03](https://www.luogu.org/problemnew/show/P1855) 。
+先来一道例题: [「Luogu P1855」榨取 kkksc03](https://www.luogu.com.cn/problemnew/show/P1855) 。
 
 这道题是很明显的 0-1 背包问题,可是不同的是选一个物品会消耗两种价值(经费、时间)。这种问题其实很简单:方程基本不用变,只需再开一维数组,同时转移两个价值就行了!(完全、多重背包同理)
 
@@ -215,7 +215,7 @@ for (int k = 1; k <= n; k++) {
 
 ## 分组背包
 
-再看一道例题: [「Luogu P1757」通天之分组背包](https://www.luogu.org/problemnew/show/P1757) 。
+再看一道例题: [「Luogu P1757」通天之分组背包](https://www.luogu.com.cn/problemnew/show/P1757) 。
 
 所谓分组背包,就是将物品分组,每组的物品相互冲突,最多只能选一个物品放进去。
 
@@ -238,7 +238,7 @@ for (int k = 1; k <= ts; k++)          //循环每一组
 
 ## 有依赖的背包
 
-一道例题: [「Luogu P1064」金明的预算方案](https://www.luogu.org/problemnew/show/P1064) 。
+一道例题: [「Luogu P1064」金明的预算方案](https://www.luogu.com.cn/problemnew/show/P1064) 。
 
 这种背包问题其实就是如果选第 $i$ 件物品,就必须选第 $j$ 件物品,保证不会循环引用,一部分题目甚至会出现多叉树的引用形式。为了方便,就称不依赖于别的物品的物品称为“主件”,依赖于某主件的物品称为“附件”。
 
index 5c082a4..5946afc 100644 (file)
@@ -56,9 +56,9 @@ int solve(int x) {
 
  [ZJOI2010 count 数字计数](https://loj.ac/problem/10169) 
 
- [Ahoi2009 self 同类分布](https://www.luogu.org/problem/P4127) 
+ [Ahoi2009 self 同类分布](https://www.luogu.com.cn/problem/P4127) 
 
- [洛谷  P3413 SAC#1 - 萌数](https://www.luogu.org/problemnew/show/P3413) 
+ [洛谷  P3413 SAC#1 - 萌数](https://www.luogu.com.cn/problemnew/show/P3413) 
 
  [HDU 6148 Valley Number](http://acm.hdu.edu.cn/showproblem.php?pid=6148) 
 
index 44da8d2..5c151bf 100644 (file)
@@ -62,6 +62,6 @@ $$
 
  [「Luogu P1886」滑动窗口](https://loj.ac/problem/10175) 
 
- [「NOI2005」瑰丽华尔兹](https://www.luogu.org/problem/P2254) 
+ [「NOI2005」瑰丽华尔兹](https://www.luogu.com.cn/problem/P2254) 
 
  [「SCOI2010」股票交易](https://loj.ac/problem/10183) 
index 5d06547..7bd25f3 100644 (file)
@@ -282,7 +282,7 @@ $$
 
 ## 习题
 
- [「IOI2000」邮局](https://www.luogu.org/problemnew/show/P4767) 
+ [「IOI2000」邮局](https://www.luogu.com.cn/problemnew/show/P4767) 
 
 ## 参考资料
 
index f0c9dcc..c61c50e 100644 (file)
@@ -29,7 +29,7 @@ author: TrisolarisHD, hsfzLZH1, abc1763613206, greyqz, Ir1d, billchenchina, Chro
 
  [「APIO2010」特别行动队](https://loj.ac/problem/10190) 
 
- [「JSOI2011」柠檬](https://www.luogu.org/problem/P5504) 
+ [「JSOI2011」柠檬](https://www.luogu.com.cn/problem/P5504) 
 
  [「Codeforces 311B」Cats Transport](http://codeforces.com/problemset/problem/311/B) 
 
index cd34757..46c0997 100644 (file)
@@ -63,8 +63,8 @@
 
  [NOI2001 炮兵阵地](https://loj.ac/problem/10173) 
 
- [「USACO06NOV」玉米田 Corn Fields](https://www.luogu.org/problemnew/show/P1879) 
+ [「USACO06NOV」玉米田 Corn Fields](https://www.luogu.com.cn/problemnew/show/P1879) 
 
- [AHOI2009 中国象棋](https://www.luogu.org/problem/P2051) 
+ [AHOI2009 中国象棋](https://www.luogu.com.cn/problem/P2051) 
 
  [九省联考 2018 一双木棋](https://loj.ac/problem/2471) 
index b085b7b..9341e57 100644 (file)
@@ -6,7 +6,7 @@
 
 以下面这道题为例,介绍一下树形 DP 的一般过程。
 
-??? note " 例题[洛谷 P1352 没有上司的舞会](https://www.luogu.org/problemnew/show/P1352)"
+??? note " 例题[洛谷 P1352 没有上司的舞会](https://www.luogu.com.cn/problemnew/show/P1352)"
     某大学有 $n$ 个职员,编号为 $1\text{~} N$ 。他们之间有从属关系,也就是说他们的关系就像一棵以校长为根的树,父结点就是子结点的直接上司。现在有个周年庆宴会,宴会每邀请来一个职员都会增加一定的快乐指数 $a_i$ ,但是呢,如果某个职员的上司来参加舞会了,那么这个职员就无论如何也不肯来参加舞会了。所以,请你编程计算,邀请哪些职员可以使快乐指数最大,求最大的快乐指数。
 
 我们可以定义 $f(i,0/1)$ 代表以 $i$ 为根的子树的最优解(第二维的值为 0 代表 $i$ 不参加舞会的情况,1 代表 $i$ 参加舞会的情况)。
index 977dc8a..e6ec459 100644 (file)
@@ -21,7 +21,7 @@ for (int i = 1; i <= num; i++) {
 
 ## 保存与修改块内信息
 
-### 例题 1: [教主的魔法](https://www.luogu.org/problemnew/show/P2801) 
+### 例题 1: [教主的魔法](https://www.luogu.com.cn/problemnew/show/P2801) 
 
 我们要询问一个块内大于等于一个数的数的个数,所以需要一个 `t` 数组对块内排序。对于整块的修改,使用类似于标记永久化的方式保存。时间复杂度 $O(n\sqrt{n}\log n)$ 
 
@@ -132,7 +132,7 @@ int Answer(int l, int r, int c) {
 
 1.   [单点修改,区间查询](https://loj.ac/problem/130) 
 2.   [区间修改,区间查询](https://loj.ac/problem/132) 
-3.   [【模板】线段树 2](https://www.luogu.org/problemnew/show/P3373) 
-4.   [「Ynoi2019 模拟赛」Yuno loves sqrt technology III](https://www.luogu.org/problemnew/show/P5048) 
-5.   [「Violet」蒲公英](https://www.luogu.org/problemnew/show/P4168) 
-6.   [作诗](https://www.luogu.org/problemnew/show/P4135) 
+3.   [【模板】线段树 2](https://www.luogu.com.cn/problemnew/show/P3373) 
+4.   [「Ynoi2019 模拟赛」Yuno loves sqrt technology III](https://www.luogu.com.cn/problemnew/show/P5048) 
+5.   [「Violet」蒲公英](https://www.luogu.com.cn/problemnew/show/P4168) 
+6.   [作诗](https://www.luogu.com.cn/problemnew/show/P4135) 
index 7b5d3ff..1066313 100644 (file)
@@ -130,11 +130,11 @@ void unionSet(int x, int y) {
 
  [「NOI2015」程序自动分析](https://uoj.ac/problem/127) 
 
- [「JSOI2008」星球大战](https://www.luogu.org/problem/P1197) 
+ [「JSOI2008」星球大战](https://www.luogu.com.cn/problem/P1197) 
 
- [「NOI2001」食物链](https://www.luogu.org/problem/P2024) 
+ [「NOI2001」食物链](https://www.luogu.com.cn/problem/P2024) 
 
- [「NOI2002」银河英雄传说](https://www.luogu.org/problemnew/show/P1196) 
+ [「NOI2002」银河英雄传说](https://www.luogu.com.cn/problemnew/show/P1196) 
 
  [UVA11987 Almost Union-Find](https://www.luogu.com.cn/problem/UVA11987) 
 
index 3464b67..bdc78cd 100644 (file)
@@ -85,4 +85,4 @@ struct hash_map {  // 哈希表模板
 
 ## 例题
 
- [「JLOI2011」不重复数字](https://www.luogu.org/problem/P4305) 
+ [「JLOI2011」不重复数字](https://www.luogu.com.cn/problem/P4305) 
index 30c86f5..23889c3 100644 (file)
@@ -58,7 +58,7 @@ k-D Tree 具有二叉搜索树的形态,二叉搜索树上的每个结点都
 
 ## 邻域查询
 
-???+note " 例题[luogu P1429 平面最近点对(加强版)](https://www.luogu.org/problem/P1429)"
+???+note " 例题[luogu P1429 平面最近点对(加强版)](https://www.luogu.com.cn/problem/P1429)"
     给定平面上的 $n$ 个点 $(x_i,y_i)$ ,找出平面上最近两个点对之间的 [欧几里得距离](../geometry/distance.md#_1) 。
 
      $2\le n\le 200000 , 0\le x_i,y_i\le 10^9$ 
@@ -249,7 +249,7 @@ k-D Tree 具有二叉搜索树的形态,二叉搜索树上的每个结点都
 
 ## 高维空间上的操作
 
-???+note " 例题[luogu P4148 简单题](https://www.luogu.org/problem/P4148)"
+???+note " 例题[luogu P4148 简单题](https://www.luogu.com.cn/problem/P4148)"
     在一个初始值全为 $0$ 的 $n\times n$ 的二维矩阵上,进行 $q$ 次操作,每次操作为以下两种之一:
 
     1.   `1 x y A` :将坐标 $(x,y)$ 上的数加上 $A$ 。
@@ -380,14 +380,14 @@ k-D Tree 具有二叉搜索树的形态,二叉搜索树上的每个结点都
 
 ## 习题
 
- [「SDOI2010」捉迷藏](https://www.luogu.org/problem/P2479) 
+ [「SDOI2010」捉迷藏](https://www.luogu.com.cn/problem/P2479) 
 
- [「Violet」天使玩偶/SJY 摆棋子](https://www.luogu.org/problem/P4169) 
+ [「Violet」天使玩偶/SJY 摆棋子](https://www.luogu.com.cn/problem/P4169) 
 
- [「国家集训队」JZPFAR](https://www.luogu.org/problem/P2093) 
+ [「国家集训队」JZPFAR](https://www.luogu.com.cn/problem/P2093) 
 
- [「BOI2007」Mokia 摩基亚](https://www.luogu.org/problem/P4390) 
+ [「BOI2007」Mokia 摩基亚](https://www.luogu.com.cn/problem/P4390) 
 
- [luogu P4475 巧克力王国](https://www.luogu.org/problem/P4475) 
+ [luogu P4475 巧克力王国](https://www.luogu.com.cn/problem/P4475) 
 
- [「CH 弱省胡策 R2」TATT](https://www.luogu.org/problem/P3769) 
+ [「CH 弱省胡策 R2」TATT](https://www.luogu.com.cn/problem/P3769) 
index ff4100d..68cf72b 100644 (file)
@@ -353,13 +353,13 @@ inline int Find(int p) {
 ## 习题
 
 -    [「BZOJ 3282」Tree](https://lydsy.com/JudgeOnline/problem.php?id=3282) 
--    [「HNOI2010」弹飞绵羊](https://www.luogu.org/problem/P3203) 
+-    [「HNOI2010」弹飞绵羊](https://www.luogu.com.cn/problem/P3203) 
 
 ## 维护树链信息
 
 LCT 通过 `Split(x,y)` 操作,可以将树上从点 $x$ 到点 $y$ 的路径提取到以 $y$ 为根的 Splay 内,树链信息的修改和统计转化为平衡树上的操作,这使得 LCT 在维护树链信息上具有优势。此外,借助 LCT 实现的在树链上二分比树链剖分少一个 $O(\log n)$ 的复杂度。
 
-???+note " 例题[「国家集训队」Tree II](https://www.luogu.org/problemnew/show/P1501)"
+???+note " 例题[「国家集训队」Tree II](https://www.luogu.com.cn/problemnew/show/P1501)"
     给出一棵有 $n$ 个结点的树,每个点的初始权值为 $1$ 。 $q$ 次操作,每次操作均为以下四种之一:
 
     1.   `- u1 v1 u2 v2` :将树上 $u_1,v_1$ 两点之间的边删除,连接 $u_2,v_2$ 两点,保证操作合法且连边后仍是一棵树。
@@ -525,8 +525,8 @@ LCT 通过 `Split(x,y)` 操作,可以将树上从点 $x$ 到点 $y$ 的路径
 
 ### 习题
 
--    [luogu P3690【模板】Link Cut Tree(动态树)](https://www.luogu.org/problemnew/show/P3690) 
--    [「SDOI2011」染色](https://www.luogu.org/problemnew/show/P2486) 
+-    [luogu P3690【模板】Link Cut Tree(动态树)](https://www.luogu.com.cn/problemnew/show/P3690) 
+-    [「SDOI2011」染色](https://www.luogu.com.cn/problemnew/show/P2486) 
 -    [「SHOI2014」三叉神经树](https://loj.ac/problem/2187) 
 
 ## 维护连通性质
@@ -535,7 +535,7 @@ LCT 通过 `Split(x,y)` 操作,可以将树上从点 $x$ 到点 $y$ 的路径
 
 借助 LCT 的 `Find()` 函数,可以判断动态森林上的两点是否连通。如果有 `Find(x)==Find(y)` ,则说明 $x,y$ 两点在一棵树上,相互连通。
 
-???+note " 例题[「SDOI2008」洞穴勘测](https://www.luogu.org/problemnew/show/P2147)"
+???+note " 例题[「SDOI2008」洞穴勘测](https://www.luogu.com.cn/problemnew/show/P2147)"
     一开始有 $n$ 个独立的点, $m$ 次操作。每次操作为以下之一:
 
     1.   `Connect u v` :在 $u,v$ 两点之间连接一条边。
@@ -629,7 +629,7 @@ LCT 通过 `Split(x,y)` 操作,可以将树上从点 $x$ 到点 $y$ 的路径
 
 如果要求将边双连通分量缩成点,每次添加一条边,所连接的树上的两点如果相互连通,那么这条路径上的所有点都会被缩成一个点。
 
-???+note " 例题[「AHOI2005」航线规划](https://www.luogu.org/problemnew/show/P2542)"
+???+note " 例题[「AHOI2005」航线规划](https://www.luogu.com.cn/problemnew/show/P2542)"
     给出 $n$ 个点,初始时有 $m$ 条无向边, $q$ 次操作,每次操作为以下之一:
 
     1.   `0 u v` :删除 $u,v$ 之间的连边,保证此时存在这样的一条边。
@@ -802,7 +802,7 @@ LCT 通过 `Split(x,y)` 操作,可以将树上从点 $x$ 到点 $y$ 的路径
 
 ### 习题
 
--    [luogu P3950 部落冲突](https://www.luogu.org/problemnew/show/P3950) 
+-    [luogu P3950 部落冲突](https://www.luogu.com.cn/problemnew/show/P3950) 
 -    [bzoj 4998 星球联盟](https://www.lydsy.com/JudgeOnline/problem.php?id=4998) 
 -    [bzoj 2959 长跑](https://www.lydsy.com/JudgeOnline/problem.php?id=2959) 
 
@@ -810,7 +810,7 @@ LCT 通过 `Split(x,y)` 操作,可以将树上从点 $x$ 到点 $y$ 的路径
 
 LCT 并不能直接处理边权,此时需要对每条边建立一个对应点,方便查询链上的边信息。利用这一技巧可以动态维护生成树。
 
-???+note " 例题[luogu P4234 最小差值生成树](https://www.luogu.org/problemnew/show/P4234)"
+???+note " 例题[luogu P4234 最小差值生成树](https://www.luogu.com.cn/problemnew/show/P4234)"
     给定一个 $n$ 个点, $m$ 条边的带权无向图,求其边权最大值和边权最小值的差值最小的生成树,输出这个差值。
 
     数据保证至少存在一棵生成树。
@@ -957,8 +957,8 @@ LCT 上没有固定的父子关系,所以不能将边权记录在点权中。
 
 ### 习题
 
--    [「WC2006」水管局长](https://www.luogu.org/problem/P4172) 
--    [「BJWC2010」严格次小生成树](https://www.luogu.org/problemnew/show/P4180) 
+-    [「WC2006」水管局长](https://www.luogu.com.cn/problem/P4172) 
+-    [「BJWC2010」严格次小生成树](https://www.luogu.com.cn/problemnew/show/P4180) 
 -    [「NOI2014」魔法森林](https://uoj.ac/problem/3) 
 
 ## 维护子树信息
@@ -1123,5 +1123,5 @@ st.siz2[y] += st.siz[x];
 
 ### 习题
 
--    [luogu P4299 首都](https://www.luogu.org/problemnew/show/P4299) 
--    [SPOJ QTREE5 - Query on a tree V](https://www.luogu.org/problemnew/show/SP2939) 
+-    [luogu P4299 首都](https://www.luogu.com.cn/problemnew/show/P4299) 
+-    [SPOJ QTREE5 - Query on a tree V](https://www.luogu.com.cn/problemnew/show/SP2939) 
index 15a461c..0688d21 100644 (file)
@@ -127,11 +127,11 @@ int pop(int x) {
 
 ### 模板题
 
- [luogu P3377【模板】左偏树(可并堆)](https://www.luogu.org/problemnew/show/P3377) 
+ [luogu P3377【模板】左偏树(可并堆)](https://www.luogu.com.cn/problemnew/show/P3377) 
 
- [Monkey King](https://www.luogu.org/problemnew/show/P1456) 
+ [Monkey King](https://www.luogu.com.cn/problemnew/show/P1456) 
 
- [罗马游戏](https://www.luogu.org/problemnew/show/P2713) 
+ [罗马游戏](https://www.luogu.com.cn/problemnew/show/P2713) 
 
 需要注意的是:
 
@@ -222,7 +222,7 @@ int pop(int x) {
 
 ### 树上问题
 
- [「APIO2012」派遣](https://www.luogu.org/problemnew/show/P1552) 
+ [「APIO2012」派遣](https://www.luogu.com.cn/problemnew/show/P1552) 
 
  [「JLOI2015」城池攻占](https://loj.ac/problem/2107) 
 
@@ -550,6 +550,6 @@ int pop(int x) {
     int find(int x) { return x == f[x] ? x : f[x] = find(f[x]); }
     ```
 
-###  [「BOI2004」Sequence 数字序列](https://www.luogu.org/problemnew/show/P4331) 
+###  [「BOI2004」Sequence 数字序列](https://www.luogu.com.cn/problemnew/show/P4331) 
 
 这是一道论文题,详见 [《黄源河 -- 左偏树的特点及其应用》](https://github.com/OI-wiki/libs/blob/master/%E9%9B%86%E8%AE%AD%E9%98%9F%E5%8E%86%E5%B9%B4%E8%AE%BA%E6%96%87/%E5%9B%BD%E5%AE%B6%E9%9B%86%E8%AE%AD%E9%98%9F2005%E8%AE%BA%E6%96%87%E9%9B%86/%E9%BB%84%E6%BA%90%E6%B2%B3--%E5%B7%A6%E5%81%8F%E6%A0%91%E7%9A%84%E7%89%B9%E7%82%B9%E5%8F%8A%E5%85%B6%E5%BA%94%E7%94%A8/%E9%BB%84%E6%BA%90%E6%B2%B3.pdf) 。
index c907af5..826049c 100644 (file)
@@ -93,7 +93,7 @@ void performance(int l, int r) {
 
 ## 习题
 
--    [「SCOI2010」序列操作](https://www.luogu.org/problem/P2572) 
+-    [「SCOI2010」序列操作](https://www.luogu.com.cn/problem/P2572) 
 -    [「SHOI2015」脑洞治疗仪](https://loj.ac/problem/2037) 
--    [「Luogu 2787」理理思维](https://www.luogu.org/problemnew/show/P2787) 
--    [「Luogu 4979」矿洞:坍塌](https://www.luogu.org/problemnew/show/P4979) 
+-    [「Luogu 2787」理理思维](https://www.luogu.com.cn/problemnew/show/P2787) 
+-    [「Luogu 4979」矿洞:坍塌](https://www.luogu.com.cn/problemnew/show/P4979) 
index b394e24..801a337 100644 (file)
@@ -153,8 +153,8 @@ static int _merge(int _x, int _y) {
 
 ## 推荐的练手题
 
-1.   [「Luogu P3919」可持久化数组(模板题)](https://www.luogu.org/problemnew/show/P3919) 
+1.   [「Luogu P3919」可持久化数组(模板题)](https://www.luogu.com.cn/problemnew/show/P3919) 
 
 2.   [「Codeforces 702F」T-shirt](http://codeforces.com/problemset/problem/702/F) 
 
-3.   [「Luogu P5055」可持久化文艺平衡树](https://www.luogu.org/problemnew/show/P5055) 
+3.   [「Luogu P5055」可持久化文艺平衡树](https://www.luogu.com.cn/problemnew/show/P5055) 
index b818fff..7f0fcca 100644 (file)
@@ -2,7 +2,7 @@
 
 大部分的可持久化 Trie 题中,Trie 都是以 01-Trie 的形式出现的。
 
-??? note " 例题[最大异或和](https://www.luogu.org/problem/P4735)"
+??? note " 例题[最大异或和](https://www.luogu.com.cn/problem/P4735)"
     对一个长度为 $n$ 的数组 $a$ 维护以下操作:
 
     1.  在数组的末尾添加一个数 $x$ ,数组的长度 $n$ 自增 $1$ 。
index 0293164..228d0b4 100644 (file)
@@ -19,7 +19,7 @@ author: Chrogeek, HeRaNO, Dev-XYS, Dev-jqe
 
 ## 经典例题
 
- [陌上花开](https://www.luogu.org/problem/P3810) 将第一维排序处理,然后用树套树维护第二维和第三维。
+ [陌上花开](https://www.luogu.com.cn/problem/P3810) 将第一维排序处理,然后用树套树维护第二维和第三维。
 
 ## 示例代码
 
index beee411..12d0ddd 100644 (file)
@@ -223,7 +223,7 @@ int getsum(int l, int r, int s, int t, int p) {
 
 ## 线段树基础题推荐
 
-###  [luogu P3372【模板】线段树 1](https://www.luogu.org/problem/P3372) 
+###  [luogu P3372【模板】线段树 1](https://www.luogu.com.cn/problem/P3372) 
 
 ??? "参考代码"
     ```cpp
@@ -282,7 +282,7 @@ int getsum(int l, int r, int s, int t, int p) {
     }
     ```
 
-###  [luogu P3373【模板】线段树 2](https://www.luogu.org/problem/P3373) 
+###  [luogu P3373【模板】线段树 2](https://www.luogu.com.cn/problem/P3373) 
 
 ??? "参考代码"
     ```cpp
index 59edb22..b965f3a 100644 (file)
@@ -10,7 +10,7 @@ ST 表是用于解决 **可重复贡献问题** 的数据结构。
 
 ## 引入
 
- [ST 表模板题](https://www.luogu.org/problemnew/show/P3865) 
+ [ST 表模板题](https://www.luogu.com.cn/problemnew/show/P3865) 
 
 题目大意:给定 $n$ 个数,有 $m$ 个询问,对于每个询问,你需要回答区间 $[l,r]$ 中的最大值。
 
@@ -48,7 +48,7 @@ ST 表基于 [倍增](../basic/binary-acc.md) 思想,可以做到 $\Theta(n\lo
 
 ## 模板代码
 
- [ST 表模板题](https://www.luogu.org/problemnew/show/P3865) 
+ [ST 表模板题](https://www.luogu.com.cn/problemnew/show/P3865) 
 
 ```cpp
 #include <bits/stdc++.h>
@@ -119,11 +119,11 @@ ST 表能较好的维护“可重复贡献”的区间信息(同时也应满
 
 ## 练习
 
- [RMQ 模板题](https://www.luogu.org/problemnew/show/P3865) 
+ [RMQ 模板题](https://www.luogu.com.cn/problemnew/show/P3865) 
 
  [「SCOI2007」降雨量](https://loj.ac/problem/2279) 
 
- [\[USACO07JAN\]平衡的阵容 Balanced Lineup](https://www.luogu.org/problem/P2880) 
+ [\[USACO07JAN\]平衡的阵容 Balanced Lineup](https://www.luogu.com.cn/problem/P2880) 
 
 ## 附录:ST 表求区间 GCD 的时间复杂度分析
 
index 6f0ecde..6b038c0 100644 (file)
@@ -436,7 +436,7 @@ int main() {
 
 ## 练习题
 
- [「Cerc2007」robotic sort 机械排序](https://www.luogu.org/problemnew/show/P4402) 
+ [「Cerc2007」robotic sort 机械排序](https://www.luogu.com.cn/problemnew/show/P4402) 
 
  [二逼平衡树(树套树)](https://loj.ac/problem/106) 
 
index 991a2ef..16880ae 100644 (file)
@@ -277,8 +277,8 @@ int main() {
 
  [文艺平衡树(Splay)](https://loj.ac/problem/105) 
 
- [「ZJOI2006」书架](https://www.luogu.org/problem/P2596) 
+ [「ZJOI2006」书架](https://www.luogu.com.cn/problem/P2596) 
 
- [「NOI2005」维护数列](https://www.luogu.org/problem/P2042) 
+ [「NOI2005」维护数列](https://www.luogu.com.cn/problem/P2042) 
 
  [CF 702F T-Shirts](http://codeforces.com/problemset/problem/702/F) 
index 87fb965..def31c1 100644 (file)
@@ -14,7 +14,7 @@ author: ouuan, Ir1d, TrisolarisHD, Xeonacid
 
 顺带提一句,“gty 的妹子树”的树分块做法可以被菊花图卡掉。
 
-###  [BZOJ4763 雪辉](https://www.luogu.org/problem/P3603) 
+###  [BZOJ4763 雪辉](https://www.luogu.com.cn/problem/P3603) 
 
 先进行树分块,然后对每个块的关键点,预处理出它到祖先中每个关键点的路径上颜色的 bitset,以及每个关键点的最近关键点祖先,复杂度是 $O(n\sqrt n+\frac{nc}{32})$ ,其中 $n\sqrt n$ 是暴力从每个关键点向上跳的复杂度, $\frac{nc}{32}$ 是把 $O(n)$ 个 `bitset` 存下来的复杂度。
 
index f316e61..5a22428 100644 (file)
@@ -74,10 +74,10 @@ $$
 
  [UVA11626 Convex Hull](https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=78&page=show_problem&problem=2673) 
 
- [「USACO5.1」圈奶牛 Fencing the Cows](https://www.luogu.org/problemnew/show/P2742) 
+ [「USACO5.1」圈奶牛 Fencing the Cows](https://www.luogu.com.cn/problemnew/show/P2742) 
 
  [POJ1873 The Fortified Forest](http://poj.org/problem?id=1873) 
 
  [POJ1113 Wall](http://poj.org/problem?id=1113) 
 
- [「SHOI2012」信用卡凸包](https://www.luogu.org/problemnew/show/P3829) 
+ [「SHOI2012」信用卡凸包](https://www.luogu.com.cn/problemnew/show/P3829) 
index bc74c04..7830f47 100644 (file)
@@ -339,4 +339,4 @@ $$
 
 我们可以简单的认为对两个串进行异或运算,结果为 1 的数量就是两个串的汉明距离。
 
-部分内容搬运自 [浅谈三种常见的距离算法](https://www.luogu.org/blog/xuxing/Distance-Algorithm) ,感谢作者 xuxing 的授权。
+部分内容搬运自 [浅谈三种常见的距离算法](https://www.luogu.com.cn/blog/xuxing/Distance-Algorithm) ,感谢作者 xuxing 的授权。
index 173fc8e..af7fcdc 100644 (file)
@@ -147,4 +147,4 @@ t[r + 1] = its(q[l + 1], q[r]);  //再求出新的交点
 
  [POJ 1279 Art Gallery](http://poj.org/problem?id=1279) 求多边形的核
 
- [「CQOI2006」凸多边形](https://www.luogu.org/problem/P4196) 
+ [「CQOI2006」凸多边形](https://www.luogu.com.cn/problem/P4196) 
index 3baa5a0..efadc78 100644 (file)
@@ -109,9 +109,9 @@ int main() {
 
 ## 练习
 
- [最小圆覆盖](https://www.luogu.org/problem/P1742) 
+ [最小圆覆盖](https://www.luogu.com.cn/problem/P1742) 
 
- [「HNOI2012」射箭](https://www.luogu.org/problem/P3222) 
+ [「HNOI2012」射箭](https://www.luogu.com.cn/problem/P3222) 
 
 ## 参考资料
 
index 216fad1..2463932 100644 (file)
@@ -275,11 +275,11 @@ for (int i = 1; i <= n; i++)
 
 ## 习题
 
- [SP5446 FISHNET - Fishing Net](https://www.luogu.org/problem/SP5446) 
+ [SP5446 FISHNET - Fishing Net](https://www.luogu.com.cn/problem/SP5446) 
 
- [P3196\[HNOI2008\]神奇的国度](https://www.luogu.org/problem/P3196) 
+ [P3196\[HNOI2008\]神奇的国度](https://www.luogu.com.cn/problem/P3196) 
 
- [P3852\[TJOI2007\]小朋友](https://www.luogu.org/problem/P3852) 
+ [P3852\[TJOI2007\]小朋友](https://www.luogu.com.cn/problem/P3852) 
 
 ## 参考资料
 
index a71127c..bc6b400 100644 (file)
@@ -46,7 +46,7 @@ low[u] = min(low[u], num[v]);
 
 ### 例题
 
- [洛谷 P3388【模板】割点(割顶)](https://www.luogu.org/problemnew/show/P3388) 
+ [洛谷 P3388【模板】割点(割顶)](https://www.luogu.com.cn/problemnew/show/P3388) 
 
 ??? "例题代码"
     ```cpp
@@ -163,7 +163,7 @@ void tarjan(int u, int fa) {
 
 ## 练习
 
--    [P3388【模板】割点(割顶)](https://www.luogu.org/problem/P3388) 
+-    [P3388【模板】割点(割顶)](https://www.luogu.com.cn/problem/P3388) 
 -    [POJ2117 Electricity](https://vjudge.net/problem/POJ-2117) 
 -    [HDU4738 Caocao's Bridges](https://vjudge.net/problem/HDU-4738) 
 -    [HDU2460 Network](https://vjudge.net/problem/HDU-2460) 
index e5a84b1..fd82332 100644 (file)
@@ -12,7 +12,7 @@ author: Ir1d, Anguei, hsfzLZH1
 
 ## 常用变形技巧
 
-### 例题 [luogu P1993 小 K 的农场](https://www.luogu.org/problemnew/show/P1993) 
+### 例题 [luogu P1993 小 K 的农场](https://www.luogu.com.cn/problemnew/show/P1993) 
 
 题目大意:求解差分约束系统,有 $m$ 条约束条件,每条都为形如 $x_a-x_b\geq c_k$ , $x_a-x_b\leq c_k$ 或 $x_a=x_b$ 的形式,判断该差分约束系统有没有解。
 
@@ -81,7 +81,7 @@ int main() {
 }
 ```
 
-### 例题 [P4926\[1007\]倍杀测量者](https://www.luogu.org/problemnew/show/P4926) 
+### 例题 [P4926\[1007\]倍杀测量者](https://www.luogu.com.cn/problemnew/show/P4926) 
 
 不考虑二分等其他的东西,这里只论述差分系统 $\frac{x_i}{x_j}\leq c_k$ 的求解方法。
 
index 8f32664..6d67c6e 100644 (file)
@@ -62,7 +62,7 @@ int main() {
 
 在动态点分治的过程中,一个结点在其点分树上的祖先结点的信息中可能会被重复计算,这是我们需要消去重复部分的影响。一般的方法是对于一个连通块用两种方式记录:一个是其到分治中心的距离信息,另一个是其到点分树上分治中心父亲的距离信息。这一部分内容将在例题中得到展现。
 
-??? note " 例题[「ZJOI2007」捉迷藏](https://www.luogu.org/problemnew/show/P2056)"
+??? note " 例题[「ZJOI2007」捉迷藏](https://www.luogu.com.cn/problemnew/show/P2056)"
 
 给定一棵有 $n$ 个结点的树,初始时所有结点都是黑色的。你需要实现以下两种操作:
 
index c996cf4..8f874c6 100644 (file)
@@ -192,6 +192,6 @@ $$
 
 ## 练习题
 
- [「洛谷 1341」无序字母对](https://www.luogu.org/problem/P1341) 
+ [「洛谷 1341」无序字母对](https://www.luogu.com.cn/problem/P1341) 
 
- [「洛谷 2731」骑马修栅栏](https://www.luogu.org/problem/P2731) 
+ [「洛谷 2731」骑马修栅栏](https://www.luogu.com.cn/problem/P2731) 
index 2b899c1..457c1ba 100644 (file)
 
 ## 习题
 
--    [「Luogu 3381」【模板】最小费用最大流](https://www.luogu.org/problemnew/show/P3381) 
--    [「Luogu 4452」航班安排](https://www.luogu.org/problemnew/show/P4452) 
--    [「SDOI 2009」晨跑](https://www.luogu.org/problem/P2153) 
--    [「SCOI 2007」修车](https://www.luogu.org/problem/P2053) 
--    [「HAOI 2010」订货](https://www.luogu.org/problem/P2517) 
+-    [「Luogu 3381」【模板】最小费用最大流](https://www.luogu.com.cn/problemnew/show/P3381) 
+-    [「Luogu 4452」航班安排](https://www.luogu.com.cn/problemnew/show/P4452) 
+-    [「SDOI 2009」晨跑](https://www.luogu.com.cn/problem/P2153) 
+-    [「SCOI 2007」修车](https://www.luogu.com.cn/problem/P2053) 
+-    [「HAOI 2010」订货](https://www.luogu.com.cn/problem/P2517) 
 -    [「NOI 2012」美食节](https://loj.ac/problem/2674) 
index 031b2f6..2a056d3 100644 (file)
@@ -138,9 +138,9 @@ void dfs(int u) {
 
 ## 习题
 
--    [「USACO 4.4」Pollutant Control](https://www.luogu.org/problemnew/show/P1344) 
--    [「USACO 5.4」Telecowmunication](https://www.luogu.org/problemnew/show/P1345) 
--    [「Luogu 1361」小 M 的作物](https://www.luogu.org/problemnew/show/P1361) 
--    [「SHOI 2007」善意的投票](https://www.luogu.org/problem/P2057) 
+-    [「USACO 4.4」Pollutant Control](https://www.luogu.com.cn/problemnew/show/P1344) 
+-    [「USACO 5.4」Telecowmunication](https://www.luogu.com.cn/problemnew/show/P1345) 
+-    [「Luogu 1361」小 M 的作物](https://www.luogu.com.cn/problemnew/show/P1361) 
+-    [「SHOI 2007」善意的投票](https://www.luogu.com.cn/problem/P2057) 
 
 * * *
index 6e0d762..cde6c3f 100644 (file)
@@ -683,17 +683,17 @@ int main() {
 
 ## 练习
 
- [「luogu P3379」【模板】最近公共祖先(LCA)](https://www.luogu.org/problemnew/show/P3379) (树剖求 LCA 无需数据结构,可以用作练习)
+ [「luogu P3379」【模板】最近公共祖先(LCA)](https://www.luogu.com.cn/problemnew/show/P3379) (树剖求 LCA 无需数据结构,可以用作练习)
 
  [「JLOI2014」松鼠的新家](https://loj.ac/problem/2236) (当然也可以用树上差分)
 
  [「HAOI2015」树上操作](https://loj.ac/problem/2125) 
 
- [「luogu P3384」【模板】树链剖分](https://www.luogu.org/problemnew/show/P3384) 
+ [「luogu P3384」【模板】树链剖分](https://www.luogu.com.cn/problemnew/show/P3384) 
 
  [「NOI2015」软件包管理器](https://uoj.ac/problem/128) 
 
- [「SDOI2011」染色](https://www.luogu.org/problem/P2486) 
+ [「SDOI2011」染色](https://www.luogu.com.cn/problem/P2486) 
 
  [「SDOI2014」旅行](https://www.lydsy.com/JudgeOnline/problem.php?id=3531) 
 
index 4934818..4c5a3b6 100644 (file)
@@ -269,4 +269,4 @@ int main() {
 
 ## 习题
 
- [「SDOI2010」魔法猪学院](https://www.luogu.org/problemnew/show/P2483) 
+ [「SDOI2010」魔法猪学院](https://www.luogu.com.cn/problemnew/show/P2483) 
index f961ae7..e14d2e8 100644 (file)
@@ -291,7 +291,7 @@ LCA 为两个游标跳转到同一条重链上时深度较小的那个游标所
 
 每一步的复杂度都是 $O(N)$ 的,因此总复杂度依然是 $O(N)$ 。
 
-提供 RMQ 转标准 RMQ 的代码,为洛谷上 ST 表的例题 [ **P3865** 【模板】ST 表](https://www.luogu.org/problemnew/show/P3865) 
+提供 RMQ 转标准 RMQ 的代码,为洛谷上 ST 表的例题 [ **P3865** 【模板】ST 表](https://www.luogu.com.cn/problemnew/show/P3865) 
 
 ```cpp
 // Copyright (C) 2018 Skqliao. All rights served.
index f4d9918..5ffbe4f 100644 (file)
@@ -108,7 +108,7 @@ $$
 
  **解** 矩阵树定理的裸题。将每个空房间看作一个结点,根据输入的信息建图,得到 Laplace 矩阵后,任意删掉 $L$ 的第 $i$ 行第 $i$ 列,求这个子式的行列式即可。求行列式的方法就是高斯消元成上三角阵然后算对角线积。另外本题需要在模 $k$ 的整数子环 $\mathbb{Z}_k$ 上进行高斯消元,采用辗转相除法即可。
 
-???+ note "[「FJOI2007」轮状病毒](https://www.luogu.org/problem/P2144)"
+???+ note "[「FJOI2007」轮状病毒](https://www.luogu.com.cn/problem/P2144)"
 
  **解** 本题的解法很多,这里用矩阵树定理是最直接的解法。当输入为 $n$ 时,容易写出其 $n+1$ 阶的 Laplace 矩阵为:
 
index 3d0ad45..57f29d2 100644 (file)
@@ -183,7 +183,7 @@ $$
 
 ## 习题
 
--    [「HAOI2006」聪明的猴子](https://www.luogu.org/problem/P2504) 
+-    [「HAOI2006」聪明的猴子](https://www.luogu.com.cn/problem/P2504) 
 -    [「SCOI2005」繁忙的都市](https://loj.ac/problem/2149) 
 
 ## 最小生成树的唯一性
index 0c2d024..8f77c94 100644 (file)
@@ -26,7 +26,7 @@ author: Anguei, sshwy, Xeonacid, Ir1d, MonkeyOliver, hsfzLZH1
 
 事实上,这个 DP 就相当于把每个结点拆分成了 $k+1$ 个结点,每个新结点代表使用不同多次免费通行后到达的原图结点。换句话说,就是每个结点 $u_i$ 表示使用 $i$ 次免费通行权限后到达 $u$ 结点。
 
-??? note "[「JLOI2011」飞行路线](https://www.luogu.org/problem/P4568)"
+??? note "[「JLOI2011」飞行路线](https://www.luogu.com.cn/problem/P4568)"
 
     题意:有一个 $n$ 个点 $m$ 条边的无向图,你可以选择 $k$ 条道路以零代价通行,求 $s$ 到 $t$ 的最小花费。
 
index e9f23e5..de6cc8a 100644 (file)
@@ -2,7 +2,7 @@
 
 点分治适合处理大规模的树上路径信息问题。
 
-??? note " 例题[luogu P3806【模板】点分治 1](https://www.luogu.org/problemnew/show/P3806)"
+??? note " 例题[luogu P3806【模板】点分治 1](https://www.luogu.com.cn/problemnew/show/P3806)"
     给定一棵有 $n$ 个点的带点权树, $m$ 次询问,每次询问给出 $k$ ,询问树上距离为 $k$ 的点对是否存在。
 
      $n\le 10000,m\le 100,k\le 10000000$ 
@@ -105,7 +105,7 @@ int main() {
 }
 ```
 
-??? note " 例题[luogu  P4178 Tree](https://www.luogu.org/problemnew/show/P4178)"
+??? note " 例题[luogu  P4178 Tree](https://www.luogu.com.cn/problemnew/show/P4178)"
     给定一棵有 $n$ 个点的带权树,给出 $k$ ,询问树上距离为 $k$ 的点对数量。
 
      $n\le 40000,k\le 20000,w_i\le 1000$ 
index be6aef9..f92f6c8 100644 (file)
@@ -72,7 +72,7 @@ $$
 
 ## 例题
 
-### 例题一 [「BJOI2015」树的同构](https://www.luogu.org/problemnew/show/P5043) 
+### 例题一 [「BJOI2015」树的同构](https://www.luogu.com.cn/problemnew/show/P5043) 
 
 我们用上述方式任选其一进行哈希,注意到我们求得的是子树的 hash 值,也就是说只有当根一样时同构的两棵子树 hash 值才相同。由于数据范围较小,我们可以暴力求出以每个点为根时的哈希值,也可以通过 up and down 树形 dp 的方式,遍历树两遍求出以每个点为根时的哈希值,排序后比较。
 
index 3bcb1a8..6f6be98 100644 (file)
@@ -2,7 +2,7 @@ author: HeRaNO, Ir1d, konnyakuxzy, ksyx, Xeonacid, konnyakuxzy, greyqz
 
 ## 引子
 
-???+ note "[「SDOI2011」消耗战](https://www.luogu.org/problem/P2495)"
+???+ note "[「SDOI2011」消耗战](https://www.luogu.com.cn/problem/P2495)"
     ### 题目描述
     
     在一场战争中,战场由 $n$ 个岛屿和 $n-1$ 个桥梁组成,保证每两个岛屿间有且仅有一条路径可达。现在,我军已经侦查到敌军的总部在编号为 $1$ 的岛屿,而且他们已经没有足够多的能源维系战斗,我军胜利在望。已知在其他 $k$ 个岛屿上有丰富能源,为了防止敌军获取能源,我军的任务是炸毁一些桥梁,使得敌军不能到达任何能源丰富的岛屿。由于不同桥梁的材质和结构不同,所以炸毁不同的桥梁有不同的代价,我军希望在满足目标的同时使得总代价最小。
index 0d52ad9..e7098b4 100644 (file)
@@ -22,7 +22,7 @@ author: Konano, Enter-tainer, JulieSigtuna, GldHkkowo
     Libre 取自由之意,基于开源项目 [SYZOJ](https://github.com/syzoj/syzoj) 。
     题目所有测试数据以及提交的代码均对所有用户开放。
 -    [Lutece](https://acm.uestc.edu.cn/home) 始于 2018 年,电子科技大学在线评测系统, [项目开源](https://github.com/lutece-awesome) 。
--    [洛谷](https://www.luogu.org/) 始于 2013 年,社区群体庞大,OI 界的真题和习题较全,提供有偿教育服务。
+-    [洛谷](https://www.luogu.com.cn/) 始于 2013 年,社区群体庞大,OI 界的真题和习题较全,提供有偿教育服务。
 -    [牛客网](https://www.nowcoder.com/) 始于 2014 年,提供技术类求职备考、社群交流、企业招聘等服务。
 -    [NOJ](http://acm.njupt.edu.cn/) 始于 2018 年,南京邮电大学在线评测系统, [项目开源](https://github.com/ZsgsDesign/NOJ) ,自身拥有题目两千余,同时支持对多个国内外 OJ 的提交,可以直接在 NOJ 提交别的 OJ 的题。
 -    [NTUOJ](http://acm.csie.ntu.edu.tw) 始于 2007 年,台湾大学在线评测系统,基于开源项目 [Judge Girl](http://judgegirl.github.io/) 。
index deec685..c83294a 100644 (file)
@@ -287,4 +287,4 @@ xfce4-session
 
 ### 后记
 
-本文最初发布于 [洛谷日报 #6](https://www.luogu.org/discuss/show/48491) ,现由原作者搬运至此,有删改。
+本文最初发布于 [洛谷日报 #6](https://www.luogu.com.cn/discuss/show/48491) ,现由原作者搬运至此,有删改。
index c22757a..d48f582 100644 (file)
@@ -297,7 +297,7 @@ array([[0, 0, 1],
 
 相信大部分算法竞赛选手已经熟练掌握了 C++98 的语法。接下来我们展示一下 Python 语法的一些应用。
 
-接下来的例子是 [Luogu P4779「【模板】单源最短路径(标准版)」](https://www.luogu.org/problem/P4779) 的代码。我们将 C++ 代码与 Python 代码做出对比:
+接下来的例子是 [Luogu P4779「【模板】单源最短路径(标准版)」](https://www.luogu.com.cn/problem/P4779) 的代码。我们将 C++ 代码与 Python 代码做出对比:
 
 从声明一些常量开始:
 
index be3fe6c..bea2b48 100644 (file)
@@ -188,10 +188,10 @@ $$
 ## 习题
 
 -    [SPOJ MOD](https://www.spoj.com/problems/MOD/) 模板
--    [SDOI2013 随机数生成器](https://www.luogu.org/problem/P3306) 
+-    [SDOI2013 随机数生成器](https://www.luogu.com.cn/problem/P3306) 
 -    [BZOJ1319 Discrete Roots](http://www.lydsy.com/JudgeOnline/problem.php?id=1319) 模板
 -    [SDOI2011 计算器](https://loj.ac/problem/10214) 模板
--    [Luogu4195【模板】exBSGS/Spoj3105 Mod](https://www.luogu.org/problemnew/show/P4195) 模板
+-    [Luogu4195【模板】exBSGS/Spoj3105 Mod](https://www.luogu.com.cn/problemnew/show/P4195) 模板
 -    [Codeforces - Lunar New Year and a Recursive Sequence](https://codeforces.com/contest/1106/problem/F) 
 
      **本页面部分内容以及代码译自博文 [Дискретное извлечение корня](http://e-maxx.ru/algo/discrete_root) 与其英文翻译版 [Discrete Root](https://cp-algorithms.com/algebra/discrete-root.html) 。其中俄文版版权协议为 Public Domain + Leave a Link;英文版版权协议为 CC-BY-SA 4.0。** 
index 341ffb8..7e5b610 100644 (file)
@@ -44,7 +44,7 @@ $$
 H_n = \binom{2n}{n} - \binom{2n}{n-1}
 $$
 
-??? note " 例题[洛谷 P1044 栈](https://www.luogu.org/problem/P1044)"
+??? note " 例题[洛谷 P1044 栈](https://www.luogu.com.cn/problem/P1044)"
     题目大意:入栈顺序为 $1,2,\ldots ,n$ ,求所有可能的出栈顺序的总数。
 
 ```cpp
index 24a52c2..fc3d5f7 100644 (file)
@@ -141,10 +141,10 @@ $$
 
 推荐练习:POJ 2891
 
- [【模板】扩展中国剩余定理](https://www.luogu.org/problemnew/show/P4777) 
+ [【模板】扩展中国剩余定理](https://www.luogu.com.cn/problemnew/show/P4777) 
 
  [「NOI2018」屠龙勇士](https://uoj.ac/problem/396) 
 
- [「TJOI2009」猜数字](https://www.luogu.org/problemnew/show/P3868) 
+ [「TJOI2009」猜数字](https://www.luogu.com.cn/problemnew/show/P3868) 
 
  [「SDOI2010」古代猪文](https://loj.ac/problem/10229) 
index 1ff6c98..94c3ab3 100644 (file)
@@ -30,4 +30,4 @@ $$
 
  [「BZOJ 3798」特殊的质数](https://www.lydsy.com/JudgeOnline/problem.php?id=3798) :求 $[l,r]$ 区间内有多少个质数可以分解为两个正整数的平方和。
 
- [「Luogu P1822」魔法指纹](https://www.luogu.org/problem/show?pid=P1822) 
+ [「Luogu P1822」魔法指纹](https://www.luogu.com.cn/problem/show?pid=P1822) 
index c899d45..1828c30 100644 (file)
@@ -71,7 +71,7 @@ $$
 
 ## 问题一
 
-???+note "[P4213【模板】杜教筛(Sum)](https://www.luogu.org/problemnew/show/P4213)"
+???+note "[P4213【模板】杜教筛(Sum)](https://www.luogu.com.cn/problemnew/show/P4213)"
     题目大意:求 $S_1(n)= \sum_{i=1}^{n} \mu(i)$ 和 $S_2(n)= \sum_{i=1}^{n} \varphi(i)$ 的值, $n\le 2^{31} -1$ 。
 
 ### 莫比乌斯函数前缀和
@@ -180,7 +180,7 @@ $$
 
 ## 问题二
 
-???+note "[「LuoguP3768」简单的数学题](https://www.luogu.org/problemnew/show/P3768)"
+???+note "[「LuoguP3768」简单的数学题](https://www.luogu.com.cn/problemnew/show/P3768)"
     大意:求
     
     $$
index 9daa0cf..240af10 100644 (file)
@@ -179,7 +179,7 @@ $$
 
 在计算的时侯,因为 $3$ 个函数各有交错递归,因此可以考虑三个一起整体递归,同步计算,否则有很多项会被多次计算。这样实现的复杂度是 $O(\log n)$ 的。
 
-模板: [luogu5170](https://www.luogu.org/problemnew/show/P5170) 
+模板: [luogu5170](https://www.luogu.com.cn/problemnew/show/P5170) 
 
 ```cpp
 #include <bits/stdc++.h>
index 8e8c8e4..8f65b8a 100644 (file)
@@ -122,6 +122,6 @@ for (int i = 1; i <= n; ++i) inv[i] = sv[i] * s[i - 1] % p;
 
  [「NOIP2012」同余方程](https://loj.ac/problem/2605) 
 
- [「AHOI2005」洗牌](https://www.luogu.org/problem/P2054) 
+ [「AHOI2005」洗牌](https://www.luogu.com.cn/problem/P2054) 
 
  [「SDOI2016」排列计数](https://loj.ac/problem/2034) 
index f6cc8c0..6a9ae6e 100644 (file)
@@ -143,6 +143,6 @@ LL exlucas(LL m, LL n, LL P) {
 
 ## 习题
 
--    [Luogu3807【模板】卢卡斯定理](https://www.luogu.org/problemnew/show/P3807) 
+-    [Luogu3807【模板】卢卡斯定理](https://www.luogu.com.cn/problemnew/show/P3807) 
 -    [SDOI2010 古代猪文  卢卡斯定理](https://loj.ac/problem/10229) 
--    [Luogu4720【模板】扩展卢卡斯](https://www.luogu.org/problemnew/show/P4720) 
+-    [Luogu4720【模板】扩展卢卡斯](https://www.luogu.com.cn/problemnew/show/P4720) 
index d20e106..73e033d 100644 (file)
@@ -397,8 +397,8 @@ $$
 
 ## 习题
 
--    [洛谷 P1962 斐波那契数列](https://www.luogu.org/problemnew/show/P1962) ,即上面的例题,同题 POJ3070
--    [洛谷 P1349 广义斐波那契数列](https://www.luogu.org/problemnew/show/P1349) , $\text{base}$ 矩阵需要变化一下
--    [洛谷 P1939【模板】矩阵加速(数列)](https://www.luogu.org/problemnew/show/P1939) , $\text{base}$ 矩阵变成了 $3 \times 3$ 的矩阵,推导过程与上面差不多。
+-    [洛谷 P1962 斐波那契数列](https://www.luogu.com.cn/problemnew/show/P1962) ,即上面的例题,同题 POJ3070
+-    [洛谷 P1349 广义斐波那契数列](https://www.luogu.com.cn/problemnew/show/P1349) , $\text{base}$ 矩阵需要变化一下
+-    [洛谷 P1939【模板】矩阵加速(数列)](https://www.luogu.com.cn/problemnew/show/P1939) , $\text{base}$ 矩阵变成了 $3 \times 3$ 的矩阵,推导过程与上面差不多。
 
      **本页面部分内容译自博文 [Кратчайшие пути фиксированной длины, количества путей фиксированной длины](http://e-maxx.ru/algo/fixed_length_paths) 与其英文翻译版 [Number of paths of fixed length/Shortest paths of fixed length](https://cp-algorithms.com/graph/fixed_length_paths.html) 。其中俄文版版权协议为 Public Domain + Leave a Link;英文版版权协议为 CC-BY-SA 4.0。** 
index 3f37693..e9ede71 100644 (file)
@@ -279,7 +279,7 @@ $$
 
 ## 问题形式
 
-###  [「HAOI 2011」Problem b](https://www.luogu.org/problem/P2522) 
+###  [「HAOI 2011」Problem b](https://www.luogu.com.cn/problem/P2522) 
 
 求值(多组数据)
 
@@ -469,7 +469,7 @@ $$
     }
     ```
 
-###  [「BZOJ 2154」Crash 的数字表格](https://www.luogu.org/problem/P1829) 
+###  [「BZOJ 2154」Crash 的数字表格](https://www.luogu.com.cn/problem/P1829) 
 
 求值(对 $20101009$ 取模)
 
@@ -696,7 +696,7 @@ $$
     }
     ```
 
-###  [「luogu 3768」简单的数学题](https://www.luogu.org/problemnew/show/P3768) 
+###  [「luogu 3768」简单的数学题](https://www.luogu.com.cn/problemnew/show/P3768) 
 
 求
 
index 7689593..40db4f0 100644 (file)
@@ -1,6 +1,6 @@
 author: Ir1d, TrisolarisHD, YanWQ-monad, x4Cx58x54
 
-!!! note "例题 [Luogu P4781【模板】拉格朗日插值](https://www.luogu.org/problemnew/show/P4781)"
+!!! note "例题 [Luogu P4781【模板】拉格朗日插值](https://www.luogu.com.cn/problemnew/show/P4781)"
 
 ### 题目大意
 
index cc23b2c..7ff5aff 100644 (file)
@@ -77,7 +77,7 @@ long long binpow(long long a, long long b) {
 }
 ```
 
-模板: [Luogu P1226](https://www.luogu.org/problemnew/show/P1226) 
+模板: [Luogu P1226](https://www.luogu.com.cn/problemnew/show/P1226) 
 
 ## 应用
 
@@ -228,7 +228,7 @@ $$
 ??? note "前置技能"
     请先学习 [高精度](./bignum.md) 
 
-???+note " 例题【NOIP2003 普及组改编·麦森数】([原题在此](https://www.luogu.org/problemnew/show/P1045))"
+???+note " 例题【NOIP2003 普及组改编·麦森数】([原题在此](https://www.luogu.com.cn/problemnew/show/P1045))"
     题目大意:从文件中输入 P(1000&lt;P&lt;3100000),计算 $2^P−1$ 的最后 100 位数字(用十进制高精度数表示),不足 100 位时高位补 0。
 
 代码实现如下:
index a71da80..b75fd04 100644 (file)
@@ -517,7 +517,7 @@ $$
 
  `simplex` 是主过程,基本思想是找到一个 $c_e>0$ 的,然后找对这个 $e$ 限制最紧的 $l$ ,转动这组 $l,e$ ,注意精度控制 $\epsilon$ , $c_e>\epsilon$ ,还有找 $l$ 的时候 $a_{i,e}>\epsilon​$ 才行。
 
-??? note " 例题[「NOI2008」志愿者招募](https://www.luogu.org/problem/P3980)"
+??? note " 例题[「NOI2008」志愿者招募](https://www.luogu.com.cn/problem/P3980)"
     题目大意:长度为 $n​$ 的序列,第 $i​$ 位至少 $b_i​$ , $m​$ 种区间使 $[l_i,r_i] + 1​$ 代价为 $a_i​$ 。
 
 原始问题 $m​$ 个变量, $n​$ 个约束,当 $l_j \leq i \leq r_j​$ , $a_{ij} = 1​$ 。
index b5286e3..c86e6c9 100644 (file)
@@ -89,5 +89,5 @@ int calc(const std::string &s) {  // 计算转换好的后缀表达式
 ## 习题
 
 1.   [表达式求值(NOIP2013)](https://vijos.org/p/1849) 
-2.   [后缀表达式](https://www.luogu.org/problemnew/show/P1449) 
+2.   [后缀表达式](https://www.luogu.com.cn/problemnew/show/P1449) 
 3.   [Transform the Expression](https://www.spoj.com/problems/ONP/) 
index 036bf79..601915a 100644 (file)
@@ -211,4 +211,4 @@ inline bool check(double mid) {  //如果有负环返回 true
 
 -    [JSOI2016 最佳团体](https://loj.ac/problem/2071) 
 -    [SDOI2017 新生舞会](https://loj.ac/problem/2003) 
--    [UVa1389 Hard Life](https://www.luogu.org/problem/UVA1389) 
+-    [UVa1389 Hard Life](https://www.luogu.com.cn/problem/UVA1389) 
index e7b9dc0..032e3b4 100644 (file)
@@ -122,7 +122,7 @@ int rev_g(int g) {
 
 ## 习题
 
--    [CSP S2 2019 D1T1](https://www.luogu.org/problem/P5657) Difficulty: easy
+-    [CSP S2 2019 D1T1](https://www.luogu.com.cn/problem/P5657) Difficulty: easy
 
 -    [SGU #249 Matrix](http://codeforces.com/problemsets/acmsguru/problem/99999/249) Difficulty: medium
 
index 8d2fe7c..d2eab8a 100644 (file)
@@ -27,7 +27,7 @@
 
 关于降温:降温参数是略小于 $1$ 的常数,一般在 $[0.985, 0.999]$ 中选取。
 
-### 例 1 [「JSOI2008」球形空间产生器](https://www.luogu.org/problem/P4035) 
+### 例 1 [「JSOI2008」球形空间产生器](https://www.luogu.com.cn/problem/P4035) 
 
 题意:给出 $n$ 维空间中的 $n$ 个点,已知它们在同一个 $n$ 维球面上,求出球心。 $n \leq 10$ ,坐标绝对值不超过 $10000$ 。
 
@@ -85,7 +85,7 @@
 
 * * *
 
-### 例 2 [「BZOJ 3680」吊打 XXX](https://www.luogu.org/problem/P1337) 
+### 例 2 [「BZOJ 3680」吊打 XXX](https://www.luogu.com.cn/problem/P1337) 
 
 题意:求 $n$ 个点的带权类费马点。
 
index e6e9be0..8c81a6a 100644 (file)
@@ -57,8 +57,8 @@ for (int i = 1; i <= n; i++)
 
 ## 习题
 
- [luogu P4147 玉蟾宫](https://www.luogu.org/problemnew/show/P4147) 
+ [luogu P4147 玉蟾宫](https://www.luogu.com.cn/problemnew/show/P4147) 
 
- [luogu P1578 奶牛浴场](https://www.luogu.org/problemnew/show/P1578) 
+ [luogu P1578 奶牛浴场](https://www.luogu.com.cn/problemnew/show/P1578) 
 
- [「ZJOI2007」棋盘制作](https://www.luogu.org/problem/P1169) 
+ [「ZJOI2007」棋盘制作](https://www.luogu.com.cn/problem/P1169) 
index f36efff..0d0ef9b 100644 (file)
@@ -35,7 +35,7 @@ author: StudyingFather, Backl1ght, countercurrent-time, Ir1d, greyqz, MicDZ, ouu
 
 ## 例题
 
-???+note "例题[「国家集训队」数颜色 / 维护队列](https://www.luogu.org/problem/P1903)"
+???+note "例题[「国家集训队」数颜色 / 维护队列](https://www.luogu.com.cn/problem/P1903)"
 
     题目大意:给你一个序列,M 个操作,有两种操作:
 
index e8fbab6..bed562b 100644 (file)
@@ -205,7 +205,7 @@ void solve(int l, int r, int L, int R)
 
 ### 参考习题
 
- [「国家集训队」矩阵乘法](https://www.luogu.org/problemnew/show/P1527) 
+ [「国家集训队」矩阵乘法](https://www.luogu.com.cn/problemnew/show/P1527) 
 
  [「POI2011 R3 Day2」流星 Meteors](https://loj.ac/problem/2169) 
 
index c001cae..dbac67f 100644 (file)
@@ -64,7 +64,7 @@ int main() {
 
 区别在于必须使用自定义的随机数生成器: `std::shuffle(first, last, myrand())` 。
 
-下面是用 `rand()` 及 `random_shuffle()` 编写的一个数据生成器。生成数据为 [「ZJOI2012」灾难](https://www.luogu.org/problemnew/show/P2597) 的随机小数据。
+下面是用 `rand()` 及 `random_shuffle()` 编写的一个数据生成器。生成数据为 [「ZJOI2012」灾难](https://www.luogu.com.cn/problemnew/show/P2597) 的随机小数据。
 
 ```cpp
 #include <algorithm>
index 2de63fd..aba08d1 100644 (file)
@@ -46,7 +46,7 @@ $$
 
 ## 代码
 
-此处代码以 [「BZOJ 3680」吊打 XXX](https://www.luogu.org/problem/P1337) (求 $n$ 个点的带权类费马点)为例。
+此处代码以 [「BZOJ 3680」吊打 XXX](https://www.luogu.com.cn/problem/P1337) (求 $n$ 个点的带权类费马点)为例。
 
 ```cpp
 #include <cmath>
@@ -120,6 +120,6 @@ int main() {
 
 ## 习题
 
--    [「BZOJ 3680」吊打 XXX](https://www.luogu.org/problem/P1337) 
+-    [「BZOJ 3680」吊打 XXX](https://www.luogu.com.cn/problem/P1337) 
 -    [「JSOI 2016」炸弹攻击](https://loj.ac/problem/2076) 
--    [「HAOI 2006」均分数据](https://www.luogu.org/problem/P2503) 
+-    [「HAOI 2006」均分数据](https://www.luogu.com.cn/problem/P2503) 
index 2415365..34e9aeb 100644 (file)
@@ -16,7 +16,7 @@ A\*算法每次从 **优先队列** 中取出一个 $f$ 最小的,然后更新
 
 其实…… $h=0$ 时就是 [DFS](./dfs.md) 算法, $h=0$ 并且边权为 $1$ 时就是 [BFS](./bfs.md) 。
 
-## 例题 [八数码](https://www.luogu.org/problemnew/show/P1379) 
+## 例题 [八数码](https://www.luogu.com.cn/problemnew/show/P1379) 
 
 题目大意:在 $3\times 3$ 的棋盘上,摆有八个棋子,每个棋子上标有 1 至 8 的某一数字。棋盘中留有一个空格,空格用 0 来表示。空格周围的棋子可以移到空格中,这样原来的位置就会变成空格。给出一种初始布局和目标布局(为了使题目简单,设目标状态为
 
@@ -104,7 +104,7 @@ int main() {
 }
 ```
 
-## 例题 [k 短路](https://www.luogu.org/problemnew/show/P2483) 
+## 例题 [k 短路](https://www.luogu.com.cn/problemnew/show/P2483) 
 
 题目大意:按顺序求一个有向图上从结点 $s$ 到结点 $t$ 的所有路径最小的前任意多(不妨设为 $k$ )个。
 
index a2caee8..1d4e623 100644 (file)
@@ -30,7 +30,7 @@ while(队列q不为空)
 
 也称 meet in the middle,主要思想是将整个搜索过程分成两半,分别搜索,最后将两半的结果合并。由于搜索的复杂度往往是指数级的,而折半搜索可以使指数减半,也就能使复杂度开方。
 
-???+note "例题 [「USACO09NOV」灯 Lights](https://www.luogu.org/problemnew/show/P2962)"
+???+note "例题 [「USACO09NOV」灯 Lights](https://www.luogu.com.cn/problemnew/show/P2962)"
 
     有 $n$ 盏灯,每盏灯与若干盏灯相连,每盏灯上都有一个开关,如果按下一盏灯上的开关,这盏灯以及与之相连的所有灯的开关状态都会改变。一开始所有灯都是关着的,你需要将所有灯打开,求最小的按开关次数。
 
index 36cf9c3..a85e56f 100644 (file)
@@ -55,7 +55,7 @@ dfs(n, 1, 1);
 
 ## 例题
 
- [Luogu P1706 全排列问题](https://www.luogu.org/problemnew/show/P1706) 
+ [Luogu P1706 全排列问题](https://www.luogu.com.cn/problemnew/show/P1706) 
 
 C++ 代码:
 
index 69aadf4..a4c1ee6 100644 (file)
@@ -4,7 +4,7 @@
 
 由于概念过于抽象,我们使用例题讲解。
 
-??? note " 例题[「NOIP2005 普及组」采药](https://www.luogu.org/problemnew/show/P1048)"
+??? note " 例题[「NOIP2005 普及组」采药](https://www.luogu.com.cn/problemnew/show/P1048)"
     题目大意:有 $N$ 种物品和一个容量为 $W$ 的背包,每种物品有重量 $wi$ 和价值 $vi$ 两种属性,要求选若干个物品(每种物品只能选一次)放入背包使背包中物品的总价值最大且背包中物品的总重量不超过背包的容量。
 
 ## 代码构造
index 71dc7d7..e00fa46 100644 (file)
@@ -157,4 +157,4 @@ int main() {
 
 ## 练习题
 
- [旋转游戏 UVa1343](https://www.luogu.org/problem/UVA1343) 
+ [旋转游戏 UVa1343](https://www.luogu.com.cn/problem/UVA1343) 
index fee7081..2dc2376 100644 (file)
@@ -165,7 +165,7 @@ int query(char *t) {
 时间复杂度:定义 $|s_i|$ 是模板串的长度, $|S|$ 是文本串的长度, $|\Sigma|$ 是字符集的大小(常数,一般为 26)。如果连了 trie 图,时间复杂度就是 $\Theta(\sum|S_i|+n|\Sigma|+|S|)$ ,其中 $n$ 是 AC 自动机中结点的数目,并且最大可以达到 $\Theta(\sum|s_i|)$ 。如果不连 trie 图,并且在构建 fail 指针的时候避免遍历到空儿子,时间复杂度就是 $O(\sum|s_i|+|S|)$ 。
 
 ???+ note "模板 1"
-     [LuoguP3808【模板】AC 自动机(简单版)](https://www.luogu.org/problemnew/show/P3808) 
+     [LuoguP3808【模板】AC 自动机(简单版)](https://www.luogu.com.cn/problemnew/show/P3808) 
 
     ```cpp
     #include <bits/stdc++.h>
@@ -223,7 +223,7 @@ int query(char *t) {
     ```
 
 ???+ note "模板 2"
-     [P3796 【模板】AC 自动机(加强版)](https://www.luogu.org/problemnew/show/P3796) 
+     [P3796 【模板】AC 自动机(加强版)](https://www.luogu.com.cn/problemnew/show/P3796) 
 
     ```cpp
     #include <bits/stdc++.h>
index 060ee57..9a11897 100644 (file)
@@ -179,7 +179,7 @@ for (int i = 0, l = 0, r = -1; i < n; i++) {
 ## 练习题目
 
 -    [UVA #11475 "Extend to Palindrome"](https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2470) 
--    [「国家集训队」最长双回文串](https://www.luogu.org/problemnew/show/P4555) 
+-    [「国家集训队」最长双回文串](https://www.luogu.com.cn/problemnew/show/P4555) 
 
 * * *
 
index fd0e0da..9eceedf 100644 (file)
@@ -80,7 +80,7 @@
 
 由于回文树的构造过程中,节点本身就是按照拓扑序插入,因此只需要逆序枚举所有状态,将当前状态的出现次数加到其 fail 指针对应状态的出现次数上即可。
 
-例题: [「APIO2014」回文串](https://www.luogu.org/problem/P3649) 
+例题: [「APIO2014」回文串](https://www.luogu.com.cn/problem/P3649) 
 
 定义 $s$ 的一个子串的存在值为这个子串在 $s$ 中出现的次数乘以这个子串的长度。对于给定的字符串 $s$ ,求所有回文子串中的最大存在值。
 
@@ -332,11 +332,11 @@ border:若 $0 \le r < |s|$ , $pre(s,r)=suf(s,r)$ ,就称 $pre(s,r)$ 是 $s
 
 ## 例题
 
--    [最长双回文串](https://www.luogu.org/problem/P4555) 
+-    [最长双回文串](https://www.luogu.com.cn/problem/P4555) 
 
--    [拉拉队排练](https://www.luogu.org/problem/P1659) 
+-    [拉拉队排练](https://www.luogu.com.cn/problem/P1659) 
 
--    [「SHOI2011」双倍回文](https://www.luogu.org/problem/P4287) 
+-    [「SHOI2011」双倍回文](https://www.luogu.com.cn/problem/P4287) 
 
 -    [HDU 5421 Victor and String](http://acm.hdu.edu.cn/showproblem.php?pid=5421) 
 
index 84b8850..5855d98 100644 (file)
@@ -246,7 +246,7 @@ for (i = 1; i <= n; ++i) {
 
 将字符串 $S$ 复制一份变成 $SS$ 就转化成了后缀排序问题。
 
-例题: [「JSOI2007」字符加密](https://www.luogu.org/problem/P4051) 。
+例题: [「JSOI2007」字符加密](https://www.luogu.com.cn/problem/P4051) 。
 
 ### 在字符串中找子串
 
@@ -254,7 +254,7 @@ for (i = 1; i <= n; ++i) {
 
 ### 从字符串首尾取字符最小化字典序
 
-例题: [「USACO07DEC」Best Cow Line](https://www.luogu.org/problem/P2870) 。
+例题: [「USACO07DEC」Best Cow Line](https://www.luogu.com.cn/problem/P2870) 。
 
 题意:给你一个字符串,每次从首或尾取一个字符组成字符串,问所有能够组成的字符串中字典序最小的一个。
 
@@ -408,7 +408,7 @@ for (i = 1, k = 0; i <= n; ++i) {
 
 ### 出现至少 k 次的子串的最大长度
 
-例题: [「USACO06DEC」Milk Patterns](https://www.luogu.org/problemnew/show/P2852) 。
+例题: [「USACO06DEC」Milk Patterns](https://www.luogu.com.cn/problemnew/show/P2852) 。
 
 ??? note "题解"
     出现至少 $k$ 次意味着后缀排序后有至少连续 $k$ 个后缀的 LCP 是这个子串。
@@ -506,7 +506,7 @@ for (i = 1, k = 0; i <= n; ++i) {
 
     考虑每个位置对答案的贡献是哪些后缀的 LCP,其实就是从它开始向左若干个连续的 $height$ 大于它的后缀中选一个,再从向右若干个连续的 $height$ 不小于它的后缀中选一个。这个东西可以用 [单调栈](../ds/monotonous-stack.md) 计算。
 
-    单调栈部分类似于 [Luogu P2659 美丽的序列](https://www.luogu.org/problem/P2659) 以及 [悬线法](../misc/largest-matrix.md)。
+    单调栈部分类似于 [Luogu P2659 美丽的序列](https://www.luogu.com.cn/problem/P2659) 以及 [悬线法](../misc/largest-matrix.md)。
 
 ??? note "参考代码"
     ```cpp
index e6d1273..514143f 100644 (file)
@@ -359,7 +359,7 @@ $$
 
 另一种方法是利用上述后缀自动机的树形结构。每个节点对应的子串数量是 $len(i)-len(link(i))$ ,对自动机所有节点求和即可。
 
-例题: [【模板】后缀自动机](https://www.luogu.org/problem/P3804) , [SDOI2016 生成魔咒](https://loj.ac/problem/2033) 
+例题: [【模板】后缀自动机](https://www.luogu.com.cn/problem/P3804) , [SDOI2016 生成魔咒](https://loj.ac/problem/2033) 
 
 ### 所有不同子串的总长度
 
@@ -585,7 +585,7 @@ $$
 ## 例题
 
 -    [HihoCoder #1441 : 后缀自动机一·基本概念](http://hihocoder.com/problemset/problem/1441) 
--    [【模板】后缀自动机](https://www.luogu.org/problem/P3804) 
+-    [【模板】后缀自动机](https://www.luogu.com.cn/problem/P3804) 
 -    [SDOI2016 生成魔咒](https://loj.ac/problem/2033) 
 -    [SPOJ - SUBLEX](https://www.spoj.com/problems/SUBLEX/) 
 -    [TJOI2015 弦论](https://loj.ac/problem/2102) 
@@ -597,7 +597,7 @@ $$
 -    [HDu4436 str2int](http://acm.hdu.edu.cn/showproblem.php?pid=4436) 
 -    [HDu6583 Typewriter](http://acm.hdu.edu.cn/showproblem.php?pid=6583) 
 -    [Codeforces 235C Cyclical Quest](https://codeforces.com/problemset/problem/235/C) 
--    [CTSC2012 熟悉的文章](https://www.luogu.org/problem/P4022) 
+-    [CTSC2012 熟悉的文章](https://www.luogu.com.cn/problem/P4022) 
 -    [NOI2018 你的名字](https://uoj.ac/problem/395) 
 
 ## 相关资料
index 7d17b25..ae198cb 100644 (file)
@@ -48,7 +48,7 @@ struct trie {
 
 字典树最基础的应用——查找一个字符串是否在“字典”中出现过。
 
-???+note "[于是他错误的点名开始了](https://www.luogu.org/problemnew/show/P2580)"
+???+note "[于是他错误的点名开始了](https://www.luogu.com.cn/problemnew/show/P2580)"
     给你 $n$ 个名字串,然后进行 $m$ 次点名,每次你需要回答“名字不存在”、“第一次点到这个名字”、“已经点过这个名字”之一。
 
     $1\le n\le 10^4$, $1\le m\le 10^5$,所有字符串长度不超过 $50$。
@@ -110,7 +110,7 @@ Trie 是 [AC 自动机](./ac-automaton.md) 的一部分。
 
 将数的二进制表示看做一个字符串,就可以建出字符集为 $\{0,1\}$ 的 Trie 树。
 
-???+note "[BZOJ1954 最长异或路径](https://www.luogu.org/problem/P4551)"
+???+note "[BZOJ1954 最长异或路径](https://www.luogu.com.cn/problem/P4551)"
     给你一棵带边权的树,求 $(u, v)$ 使得 $u$ 到 $v$ 的路径上的边权异或和最大,输出这个最大值。
 
     点数不超过 $10^5$,边权在 $[0,2^{31})$ 内。
index 3a9ba78..9bc111f 100644 (file)
@@ -68,7 +68,7 @@
 >
 > ——[vfk《UOJ 精神之源流》][1]
 
-例子: [「XR-1」柯南家族](https://www.luogu.org/problemnew/show/P5346) ,做法的前后两部分完全割裂,前半部分为 [「模板」树上后缀排序](https://www.luogu.org/problemnew/show/P5353) ,后半部分是经典树上问题。就算是随意输入树的点权,依然可以做第二部分,前后部分没有联系。
+例子: [「XR-1」柯南家族](https://www.luogu.com.cn/problemnew/show/P5346) ,做法的前后两部分完全割裂,前半部分为 [「模板」树上后缀排序](https://www.luogu.com.cn/problemnew/show/P5353) ,后半部分是经典树上问题。就算是随意输入树的点权,依然可以做第二部分,前后部分没有联系。
 
 > 一类 OI 题以数学为主,无论是题目描述还是做法都是数学题的特征,并且解法中不含算法相关的知识点,这类 OI 题目统称为纯数学题。
 >
@@ -103,7 +103,7 @@ OI 中的数学题与其它数学题的区别,也是体现 OI 本质的一个
 网上有很多 LaTeX 的教程,如:
 
 -    [LaTeX 入门](../intro/latex.md#_22) 
--    [LaTeX 数学公式大全](https://www.luogu.org/blog/IowaBattleship/latex-gong-shi-tai-quan) 
+-    [LaTeX 数学公式大全](https://www.luogu.com.cn/blog/IowaBattleship/latex-gong-shi-tai-quan) 
 -    [LaTeX 各种命令,符号](https://blog.csdn.net/garfielder007/article/details/51646604) 
 
 使用时请注意 [LaTeX 公式的格式要求](../intro/htc.md#latex) 。
@@ -538,7 +538,7 @@ Codeforces 是全球最著名的算法竞赛网站之一,题目质量较高,
 
 #### 个人公开赛
 
-在 [我的题库](https://www.luogu.org/app/userproblem) 中出题并提交比赛申请。
+在 [我的题库](https://www.luogu.com.cn/app/userproblem) 中出题并提交比赛申请。
 
 #### 团队公开赛