对于包排序
状压DP
#include#include using namespace std;int F[20000005],ID[20000005],G[20000005],a[105],v[105];int lowbit(int x){ return x&(-x);}bool cmp(long long a,long long b){ return a>b;}int main(){ int n,m; scanf("%d%d",&n,&m); for (int i=0; i n) continue; int tof=f,tog=g-a[ID[i]]; if (tog<0) tof++,tog=v[tof]-a[ID[i]]; if (tog>=0 && (tof G[now])) F[now]=tof,G[now]=tog; } } if (F[(1<