少打个else 调半天QAQ
重点在47行,比较妙
#include<algorithm>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<cmath>
#include<ctime>
#include<queue>
#include<stack>
#include<map>
#include<set>
#define rre(i,r,l) for(int i=(r);i>=(l);i--)
#define re(i,l,r) for(int i=(l);i<=(r);i++)
#define Clear(a,b) memset(a,b,sizeof(a))
#define inout(x) printf("%d",(x))
#define douin(x) scanf("%lf",&x)
#define strin(x) scanf("%s",(x))
#define LLin(x) scanf("%lld",&x)
#define op operator
#define CSC main
typedef unsigned long long ULL;
typedef const int cint;
typedef long long LL;
using namespace std;
void inin(int &ret)
{
ret=;int f=;char ch=getchar();
while(ch<''||ch>''){if(ch=='-')f=;ch=getchar();}
while(ch>=''&&ch<='')ret*=,ret+=ch-'',ch=getchar();
ret=f?-ret:ret;
}
int hh[],ans[][];
int n,c,w[];
int main()
{
inin(n),inin(c);
re(i,,n)inin(w[i]);
hh[]=;
re(i,,n)
rre(j,c,w[i])
(hh[j]+=hh[j-w[i]])%=;
re(i,,n){re(j,,c)
{
ans[i][]=;
if(j<w[i])ans[i][j]=hh[j];
else ans[i][j]=(hh[j]-ans[i][j-w[i]]+)%;
printf("%d",ans[i][j]);
}cout<<"\n";}
return ;
}