二维优化成一维
#include <iostream>
#include <cstdio>
using namespace std;
const int N = 10010, M = 110;
int f[N];
int a[N];
int n,m;
int main()
{
cin>>n>>m;
for (int i=1;i<=n;i++) cin>>a[i];
f[0]=1;
for (int i=1;i<=n;i++)
for (int j=m;j>=a[i];j--)
f[j]+=f[j-a[i]];
cout<<f[m]<<endl;
return 0;
}