#include <stdio.h> #include <stdbool.h> int countWeights(int m[], int x[], int n) { int totalWeight = 0; for (int i = 0; i < n; i++) { totalWeight += m[i] * x[i]; } bool dp[n + 1][totalWeight + 1]; // 初始化,00为ture,其余元素为false for (int i = 0; i <= n; i++) { for (int j = 0; j <= tot...