简单的回溯题,求详解装载问题描述如下:有一批共n(n≤≡10)个集装箱要装上艘载重量为c的轮船,其中集装箱i的重量为wi

1个回答

  • #include

    #include

    #include

    #include

    using namespace std;

    int c ,n ,ans;

    int a[1000];

    bool f[10000];

    int main(){

    x05while (cin >> n >> c){

    x05x05for(int i = 1 ; i ans) ans = j;

    x05x05x05x05}

    x05x05cout