#includeusing namespace std; |
const int len=30; |
const int maxWeight=4000; |
int n,m,cost; |
int w[len][len]; //重量 |
int c[len][len]; //价钱 |
int visit[len]; |
int path[len]; |
int minWeight = maxWeight; |
void findMinWeight ( int current, int weight, int i ) //当前策略的价钱和最小重量 |
{ |
if ( i >= n ) |
{ |
minWeight=weight; |
for ( int j=0; j>n>>m>>cost ) |
{ |
minWeight = maxWeight; |
int i,j; |
for ( i=0; i<2*n; i++ ) |
{ |
for ( j=0; j |