![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
剁diodio
这个作者很懒,什么都没留下…
展开
-
第15届台州学院校赛题解
简要题解原创 2022-11-13 12:37:54 · 1093 阅读 · 2 评论 -
树链剖分模板
#include<bits/stdc++.h>using namespace std;typedef long long LL;typedef long double dl;const LL N =1e5+5;int n,m,r,p;int a[N],h[N],e[N*2],ne[N*2],num;int dep[N],f[N],son[N],siz[N];int idx[N],top[N],b[N],cnt;void add(int x,int y){ e[num]原创 2022-03-18 11:50:42 · 372 阅读 · 3 评论 -
浅谈st表
st表的概念st表可以用于处理静态(不修改)的rmq问题(区间最值问题)O(logn)预处理 ,O(1)查询。是一种操作简单的数据结构。st表的实现st表通过倍增,区间dp来实现。st表预处理:void init(){ for(int i=1;i<=lg[n];i++) { for(int j=1;j+(1<<i)-1<=n;j++) { st[j][i]=max(st[j][i-1],st[j+(1<原创 2022-03-15 11:27:34 · 1540 阅读 · 0 评论 -
牛客练习赛 91 D 监狱逃亡 树状数组+离散化
题目描述:题解:代码:#include<bits/stdc++.h>using namespace std;typedef long long LL;const int mod=1000000007,N=5e5+5;int n;LL sum[5][N];LL a[N],b[N];vector<LL>vec;LL tr[N],m;int findx(LL x){ return lower_bound(vec.begin(), vec.end(),原创 2021-11-13 14:18:10 · 485 阅读 · 0 评论 -
牛客 小w的糖果 差分数组
题目描述:输入描述:输出描述:示例1:输入:410 11 110 12 210 13 310 31 12 23 3输出:1 1 1 1 1 1 1 1 1 10 1 2 3 4 5 6 7 8 90 0 1 4 9 16 25 36 49 641 2 4 8 14 22 32 44 58 74```![请添加图片描述](https://img-blog.csdnimg.cn/0b76e61933b445c9bb70635e02b71244.jpg?x-oss原创 2021-10-28 11:22:11 · 65 阅读 · 0 评论