06 2022 档案
摘要:点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 2e5 + 10; int n, m; int x[N], t[N]; vector<int> a, b, c; int f
阅读全文
摘要:点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; void solve() { LL p, q, b; scanf("%lld %lld %lld", &
阅读全文
摘要:贪心 + 单调栈 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n, k; int a[N]; void solve() { cin >> n
阅读全文
摘要:等价变形 + 前缀和 + 单调栈 + 二分 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n, res; int a[N]; LL s[N];
阅读全文
摘要:数论 + 贪心 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n; void solve() { cin >> n; int res = 1,
阅读全文
摘要:KMP + 状态机 点击查看代码 #include<iostream> #include<vector> #include<cstring> #include<algorithm> using namespace std; const int N = 60; const int mod = 1e9
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 1e5 + 10; int n; int a[N]; int f[N][3]; int main()
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; const int N = 100010, M = 110; int n, m; int w[N]; int f[N][M][2]; int main() { cin >
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 100010; const int INF = 0x3f3f3f3f; int n, w; int f[N][2]; int main() { int T; cin >> T;
阅读全文
摘要:点击查看代码 #include<iostream> #include<vector> #define fi first #define se second using namespace std; typedef pair<int,int> PII; const int N = 70, M = 32
阅读全文
摘要:贪心 + 01背包模型 点击查看代码 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 10010; int n; int f[N]; struct Stone {
阅读全文
摘要:点击查看代码 #include<iostream> #include<vector> using namespace std; const int N = 1010; int n, m; int v[N], w[N]; int f[N][N]; int main() { cin >> n >> m;
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; const int N = 1010, mod = 1e9 + 7; int n, m; int f[N], g[N]; int main() { cin >> n >>
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; const int N = 110; int n, m; int h[N], e[N], ne[N], idx; int v[N], w[N], f[N][N]; voi
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 20; int n, m; int w[N][N]; int f[N][N]; int way[N]; int main() { cin >> n >> m; for (int
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; const int N = 22, M = 80; int n, m, t; int f[N][M]; int main() { cin >> n >> m >> t;
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 1010; int n, V, M; int v[N], m[N], w[N]; int f[N][N]; int main() { cin >> n >> V >> M; fo
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 1e3 + 10; int n, m; int v[N], w[N], s[N]; int f[N]; int main() { cin >> n >> m; for (int
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; const int N = 1010, M = 20010; int n, m; int v[N], w[N], s[N]; int f[M], g[M], q[M];
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 110, M = 25010; int v[N]; int f[M]; int main() { in
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 110, M = 10010; int m; int v[4] = {10, 20, 50, 100}; int f[M]; int main() { cin >> m; f[0
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 110, M = 10010; int n, m; int v[N]; int f[M]; int main() { cin >> n >> m; for (int i = 1;
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 1010, M = 510; int V1, V2, n; int v1[N], v2[N]; int f[N][M]; int main() { cin >> V1 >> V2
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 20010; int m, n; int v[N], f[N]; int main() { cin >> m >> n; for (int i = 1; i <= n; i ++
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 1010; int m, n; int v[N], w[N]; int f[N]; int main() { cin >> m >> n; for (int i = 1; i <
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 3010; int n; int a[N], b[N]; int f[N][N]; int main() { cin >> n; for (int i = 1; i <= n;
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 60; int n, res; int a[N], up[N], down[N]; void dfs(int u, int su, int sd) { if (su + sd >
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 1010; int n; int a[N], q[N], f[N]; int main() { while (cin >> a[n]) n ++; int res = 0, cn
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 1010; int n; int a[N], f[N]; int main() { cin >> n; for (int i = 1; i <= n; i ++) cin >>
阅读全文
摘要:点击查看代码 #include<iostream> #include<algorithm> #define fi first #define se second using namespace std; const int N = 5010; int n; int f[N]; pair<int,in
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 110; int n; int a[N], f[N], ff[N]; int main() { cin >> n; for (int i = 1; i <= n; i ++) c
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 1010; int n; int a[N], f[N], ff[N]; int main() { cin >> n; for (int i = 1; i <= n; i ++)
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 110; int k, n; int a[N], f[N]; int main() { cin >> k; while (k --) { cin >> n; for (int i
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 60; int n, m; int a[N][N]; int f[2 * N][N][N]; int main() { cin >> m >> n; for (int i = 1
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 20; int n, a, b, c; int s[N][N]; int f[2 * N][N][N]; int main() { cin >> n; while (cin >>
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 110; const int INF = 1e9; int n; int s[N][N], f[N][N]; int main() { cin >> n; for (int i
阅读全文
摘要:BFS + 动态规划 运行时间 855 ms 点击查看代码 #include<iostream> #include<cstring> #include<queue> #define fi first #define se second using namespace std; typedef pai
阅读全文
摘要:点击查看代码 #include<iostream> #include<algorithm> using namespace std; typedef pair<int,int> PII; const int N = 1e5 + 10; int n; PII cow[N]; int main() {
阅读全文
摘要:点击查看代码 #include<iostream> #include<algorithm> using namespace std; const int N = 1e5 + 10; int n, res; int a[N]; int main() { cin >> n; for (int i = 0
阅读全文
摘要:点击查看代码 #include<iostream> #include<algorithm> using namespace std; typedef long long LL; const int N = 1e5 + 10; int n; LL res; int a[N]; int main() {
阅读全文
摘要:点击查看代码 #include<iostream> #include<vector> #include<queue> using namespace std; int n, res; priority_queue<int,vector<int>,greater<int>> heap; int mai
阅读全文
摘要:点击查看代码 #include<iostream> #include<algorithm> using namespace std; const int N = 1e5 + 10; int st, ed, n, res; struct Range { int l, r; bool operator
阅读全文
摘要:差分 + 贪心 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; int n; void solve() { cin >> n; vector<pair<
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 1e5 + 10; int n; struct Range { int l, r; bool oper
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 1e5 + 10; int n; struct Range { int l, r; bool oper
阅读全文
摘要:记忆化搜索 点击查看代码 #include<iostream> #include<cstring> using namespace std; const int N = 310; int n, m; int h[N][N]; int f[N][N]; int dx[4] = {-1, 0, 1, 0
阅读全文
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; const int N = 6010; int n; int happy[N]; int h[N], e[N], ne[N], idx; bool has_father[
阅读全文
摘要:位运算 + 状态压缩DP 点击查看代码 #include<iostream> #include<cstring> using namespace std; const int N = 20, M = 1 << 20; int n; int w[N][N]; int f[M][N]; int main
阅读全文