这不就是01背包吗?你网上随便百度一下代码如下图: 把weight数组用order[i][0]*orderorder[i][1]输入进去; 把value数组用order[i][1]输入进去; a是balance; n是order.length; 然后通过率100%
image.png