版本比较
板子集
正文
增加 23 行删除 0 行
24 行未改动2526272829303132333421 行未改动5657585960616263646566676869707172737475767778798081828392 行未改动17617717817918018118218318455 行未改动24 行未改动
3. -Wl,-stack=1234567890 的作用是将程序运行时的栈空间大小设置为指定字节数。
:::info[通用]```cpp#include<bits/stdc++.h>#include<bits/extc++.h>21 行未改动//单测 cin>>n;}```
## solution
使用 pb\_ds 库中的 rope 解决。
### 介绍一下 rope
rope 是 pb\_ds 库中的一个分支,内部是一个块状链表,支持可持久化。
需要 `#include <bits/extc++.h>` 和 `using namespace __gnu_cxx;`。
### rope 的使用
可以直接使用 `rope <int> a` 来声明一个叫做 `a` 的 rope 。
`a.append(x)` 可以在 rope 后面添加一个元素 $x$,类似于 vector 。
`a[x]` 可以询问 rope 中下标为 $x$ 的元素,默认下标从 $0$ 开始。
`a.insert(x, y)` 可以在下标为 $x$ 的位置前插入元素 $y$。::::::info[优先队列]```cpppriority_queue<int>qwq;//大根堆92 行未改动 return 0;}
```
::::::info[分块]抓一篇题解。# 题解:P13981 数列分块入门 655 行未改动