随笔分类 -  动态规划

摘要:点击查看代码 #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 阅读(21) 评论(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 阅读(26) 评论(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 阅读(17) 评论(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 阅读(21) 评论(0) 推荐(0) 编辑
摘要:多重背包朴素做法 时间复杂度 O(nms) 总体时间复杂度 500×6000×10=3×107 点击查看代码 #include<iostream> using namespace std; const i 阅读全文
posted @ 2022-06-19 13:31 wKingYu 阅读(22) 评论(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 阅读(16) 评论(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 阅读(18) 评论(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 阅读(15) 评论(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 阅读(14) 评论(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 阅读(27) 评论(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 阅读(12) 评论(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 阅读(14) 评论(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 阅读(18) 评论(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 阅读(27) 评论(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 阅读(25) 评论(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 阅读(20) 评论(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 阅读(22) 评论(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 阅读(20) 评论(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 阅读(54) 评论(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 阅读(28) 评论(0) 推荐(0) 编辑

欢迎阅读『动态规划』
点击右上角即可分享
微信分享提示