背包思想,re了
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace HelloWprld
{
internal class Program
{
static void Main(string[] args)
{
string[] inputNM = Console.ReadLine().Split(' ');
int n = int.Parse(inputNM[0]);
int m = int.Parse(inputNM[1]);
int[] a = new int[n+1];
int[] bag = new int[m+10];
bag[0] = 1;
string[] inputA = Console.ReadLine().Split(' ');
for (int i = 1; i <= n; i++)
{
a[i] = int.Parse(inputA[i-1]);
}
for(int i = 1; i <= n; i++)
{
for(int j = m; j >= a[i]; j--)
{
bag[j] += bag[j - a[i]];
}
}
Console.WriteLine(bag[m]);
//Console.Read();
}
}
}