上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 26 下一页
摘要: 树状数组 + 二分 复杂度 $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 阅读(16) 评论(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 阅读(13) 评论(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 阅读(15) 评论(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 阅读(17) 评论(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 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 带边权的并查集 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; int n, m; int p[N], d[N]; unordered_map<int, 阅读全文
posted @ 2022-07-18 19:06 wKingYu 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 2e5 + 10; int n, m; int p[N]; unordered_map<int,int> s; struct 阅读全文
posted @ 2022-07-16 11:37 wKingYu 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 并查集 + 01背包 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; int n, m, k; int p[N]; int v[N], w[N]; in 阅读全文
posted @ 2022-07-16 11:05 wKingYu 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; int n, m; int p[N]; int find(int x) { if (p[x] != x) 阅读全文
posted @ 2022-07-16 10:52 wKingYu 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 递推 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; char a[10][10]; char g[10][10]; int dx[] = {0, -1 阅读全文
posted @ 2022-07-11 23:22 wKingYu 阅读(28) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 26 下一页