資源簡(jiǎn)介
輪船重量固定,盡可能的往里面放物品,將盡可能的物品裝上輪船。
代碼片段和文件信息
#include
#define?n?5
int?weight=10;
int?w[n]={72645};
int?tempweight=0maxweight=0;
int?currentw=24;
int?flag[n]={0}maxflag={0};
void?traceback(int?t)
{
if(t==n){
if(tempweight>maxweight)
maxweight=tempweight;
return;
}
if(tempw
評(píng)論
共有 條評(píng)論