摘要: 树状数组 + 二分 复杂度 $n \cdot log^{2}(n)$ 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 2e5 + 10; int n; int h[N]; 阅读全文
posted @ 2022-07-19 23:33 wKingYu 阅读(26) 评论(0) 推荐(0)
摘要: 树状数组 区间修改,区间查询 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 2e5 + 10; int n, m; LL a[N]; LL tr1[N], tr2[N]; 阅读全文
posted @ 2022-07-19 22:16 wKingYu 阅读(31) 评论(0) 推荐(0)
摘要: 树状数组 区间修改,单点查询 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 2e5 + 10; int n, m; LL a[N]; LL tr[N]; int lowb 阅读全文
posted @ 2022-07-19 21:31 wKingYu 阅读(33) 评论(0) 推荐(0)
摘要: 树状数组 复杂度 $n \cdot log(n)$ 单点修改, 区间查询 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 2e5 + 10; int n; int a[N] 阅读全文
posted @ 2022-07-19 20:53 wKingYu 阅读(29) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 3e4 + 10; int p[N], sz[N], d[N]; int find(int x) { if (p[x] != 阅读全文
posted @ 2022-07-19 16:16 wKingYu 阅读(39) 评论(0) 推荐(0)