摘要: P3368 【模板】树状数组 2 #include<bits/stdc++.h> using namespace std; const int N=5e5+10; int a[N]; int c[N<<2]; int n,m; int lowbit(int x){ return x&-x; } vo 阅读全文
posted @ 2020-06-28 20:00 LightyaChoo 阅读(132) 评论(0) 推荐(0) 编辑
摘要: P3374 【模板】树状数组 1 #include<bits/stdc++.h> using namespace std; const int N=5e5+10; int n,m; int a[N]; int c[N<<2]; int lowbit(int x){ return x&-x; } vo 阅读全文
posted @ 2020-06-28 19:59 LightyaChoo 阅读(120) 评论(0) 推荐(0) 编辑
摘要: P3367 【模板】并查集 #include<bits/stdc++.h> using namespace std; const int N=1e4+10; int a[N]; int n,m; int fa[N]; int find(int x){ if(fa[x]==x){ return x; 阅读全文
posted @ 2020-06-28 19:58 LightyaChoo 阅读(122) 评论(0) 推荐(0) 编辑
摘要: P3372 【模板】线段树 1 #include<bits/stdc++.h> using namespace std; typedef long long ll; const ll N=1e5+10; ll a[N]; struct Node{ ll it; ll l; ll r; ll data 阅读全文
posted @ 2020-06-28 19:56 LightyaChoo 阅读(131) 评论(0) 推荐(0) 编辑