#A. 消失之物

    Type: RemoteJudge 1000ms 256MiB

消失之物

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

ftiasch 有 nn 个物品, 体积分别是 w1,w2,,wnw_1,w_2,\dots,w_n。由于她的疏忽,第 ii 个物品丢失了。

“要使用剩下的 n1n-1 物品装满容积为 xx 的背包,有几种方法呢?”——这是经典的问题了。

她把答案记为 cnt(i,x)\text{cnt}(i,x) ,想要得到所有i[1,n]i \in [1,n], x[1,m]x \in [1,m]cnt(i,x)\text{cnt}(i,x) 表格。

输入格式

第一行两个整数 n,mn,m,表示物品的数量和最大的容积。 第二行 nn 个整数 w1,w2,,wnw_1,w_2,\dots,w_n,表示每个物品的体积。

输出格式

输出一个 n×mn \times m 的矩阵,表示 cnt(i,x)\text{cnt}(i,x)末位数字

3 2
1 1 2
11
11
21

提示

【数据范围】
对于 100%100\% 的数据,1n,m20001\le n,m \le 2000

【样例解释】
如果物品 3 丢失的话,只有一种方法装满容量是 2 的背包,即选择物品 1 和物品 2。

9月8日居家练习

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2023-9-8 9:00
End at
2023-9-8 13:00
Duration
4 hour(s)
Host
Partic.
17