07 2022 档案

摘要:单调性 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n, m, op; int a[N]; void solve() { scanf("%d 阅读全文
posted @ 2022-07-31 13:21 wKingYu 阅读(16) 评论(0) 推荐(0) 编辑
摘要:线段树 区间修改(加,乘),区间查询(求和) 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5e5 + 10; int n, m, p; LL w[N]; struct 阅读全文
posted @ 2022-07-30 10:46 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:差分 + 贪心 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; int n; int a[N], b[N]; void solve() { cin >> 阅读全文
posted @ 2022-07-23 18:16 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:分治 递归 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; const LL mod = 9901; LL a, b; LL qmi(LL a, LL 阅读全文
posted @ 2022-07-23 10:55 wKingYu 阅读(24) 评论(0) 推荐(0) 编辑
摘要:位运算 大数乘法 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5e5 + 10; LL a, b, p; void solve() { cin >> a >> b >> 阅读全文
posted @ 2022-07-21 18:18 wKingYu 阅读(16) 评论(0) 推荐(0) 编辑
摘要:线段树 区间修改,区间查询(和) 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5e5 + 10; int n, m; int w[N]; struct Node { i 阅读全文
posted @ 2022-07-21 17:25 wKingYu 阅读(16) 评论(0) 推荐(0) 编辑
摘要:线段树,转换为差分数组 单点修改,区间查询(和,最大公约数) 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5e5 + 10; int n, m; LL w[N]; st 阅读全文
posted @ 2022-07-21 11:34 wKingYu 阅读(21) 评论(0) 推荐(0) 编辑
摘要:线段树 单点修改,区间查询(子段和的最大值) 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5e5 + 10; int n, m; int w[N]; struct No 阅读全文
posted @ 2022-07-20 23:40 wKingYu 阅读(9) 评论(0) 推荐(0) 编辑
摘要:线段树 单点修改,区间查询(最大值) 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 2e5 + 10; int m, p; struct Node { int l, r; 阅读全文
posted @ 2022-07-20 20:49 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:树状数组 + 二分 复杂度 nlog2(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 阅读(19) 评论(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 阅读(15) 评论(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 阅读(18) 评论(0) 推荐(0) 编辑
摘要:树状数组 复杂度 nlog(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 阅读(24) 评论(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 阅读(23) 评论(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 阅读(43) 评论(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 阅读(27) 评论(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 阅读(29) 评论(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 阅读(26) 评论(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 阅读(31) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n; int h[N], e[N], ne[N], w[N], idx 阅读全文
posted @ 2022-07-11 21:24 wKingYu 阅读(31) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<cmath> using namespace std; typedef long long LL; const int N = 10, M = 20; const double INF = 1e 阅读全文
posted @ 2022-07-09 18:48 wKingYu 阅读(24) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; typedef long long LL; const int N = 60, M = 50; int n; int w[N]; LL f[N][N][M]; void 阅读全文
posted @ 2022-07-08 21:48 wKingYu 阅读(24) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; typedef long long LL; const int N = 50; int n; int w[N]; int f[N][N], g[N][N]; void d 阅读全文
posted @ 2022-07-07 23:27 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; typedef long long LL; const int N = 210; const int INF = 0x3f3f3f3f; int n; int w[N]; 阅读全文
posted @ 2022-07-07 22:30 wKingYu 阅读(18) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; const int N = 410; const int INF = 0x3f3f3f3f; int n; int w[N], s[N]; int f[N][N], g[ 阅读全文
posted @ 2022-07-07 22:03 wKingYu 阅读(30) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<vector> #include<cmath> using namespace std; const int N = 18, M = 1 << N; int n, m; int path[N][ 阅读全文
posted @ 2022-07-07 09:13 wKingYu 阅读(18) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<vector> using namespace std; typedef long long LL; const int N = 110, M = 1 << 10; int n, m; int 阅读全文
posted @ 2022-07-06 23:03 wKingYu 阅读(32) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<vector> using namespace std; typedef long long LL; const int N = 14, M = 1 << 12; const int mod = 阅读全文
posted @ 2022-07-06 20:51 wKingYu 阅读(17) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<vector> using namespace std; typedef long long LL; const int N = 12, M = 1 << 10, K = 110; int n, 阅读全文
posted @ 2022-07-06 00:02 wKingYu 阅读(35) 评论(0) 推荐(1) 编辑

欢迎阅读『2022 年 7月 随笔档案』
点击右上角即可分享
微信分享提示