上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 26 下一页
摘要: 贪心 + 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 阅读(22) 评论(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 阅读(9) 评论(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 阅读(10) 评论(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 阅读(12) 评论(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 阅读(16) 评论(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 阅读(22) 评论(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 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 多重背包朴素做法 时间复杂度 \(O(n \cdot m \cdot s)\) 总体时间复杂度 \(500 \times 6000 \times 10 = 3 \times 10^{7}\) 点击查看代码 #include<iostream> using namespace std; const i 阅读全文
posted @ 2022-06-19 13:31 wKingYu 阅读(15) 评论(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 阅读(12) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 26 下一页