随笔分类 -  数据结构

线段树板子题自用
摘要:思路:单点修改,区间查询 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; const int INF=0xffffff0; const int maxn=10 阅读全文

posted @ 2022-06-05 15:46 zesure 阅读(35) 评论(0) 推荐(0)

树状数组笔记
摘要:lowbit:保留数在2进制下最后一个1,前面全变0 模板1:单点修改,区间查询 # include <bits/stdc++.h> using namespace std; typedef long long ll; int n[500009]; int t,k; int lowbit(int m 阅读全文

posted @ 2022-05-30 20:17 zesure 阅读(33) 评论(0) 推荐(0)

并查集笔记
摘要:代码实现:通过路径压缩把某类节点统统并入根节点,类似于冠状病毒(? 首先把每个节点的父节点设置为他们自己 find函数以及修改父节点代码实现 int findset(int n){ return fa[n]==n?n:fa[n]=findset(fa[n]); } 并查集父节点查询与融合操作 int 阅读全文

posted @ 2022-05-23 11:23 zesure 阅读(33) 评论(0) 推荐(0)

导航