01背包显然超时。然后就是一道神dp了。dp[i][j]表示j个数组成i的方案数。O(nsqrt(n)) #include<cstdio> #include<cstring> #include<cctype> #include<algorithm> using namespace std; ...