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
阅读全文
摘要:线段树 区间修改(加,乘),区间查询(求和) 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5e5 + 10; int n, m, p; LL w[N]; struct
阅读全文
摘要:差分 + 贪心 点击查看代码 #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 >>
阅读全文
摘要:分治 递归 点击查看代码 #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
阅读全文
摘要:位运算 大数乘法 点击查看代码 #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 >>
阅读全文
摘要:线段树 区间修改,区间查询(和) 点击查看代码 #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
阅读全文
摘要:线段树,转换为差分数组 单点修改,区间查询(和,最大公约数) 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5e5 + 10; int n, m; LL w[N]; st
阅读全文
摘要:线段树 单点修改,区间查询(子段和的最大值) 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5e5 + 10; int n, m; int w[N]; struct No
阅读全文
摘要:线段树 单点修改,区间查询(最大值) 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 2e5 + 10; int m, p; struct Node { int l, r;
阅读全文
摘要:树状数组 + 二分 复杂度 点击查看代码 #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
阅读全文
摘要:树状数组 复杂度 单点修改, 区间查询 点击查看代码 #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] !=
阅读全文
摘要:带边权的并查集 点击查看代码 #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,
阅读全文
摘要:点击查看代码 #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
阅读全文
摘要:并查集 + 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
阅读全文
摘要:点击查看代码 #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)
阅读全文
摘要:递推 点击查看代码 #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
阅读全文
摘要:点击查看代码 #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
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> #include<cmath> using namespace std; typedef long long LL; const int N = 10, M = 20; const double INF = 1e
阅读全文
摘要:点击查看代码 #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
阅读全文
摘要:点击查看代码 #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
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; typedef long long LL; const int N = 210; const int INF = 0x3f3f3f3f; int n; int w[N];
阅读全文
摘要:点击查看代码 #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[
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> #include<vector> #include<cmath> using namespace std; const int N = 18, M = 1 << N; int n, m; int path[N][
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> #include<vector> using namespace std; typedef long long LL; const int N = 110, M = 1 << 10; int n, m; int
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> #include<vector> using namespace std; typedef long long LL; const int N = 14, M = 1 << 12; const int mod =
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> #include<vector> using namespace std; typedef long long LL; const int N = 12, M = 1 << 10, K = 110; int n,
阅读全文