#include <bits/stdc++.h>
using namespace std;
const int m=1e8;
int n,f,w[2005];
long long a[2005][1005];
int main(){
cin>>n>>f;
for(int i=1;i<=n;i++)cin>>w[i],w[i]%=f,a[i][w[i]]=1;
for(int i=1;i<=n;i++)
for(int j=0;j<f;j++)
a[i][j]=((a[i][j]+a[i-1][j])%m+a[i-1][j-w[i]+f]%f)%m;
cout<<a[n][0];
return 0;
}
样例过不了。。。
悬关