首页 > 【模板】01背包(方案输出)
头像 Ldh1315109
发表于 2025-12-03 01:42:41
[模板]01背包(方案输出) 代表考虑前种物品,物品总体积为的前提下能带走的最大物品价值。 通过动态规划得出最优解之后逆序去找每个物品是否应该被选取。 #include <bits/stdc++.h> using namespace std; typedef long long ll; 展开全文
头像 腌萝卜干
发表于 2026-02-02 14:40:38
没想到竟然过了 代码实现 #include <bits/stdc++.h> #define x first #define y second using namespace std; typedef long long LL; typedef pair<int, int> 展开全文

等你来战

查看全部