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 阅读全文
posted @ 2022-06-27 14:19 wKingYu 阅读(32) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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", & 阅读全文
posted @ 2022-06-26 22:02 wKingYu 阅读(74) 评论(0) 推荐(0) 编辑
摘要:贪心 + 单调栈 点击查看代码 #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 阅读全文
posted @ 2022-06-26 18:21 wKingYu 阅读(6) 评论(0) 推荐(0) 编辑
摘要:等价变形 + 前缀和 + 单调栈 + 二分 点击查看代码 #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]; 阅读全文
posted @ 2022-06-26 15:11 wKingYu 阅读(12) 评论(0) 推荐(0) 编辑
摘要:数论 + 贪心 点击查看代码 #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, 阅读全文
posted @ 2022-06-26 13:04 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:KMP + 状态机 点击查看代码 #include<iostream> #include<vector> #include<cstring> #include<algorithm> using namespace std; const int N = 60; const int mod = 1e9 阅读全文
posted @ 2022-06-24 23:02 wKingYu 阅读(21) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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() 阅读全文
posted @ 2022-06-24 21:47 wKingYu 阅读(10) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 > 阅读全文
posted @ 2022-06-21 23:09 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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; 阅读全文
posted @ 2022-06-21 21:40 wKingYu 阅读(28) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<vector> #define fi first #define se second using namespace std; typedef pair<int,int> PII; const int N = 70, M = 32 阅读全文
posted @ 2022-06-21 14:32 wKingYu 阅读(14) 评论(0) 推荐(0) 编辑
摘要:贪心 + 01背包模型 点击查看代码 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 10010; int n; int f[N]; struct Stone { 阅读全文
posted @ 2022-06-21 12:07 wKingYu 阅读(27) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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; 阅读全文
posted @ 2022-06-21 00:46 wKingYu 阅读(12) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 >> 阅读全文
posted @ 2022-06-21 00:04 wKingYu 阅读(14) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 阅读全文
posted @ 2022-06-20 23:25 wKingYu 阅读(16) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 阅读全文
posted @ 2022-06-20 16:37 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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; 阅读全文
posted @ 2022-06-20 12:31 wKingYu 阅读(25) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 阅读全文
posted @ 2022-06-19 16:25 wKingYu 阅读(16) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 阅读全文
posted @ 2022-06-19 16:06 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:多重背包朴素做法 时间复杂度 O(nms) 总体时间复杂度 500×6000×10=3×107 点击查看代码 #include<iostream> using namespace std; const i 阅读全文
posted @ 2022-06-19 13:31 wKingYu 阅读(21) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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]; 阅读全文
posted @ 2022-06-18 22:15 wKingYu 阅读(15) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 110, M = 25010; int v[N]; int f[M]; int main() { in 阅读全文
posted @ 2022-06-18 16:14 wKingYu 阅读(17) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 阅读全文
posted @ 2022-06-18 13:41 wKingYu 阅读(14) 评论(0) 推荐(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; 阅读全文
posted @ 2022-06-18 13:15 wKingYu 阅读(13) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 阅读全文
posted @ 2022-06-18 12:50 wKingYu 阅读(26) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 ++ 阅读全文
posted @ 2022-06-18 11:39 wKingYu 阅读(11) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 < 阅读全文
posted @ 2022-06-18 00:13 wKingYu 阅读(13) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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; 阅读全文
posted @ 2022-06-17 23:49 wKingYu 阅读(17) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 > 阅读全文
posted @ 2022-06-17 22:48 wKingYu 阅读(15) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 阅读全文
posted @ 2022-06-17 21:32 wKingYu 阅读(26) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 >> 阅读全文
posted @ 2022-06-17 12:59 wKingYu 阅读(24) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 阅读全文
posted @ 2022-06-17 12:07 wKingYu 阅读(19) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 阅读全文
posted @ 2022-06-17 10:40 wKingYu 阅读(21) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 ++) 阅读全文
posted @ 2022-06-16 22:18 wKingYu 阅读(19) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 阅读全文
posted @ 2022-06-16 21:59 wKingYu 阅读(53) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 阅读全文
posted @ 2022-06-16 21:34 wKingYu 阅读(27) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 >> 阅读全文
posted @ 2022-06-15 23:58 wKingYu 阅读(24) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 阅读全文
posted @ 2022-06-15 22:55 wKingYu 阅读(26) 评论(0) 推荐(0) 编辑
摘要:BFS + 动态规划 运行时间 855 ms 点击查看代码 #include<iostream> #include<cstring> #include<queue> #define fi first #define se second using namespace std; typedef pai 阅读全文
posted @ 2022-06-15 22:33 wKingYu 阅读(17) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<algorithm> using namespace std; typedef pair<int,int> PII; const int N = 1e5 + 10; int n; PII cow[N]; int main() { 阅读全文
posted @ 2022-06-14 22:24 wKingYu 阅读(18) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #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 阅读全文
posted @ 2022-06-14 21:30 wKingYu 阅读(18) 评论(0) 推荐(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() { 阅读全文
posted @ 2022-06-14 21:07 wKingYu 阅读(15) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<vector> #include<queue> using namespace std; int n, res; priority_queue<int,vector<int>,greater<int>> heap; int mai 阅读全文
posted @ 2022-06-14 20:04 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<algorithm> using namespace std; const int N = 1e5 + 10; int st, ed, n, res; struct Range { int l, r; bool operator 阅读全文
posted @ 2022-06-14 00:29 wKingYu 阅读(35) 评论(0) 推荐(0) 编辑
摘要:差分 + 贪心 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; int n; void solve() { cin >> n; vector<pair< 阅读全文
posted @ 2022-06-04 13:10 wKingYu 阅读(37) 评论(0) 推荐(1) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 1e5 + 10; int n; struct Range { int l, r; bool oper 阅读全文
posted @ 2022-06-04 12:02 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 1e5 + 10; int n; struct Range { int l, r; bool oper 阅读全文
posted @ 2022-06-03 22:04 wKingYu 阅读(18) 评论(0) 推荐(0) 编辑
摘要:记忆化搜索 点击查看代码 #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 阅读全文
posted @ 2022-06-03 21:09 wKingYu 阅读(19) 评论(0) 推荐(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[ 阅读全文
posted @ 2022-06-03 12:27 wKingYu 阅读(19) 评论(0) 推荐(0) 编辑
摘要:位运算 + 状态压缩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 阅读全文
posted @ 2022-06-03 11:08 wKingYu 阅读(26) 评论(0) 推荐(0) 编辑
摘要:去除无效状态的优化写法 复杂度 O(n×2m×k) ( k 代表去处无效状态后的个数) 总体复杂度 <11×211×2114.6×107 点击查看代码 #includ 阅读全文
posted @ 2022-06-02 23:26 wKingYu 阅读(21) 评论(0) 推荐(0) 编辑

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