随笔分类 -  数据结构

摘要:普通平衡树 插入数值x. 删除数值x(若有多个相同的数,则只删除一个) 查询数值x的排名(若有多个相同的数,应输出最小排名) 查询排名为x的的数值 求数值x的前驱 求数值x的后继 #include<bits/stdc++.h> using namespace std; const int N=2e5 阅读全文
posted @ 2022-11-18 16:55 Dengpc 阅读(57) 评论(0) 推荐(0)
摘要:可持久化trie树 最大异或和 #include <iostream> using namespace std; const int N = 600010, M = N * 25; int n, m; // 序列初始长度、操作个数 int s[N]; // 原序列的异或前缀和 int tr[M][2 阅读全文
posted @ 2022-11-05 23:41 Dengpc 阅读(68) 评论(0) 推荐(0)
摘要:单点修改,区间查询 #include<bits/stdc++.h> using namespace std; #define int long long #define lowbit(x) (x&(-x)) const int N=5e5+10; int a[N],s[N]; int n,m; vo 阅读全文
posted @ 2022-11-03 19:40 Dengpc 阅读(46) 评论(0) 推荐(0)
摘要:简直噩梦,几道板子题我都debug好久 单点修改,区间查询 #include<bits/stdc++.h> using namespace std; const int N=5e5+10; typedef long long int LL; struct tree{ LL left,right,su 阅读全文
posted @ 2022-11-02 21:06 Dengpc 阅读(37) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2022-10-31 14:42 Dengpc 阅读(1) 评论(0) 推荐(0)