51Nod 1007 正整数分组 | DP (01背包)

  Input示例 5 1 2 3 4 5 Output示例 1 分析: 2组的差最小,那么每一组都要接近sum/2,这样就转化成了普通的0 - 1背包了 #include <bits/stdc++.h> using namespace std; typedef long long LL; #define rep(i,a,n) for(int i = a; i < n; i++) #define
相关文章
相关标签/搜索