摘要:
树状数组 + 二分 复杂度 $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]; 阅读全文
摘要:
树状数组 区间修改,区间查询 点击查看代码 #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]; 阅读全文
摘要:
树状数组 区间修改,单点查询 点击查看代码 #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 阅读全文
摘要:
树状数组 复杂度 $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] 阅读全文
摘要:
点击查看代码 #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] != 阅读全文