Skip to content

Commit

Permalink
fix: 修复一些格式、内链相关问题 (OI-wiki#5153)
Browse files Browse the repository at this point in the history
* fix(pas-cpp.md): 更新过期的内链

* fix(block-list.md): 去除不必要的图片内链

* fix: 修正部分 details 块的空行缩进
空行不始终缩进的写法在主站可以被正常渲染;但经由 remark-details 处理时,details 块在空行处会提前结束。

* fix: 连续的行内公式(`$...$`)之间应有空格

* style: format markdown files with remark-lint

* fix(problems.md): 规避代码块自动格式化

* style: format markdown files with remark-lint

* fix: 合并连续的行内公式

* fix(problems.md): clang-format off,并给出必要的解释

* style: format markdown files with remark-lint

* fix: 规范 details 写法,规避自动转义

---------

Co-authored-by: 24OI-bot <[email protected]>
  • Loading branch information
megakite and 24OI-bot authored Sep 24, 2023
1 parent 08d4e2d commit e10a115
Show file tree
Hide file tree
Showing 18 changed files with 88 additions and 93 deletions.
19 changes: 10 additions & 9 deletions docs/contest/problems.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,17 @@ STDIO 交互的一个明显优势在于它可以支持任何编程语言,但

题目很经典,但是在绝大多数 OJ 上都很难实现。

??? 参考代码
??? note "参考代码"
**注意**:源代码不包含下方第一行(即 `// clang-format off`)。


```c++
#include<cstdio>
char *s={"#include<cstdio>%cchar *s={%c%s%c};%cint main(){printf(s,10,34,s,34,10);return 0;}"};
int main(){printf(s,10,34,s,34,10);return 0;}
```
```c++
// clang-format off
#include<cstdio>

char *s={"#include<cstdio>%cchar *s={%c%s%c};%cint main(){printf(s,10,34,s,34,10);return 0;}"};

int main(){printf(s,10,34,s,34,10);return 0;}
```

## 参考资料与注释

Expand Down
2 changes: 1 addition & 1 deletion docs/ds/block-list.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
author: HeRaNO, konnyakuxzy, littlefrog

[![./images/kuaizhuanglianbiao.png](./images/kuaizhuanglianbiao.png "./images/kuaizhuanglianbiao.png")](./images/kuaizhuanglianbiao.png "./images/kuaizhuanglianbiao.png")
![./images/kuaizhuanglianbiao.png](./images/kuaizhuanglianbiao.png "./images/kuaizhuanglianbiao.png")

块状链表大概就长这样……

Expand Down
6 changes: 3 additions & 3 deletions docs/geometry/convex-hull.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

???+ note "代码实现"
=== "C++"

```cpp
// stk[] 是整型,存的是下标
// p[] 存储向量或点
Expand Down Expand Up @@ -70,9 +70,9 @@
h[i] = p[stk[i]];
int ans = tp - 1;
```

=== "Python"

```python
stk = [] # 是整型,存的是下标
p = [] # 存储向量或点
Expand Down
6 changes: 3 additions & 3 deletions docs/graph/flow/max-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ Ford–Fulkerson 增广是计算最大流的一类算法的总称。该方法运

???+ note "证明"
假设某一轮增广后,我们得到流 $f$ 使得 $G_f$ 上不存在增广路,即 $G_f$ 上不存在 $s$ 到 $t$ 的路径。此时我们记从 $s$ 出发可以到达的结点组成的点集为 $S$,并记 $T = V \setminus S$。

显然,$\{S, T\}$ 是 $G_f$ 的一个割,且 $||S, T|| = \sum_{u \in S} \sum_{v \in T} c_f(u, v) = 0$。由于剩余容量是非负的,这也意味着对于任意 $u \in S, v \in T, (u, v) \in E_f$,均有 $c_f(u, v) = 0$。以下我们将这些边分为存在于原图中的边和反向边两种情况讨论:

- $(u, v) \in E$:此时,$c_f(u, v) = c(u, v) - f(u, v) = 0$,因此有 $c(u, v) = f(u, v)$,即 $\{(u, v) \mid u \in S, v \in T\}$ 的所有边均满流;
- $(v, u) \in E$:此时,$c_f(u, v) = c(u, v) - f(u, v) = 0 - f(u, v) = f(v, u) = 0$,即 $\{(v, u) \mid u \in S, v \in T\}$ 的所有边均空流。

因此,增广停止后,上述流 $f$ 满足取等条件。根据引理指出的大小关系,自然地,$f$ 是 $G$ 的一个最大流,$\{S, T\}$ 是 $G$ 的一个最小割。

容易看出,Kőnig 定理是最大流最小割定理的特殊情形。实际上,它们都和线性规划中的对偶有关。
Expand Down
52 changes: 26 additions & 26 deletions docs/graph/rings-count.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

???+ note "[例题 1:Codeforces Beta Round 11 D. A Simple Task](https://codeforces.com/problemset/problem/11/D)"
给定一个简单图,求图中简单环的数目。简单环是指没有重复顶点或边的环。

结点数目 $1\leq n\leq 19$。

??? note "解题思路"
考虑状态压缩动态规划。记 $f(s,i)$ 表示满足当前经过结点集合为 $s$,且现在在结点 $i$ 上,且第一个结点为结点集合 $s$ 中 **编号最小的那个** 的路径条数。

对于状态 $f(s,i)$,枚举下一个结点 $u$。若 $u$ 在集合 $s$ 中且是编号最小的那个(即起点),就将答案 $A$ 加上 $f(s,i)$。若 $u$ 不在 $s$ 中,就将 $f(s,i)$ 加上 $f(s\cup\{u\},u)$。

这样会把二元环(即重边)也算上,并且每个非二元环会被计算两次(因为固定起点可以向两个方向走),所以答案为 $\dfrac{A-m}2$,其中 $m$ 表示边数。时间复杂度 $O(2^nm)$。

??? note "示例代码"
Expand All @@ -25,9 +25,9 @@

??? note "该图没有环的证明"
反证法,假设存在环,那么环中的点度数一个比一个大,要形成环,所有点的度数必须相等,但是编号必定不同,矛盾。

所以定向后图肯定不存在环。

事实上,上述定向规则满足严格偏序的条件,所以按此规则构造的图(也即该偏序的 Hasse 图)一定是一个 DAG。

枚举 $u$ 和 $u$ 指向的点 $v$,再在 $v$ 指向的点中枚举 $w$,检验 $u$ 是否与 $w$ 相连即可。
Expand All @@ -36,15 +36,15 @@

???+ note "时间复杂度证明"
对于定向部分,遍历了所有的边,时间复杂度 $O(n+m)$。

对于每一对 $(v,\ w)$,$u$ 的数量都不超过 $v$ 的入度 $d^-(v)$。

若 $d^-(v)\leq\sqrt m$,由于 $w$ 的个数至多为 $n$,所以这部分时间复杂度为 $O(n\sqrt m)$。

若 $d^-(v) > \sqrt m$,由于 $v$ 指向 $w$,所以 $d(v) \leq d(w)$,得出 $d(w) > \sqrt m$,但是总边数只有 $m$,所以这样的 $w$ 的个数至多为 $\sqrt m$,故时间复杂度为 $O(m\sqrt m)$。

总时间复杂度为 $O(n+m+n\sqrt m+m\sqrt m)=O(m\sqrt m)$。

事实上,如果定向时从度数大的点指向度数小的点,复杂度也正确,只需要交换 $u,\ w$ 两个点,上述证明也成立。

???+ note " 示例代码([洛谷 P1989 无向图三元环计数](https://www.luogu.com.cn/problem/P1989))"
Expand All @@ -56,14 +56,14 @@

???+ note "[HDU 6184 Counting Stars](https://vjudge.net/problem/HDU-6184)"
给定一张有 $n$ 个点和 $m$ 条边的无向图,求下面图形的出现次数。

![](./images/rings-count1.svg)

$2\leq n\leq 10^5$,$1\leq m\leq\min\left\{2\times 10^5,\ \dfrac{n(n-1)}2\right\}$。

??? note "解题思路"
这个图形是两个三元环共用了一条边形成的。所以我们先跑一遍三元环计数,统计出一条边上三元环的数量,然后枚举共用的那条边,设有 $x$ 个三元环中有此边,那么对答案的贡献就是 $\dbinom x2$。

时间复杂度 $O(m\sqrt m)$。

??? note "示例代码"
Expand Down Expand Up @@ -123,31 +123,31 @@

???+ note "[Gym 102028L Connected Subgraphs](https://codeforces.com/gym/102028/problem/L)"
给定一张有 $n$ 个点和 $m$ 条边的无向图,求四条边的导出子图连通的情况数。

$4\leq n\leq 10^5$,$4\leq m\leq 2\times 10^5$。

??? note "解题思路"
容易把情况分为五种:菊花图、四元环、三元环上一个点连出一条边、四个点构成的链中间一个点连出一条边以及五个点构成的链。

菊花图直接枚举点的度数,用组合数解决即可。四元环可以直接按照上述算法求得。三元环部分只需枚举三元环 $(u,\ v,\ w)$,那么对答案的贡献就是 $[d(u)-2]+[d(v)-2]+[d(w)-2]$。

下面考虑第四种情况。考虑枚举度数为 $2$ 的点 $x$,再枚举与它相邻的一个结点 $y$ 作为度数为 $3$ 的那个点。此时对答案的贡献为 $[d(x)-1]\cdot\dbinom{d(y)-1}2$。但是注意到 $y$ 的相邻节点可能会和 $x$ 的相邻结点重合,此时的图形等价于第三种情况。但是每种多算的第三种情况都会被多算两次(因为有两个度数为 $3$ 的点),所以应该减去第三种情况数目的两倍。

对于最后一种情况,先枚举中间的点 $x$,那么容易发现对答案的贡献是

$$
\sum_{y\in son_x}\sum_{z\in son_x}[d(y)-1]\cdot[d(z)-1].
$$

同样地,这其中有多算的部分。设 $y$ 的相邻结点为 $s$,$z$ 的相邻结点为 $t$,那么思考后发现多算的有如下几种情况:

1. $y$ 与 $t$ 重合,但是 $s$ 与 $z$ 不重合时,等价于第三种情况;
2. $s$ 与 $z$ 重合,但是 $y$ 与 $t$ 不重合时,同样等价于第三种情况;
3. $y$ 与 $t$,$s$ 与 $z$ 都重合时,等价于一个三元环;
4. $s$ 与 $t$ 重合时,等价于一个四元环(第二种情况)。

1. $y$ 与 $t$ 重合,但是 $s$ 与 $z$ 不重合时,等价于第三种情况;
2. $s$ 与 $z$ 重合,但是 $y$ 与 $t$ 不重合时,同样等价于第三种情况;
3. $y$ 与 $t$,$s$ 与 $z$ 都重合时,等价于一个三元环;
4. $s$ 与 $t$ 重合时,等价于一个四元环(第二种情况)。
考虑到第三种情况中两个度数 $2$ 的点作为 $x$ 时正好分别对应上述多算情况的 1 和 2,所以要额外减去第三种情况数目的两倍。对于一个三元环,三个结点都可以作为 $x$,多算了 $3$ 次。同样的,四元环的情况被多算了 $4$ 次。

于是我们就得出了所有情况的算法,时间复杂度为 $O(n+m\sqrt m)$。

??? note "示例代码"
Expand Down
2 changes: 0 additions & 2 deletions docs/graph/tree-divide.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
由于这里查询的是树上距离为 $[0,k]$ 的点对数量,所以我们用线段树来支持维护和查询。

??? note "参考代码"


```cpp
--8<-- "docs/graph/code/tree-divide/tree-divide_2.cpp"
```
Expand Down
30 changes: 14 additions & 16 deletions docs/graph/virtual-tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ author: HeRaNO, Ir1d, konnyakuxzy, ksyx, Xeonacid, konnyakuxzy, greyqz, sshwy

???+ note "[「SDOI2011」消耗战](https://www.luogu.com.cn/problem/P2495)"
**题目描述**

在一场战争中,战场由 $n$ 个岛屿和 $n-1$ 个桥梁组成,保证每两个岛屿间有且仅有一条路径可达。现在,我军已经侦查到敌军的总部在编号为 $1$ 的岛屿,而且他们已经没有足够多的能源维系战斗,我军胜利在望。已知在其他 $k$ 个岛屿上有丰富能源,为了防止敌军获取能源,我军的任务是炸毁一些桥梁,使得敌军不能到达任何能源丰富的岛屿。由于不同桥梁的材质和结构不同,所以炸毁不同的桥梁有不同的代价,我军希望在满足目标的同时使得总代价最小。

侦查部门还发现,敌军有一台神秘机器。即使我军切断所有能源之后,他们也可以用那台机器。机器产生的效果不仅仅会修复所有我军炸毁的桥梁,而且会重新随机资源分布(但可以保证的是,资源不会分布到 $1$ 号岛屿上)。不过侦查部门还发现了这台机器只能够使用 $m$ 次,所以我们只需要把每次任务完成即可。

**输入格式**

第一行一个整数 $n$,代表岛屿数量。

接下来 n-1 行,每行三个整数 $u,v,w$,代表 $u$ 号岛屿和 $v$ 号岛屿由一条代价为 $c$ 的桥梁直接相连,保证 $1\le u,v\le n$ 且 $1\le c\le 10^5$。

第 $n+1$ 行,一个整数 $m$,代表敌方机器能使用的次数。

接下来 $m$ 行,每行一个整数 $k_i$,代表第 $i$ 次后,有 $k_i$ 个岛屿资源丰富,接下来 $k$ 个整数 $h_1,h_2,\cdots ,h_k$,表示资源丰富岛屿的编号。

**输出格式**

输出有 $m$ 行,分别代表每次任务的最小代价。

**数据范围**

对于 $100\%$ 的数据,$2\le n\le 2.5\times 10^5,m\ge 1,\sum k_i\le 5\times 10^5,1\le k_i\le n-1$。

### 过程
Expand Down Expand Up @@ -117,14 +117,12 @@ author: HeRaNO, Ir1d, konnyakuxzy, ksyx, Xeonacid, konnyakuxzy, greyqz, sshwy
为什么连接 $lca$ 和 $y$ 可以做到不重不漏呢?

??? note "证明"


如果 $x$ 是 $y$ 的祖先,那么 $x$ 直接到 $y$ 连边。因为 dfn 序保证了 $x$ 和 $y$ 的 dfn 序是相邻的,所以 $x$ 到 $y$ 的路径上面没有关键点。

如果 $x$ 不是 $y$ 的祖先,那么就把 $lca(x,y)$ 当作 $y$ 的的祖先,根据上一种情况也可以证明 $lca(x,y)$ 到 $y$ 点的路径上不会有关键点。

所以连接 $lca$ 和 $y$,不会遗漏,也不会重复。

另外第一个点没有被一个节点连接会不会有影响呢?因为第一个点一定是这棵树的根,所以不会有影响,所以总边数就是 $m-1$ 条。

因为至少要两个实点才能够召唤出来一个虚点,再加上一个根节点,所以虚树的点数就是实点数量的两倍。
Expand Down
6 changes: 3 additions & 3 deletions docs/intro/format.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,14 @@
```text
??? note "标题"
这个文本框会被默认折叠。

推荐将 **解题代码** 放在折叠文本框内。

???+note "[HDOJ 的「A + B Problem」](https://vjudge.net/problem/HDU-1000)"
标题也可以使用 Markdown 的超链接。这里的超链接是 HDOJ 的「A + B Problem」。

而且推荐以这种方式**标注原题链接**。

注意双引号的位置。
```

Expand Down
6 changes: 3 additions & 3 deletions docs/lang/pas-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -748,12 +748,12 @@ C/C++ 的指针是很灵活的东西,如果想要彻底理解指针,建议
### 错误排查与技巧
- [常见错误 - OI Wiki](../../intro/common-mistakes/)
- [常见技巧 - OI Wiki](../../intro/common-tricks/)
- [常见错误 - OI Wiki](../../contest/common-mistakes/)
- [常见技巧 - OI Wiki](../../contest/common-tricks/)
### C++ 语言资料
- [学习资源 - OI Wiki](../../intro/resources/)
- [学习资源 - OI Wiki](../../contest/resources/)
- [cppreference.com](https://zh.cppreference.com/) - 最重要的 C/C++ 参考资料
- [C++ 教程 - 菜鸟教程](https://www.runoob.com/cplusplus/cpp-tutorial.html)
- [C++ Language - C++ Tutorials](https://www.cplusplus.com/doc/tutorial/)
Expand Down
18 changes: 9 additions & 9 deletions docs/math/combinatorics/graph-enumeration.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ $$

???+ note " 例题 [「SPOJ KPGRAPHS」Counting Graphs](http://www.spoj.com/problems/KPGRAPHS/)"
题目大意:求有 $n$ 个结点的分别满足下列性质的有标号图的方案数($n \leq 1000$)。

- 连通图 [A001187](https://oeis.org/A001187)。
- 欧拉图 [A033678](https://oeis.org/A033678)。
- 二分图 [A047864](https://oeis.org/A047864)。
- 连通图 [A001187](https://oeis.org/A001187)
- 欧拉图 [A033678](https://oeis.org/A033678)
- 二分图 [A047864](https://oeis.org/A047864)

本题限制代码长度,因而无法直接使用多项式模板,但生成函数依然可以帮助我们进行分析。

Expand Down Expand Up @@ -251,11 +251,11 @@ $$

???+ note " 例题 [「SPOJ PT07D」Let us count 1 2 3](https://www.spoj.com/problems/PT07D/)"
题目大意:求有 n 个结点的分别满足下列性质的树的方案数。

- 有标号有根树 [A000169](https://oeis.org/A000169)。
- 有标号无根树 [A000272](https://oeis.org/A000272)。
- 无标号有根树 [A000081](https://oeis.org/A000081)。
- 无标号无根树 [A000055](https://oeis.org/A000055)。
- 有标号有根树 [A000169](https://oeis.org/A000169)
- 有标号无根树 [A000272](https://oeis.org/A000272)
- 无标号有根树 [A000081](https://oeis.org/A000081)
- 无标号无根树 [A000055](https://oeis.org/A000055)

#### 有根树

Expand Down
4 changes: 2 additions & 2 deletions docs/math/coordinate.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ $$

???+ note "编程中圆周率的习惯写法"
在 C/C++ 语言中,一般取 $\pi$ 为 `acos(-1)`,只有这个值是最接近 $\pi$ 的浮点数。使用 `acos(-1)` 或者 `4 * atan(1)` 写出来的 $\pi$ 是 $3.14159265358979310000$。

采用其他值,例如 `acos(-1.0/2.0)``acos(1.0/2.0)``asin(1.0/2.0)` 等等,写出来的 $\pi$ 是 $3.14159265358979360000$,这就不是最接近 $\pi$ 的浮点数了。

如果你背得下来,也可以直接写 $3.1415926535897932$。

## 平面直角坐标系
Expand Down
2 changes: 1 addition & 1 deletion docs/math/number-theory/lucas.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ $\times 13\times 14\times 15\times 16\times 17\times 18\times 19\times20\times21

将其中所有 $q$ 的倍数提取,得到:

$22!=3^7 \times (1\times 2\times 3\times 4\times 5\times 6\times 7)$$\times(1\times 2\times 4\times 5\times 7\times 8\times 10 \times 11\times 13\times 14\times 16\times 17\times 19 \times 20 \times 22 )$
$22!=3^7 \times (1\times 2\times 3\times 4\times 5\times 6\times 7) \times (1\times 2\times 4\times 5\times 7\times 8\times 10 \times 11\times 13\times 14\times 16\times 17\times 19 \times 20 \times 22 )$

可以看到,式子分为三个整式的乘积:

Expand Down
2 changes: 1 addition & 1 deletion docs/math/numerical/lagrange.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ $$

??? note "代码实现"
因为在固定模 $998244353$ 意义下运算,计算乘法逆元的时间复杂度我们在这里暂且认为是常数时间。

```cpp
--8<-- "docs/math/code/numerical/lagrange/lagrange_1.cpp"
```
Expand Down
2 changes: 1 addition & 1 deletion docs/math/young-tableau.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ $$
现在有一个长度为 $n$ 的随机排列,求它的最长上升子序列长度的期望。

???+ note "[CF1268B 杨氏多米诺骨牌](https://codeforces.com/problemset/problem/1268/B)"
给定一个具有 $n$ 列长度 $a_{1} ,a_{2},\ldots,a_{n}$$(a_{1} \geq a_{2} \geq \ldots \geq a_{n} \geq 1)$ 的直方图。$a=[3,2,2,2,1]$ 的杨图。找到可以在此直方图中绘制的最大数量的非重叠多米诺骨牌($1 \times 2$ 或 $2 \times 1$ 矩形)。
给定一个具有 $n$ 列长度 $a_{1} ,a_{2},\ldots,a_{n}\,(a_{1} \geq a_{2} \geq \ldots \geq a_{n} \geq 1)$ 的直方图。$a=[3,2,2,2,1]$ 的杨图。找到可以在此直方图中绘制的最大数量的非重叠多米诺骨牌($1 \times 2$ 或 $2 \times 1$ 矩形)。

## 参考资料与拓展阅读

Expand Down
4 changes: 2 additions & 2 deletions docs/misc/mo-algo-2dimen.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

???+ note "[BZOJ 2639 矩形计算](https://hydro.ac/d/bzoj/p/2639)"
输入一个 $n\times m$ 的矩阵,矩阵的每一个元素都是一个整数,然后有 $q$ 个询问,每次询问一个子矩阵的权值。矩阵的权值是这样定义的,对于一个整数 $x$,如果它在该矩阵中出现了 $p$ 次,那么它给该矩阵的权值就贡献 $p^2$。

数据范围:$1\leq n,\ m\leq 200$,$0\leq q\leq 10^5$,$|$ 矩阵元素大小 $| \leq 2\times 10^9$。

??? note "解题思路"
Expand All @@ -33,7 +33,7 @@

???+ note "[洛谷 P1527 \[国家集训队\] 矩阵乘法](https://www.luogu.com.cn/problem/P1527)"
给你一个 $n\times n$ 的矩阵,$q$ 次询问,每次询问一个子矩形的第 $k$ 小数。

数据范围:$1\leq n\leq 500$,$1\leq q\leq 6\times 10^4$,$0\leq a_{i,j}\leq 10^9$。

首先和上一题一样,需要离散化整个矩阵。但是需要注意,本题除了需要对数值进行分块,还需要对数值的值域进行分块,才能求出答案。
Expand Down
8 changes: 3 additions & 5 deletions docs/misc/mo-algo-secondary-offline.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ author: Lyccrius
## 例题 1

???+ note "[Luogu P5047 \[Ynoi2019 模拟赛\] Yuno loves sqrt technology II](https://www.luogu.com.cn/problem/P5047)"


给你一个长为 $n$ 的序列 $a$,$m$ 次询问,每次查询一个区间的逆序对数。

数据范围:$1 \leq n,m \leq 10^5$,$0 \leq a_i \leq 10^9$。

查询区间逆序对数,在使用莫队的同时维护一颗权值线段树或权值树状数组,可以在 $O(n \sqrt n \log n)$ 的时间复杂度内解决该问题。当然,取块长 $T = \sqrt {n \log n}$ 更优。
Expand All @@ -21,9 +19,9 @@ author: Lyccrius

???+ note "[Luogu P5501 \[LnOI2019\] 来者不拒,去者不追](https://www.luogu.com.cn/problem/P5501)"
给定一个长度为 $n$ 的序列 $a$。给定 $m$ 个询问,每次询问一个区间中 $[l, r]$ 中所有数的「Abbi 值」之和。

Abbi 值定义为:若 $a_i$ 在询问区间 $[l, r]$ 中是第 $k$ 小,那么它的「Abbi 值」等于 $k \times a_i$。

数据范围:$1 \leq a_i \leq 100000$,$1 \leq l \leq r \leq n$,$1\leq n, m\leq 500000$。

??? note "示例代码"
Expand Down
Loading

0 comments on commit e10a115

Please sign in to comment.