上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要: 差分的进一步应用 基础的差分 最高的牛 #include<iostream> #include<algorithm> #include<cstring> #include<set> using namespace std; const int N = 10010; typedef pair<int, 阅读全文
posted @ 2022-01-06 21:39 Xuuxxi 阅读(22) 评论(0) 推荐(0) 编辑
摘要: RR 右子树的右子树插入 > 左旋一次 LL 左子树的左子树插入 > 右旋一次 LR 左子树的右子树插入 > 先右旋再左旋 RL 右子树的左子树插入 > 先左旋再右旋 cite1 cite2 阅读全文
posted @ 2021-12-12 19:12 Xuuxxi 阅读(19) 评论(0) 推荐(0) 编辑
摘要: here a了捏 #include<iostream> #include<algorithm> #include<set> using namespace std; const int N = 200010; int n,m; int p[N]; int f = 0; //并查集 int find( 阅读全文
posted @ 2021-12-04 21:52 Xuuxxi 阅读(84) 评论(1) 推荐(0) 编辑
摘要: 前序 + 中序 #include<iostream> #include<deque> using namespace std; deque<int> rear,center,pref; void build(deque<int> pre,deque<int> cen){ int temp; if(p 阅读全文
posted @ 2021-11-22 11:20 Xuuxxi 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 食物链 带权并查集 #include<iostream> using namespace std; const int N = 100010; int p[N],d[N]; int n,k; int res = 0; int find(int x){ if(p[x] != x){ int rot = 阅读全文
posted @ 2021-11-15 21:21 Xuuxxi 阅读(49) 评论(0) 推荐(0) 编辑
摘要: cite 阅读全文
posted @ 2021-10-26 09:21 Xuuxxi 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 一些笔记 cite greater() 头文件 #include upper/lower_bound() 查找小于/小等于 相应的队列也要逆序存 对于想要查找小于/小等于 一定要先逆序数组/容器再查找,没查到也是返回end #include<iostream> #include<algorithm> 阅读全文
posted @ 2021-10-23 22:29 Xuuxxi 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 区间选点 区间问题一般对右端点进行排序并用右端点映射左端点 可以高效判断 wa 区间覆盖了,左端点不是最大值 #include<iostream> #include<algorithm> #include<map> using namespace std; int n; map<int,int> a 阅读全文
posted @ 2021-10-23 21:30 Xuuxxi 阅读(43) 评论(0) 推荐(0) 编辑
摘要: cite 阅读全文
posted @ 2021-10-23 20:42 Xuuxxi 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 线段树 线段树的建树,更新点、区间,查找点、区间 //左子树 u << 1, 右子树 u << 1 | 1 //建树或遍历核心是判断 mid 和 l,r 的关系 //是大区间包容小区间,优先遍历大区间 // lazy_tag 用作处理记录器,用到就处理,没用到只处理总节点,节省时间 //考虑最坏情况 阅读全文
posted @ 2021-10-15 21:33 Xuuxxi 阅读(36) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页