当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5800:To My Girlfriend

题目描述
Dear Guo

I never forget the moment I met with you.You carefully asked me: "I have a very difficult problem. Can you teach me?".I replied with a smile, "of course"."I have n items, their weight was a[i]",you said,"Let's define f(i,j,k,l,m) to be the number of the subset of the weight of n items was m in total and has No.i and No.j items without No.k and No.l items.""And then," I asked.You said:"I want to know
$$
\sum_{i=1}^{n}\sum_{j=1}^{n}\sum_{k=1}^{n}\sum_{l=1}^{n}\sum_{m=1}^{s}f(i,j,k,l,m)\quad (i,j,k,l\quad are\quad different)
$$

Sincerely yours,
Liao
输入解释
The first line of input contains an integer T$(T\le 15)$ indicating the number of test cases.
Each case contains 2 integers $n$, $s$ $(4\le n\le 1000,1\le s\le 1000)$. The next line contains n numbers: $a_1,a_2,\dots,a_n$ $(1\le a_i\le 1000)$.
输出解释
Each case print the only number — the number of her would modulo $10^9+7$ (both Liao and Guo like the number).

输入样例
2
4 4
1 2 3 4
4 4
1 2 3 4
输出样例
8
8
来自杭电HDUOJ的附加信息
Author UESTC
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5800

最后修改于 2020-10-25T23:25:45+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/2000MS(Java/Others) 65536/65536K(Java/Others)