随笔分类 -  数据结构

线段树板子题自用
摘要:思路:单点修改,区间查询 #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 阅读(26) 评论(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 阅读(20) 评论(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 阅读(29) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示