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

建议使用的浏览器:

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

5464:Clarke and problem

题目描述
Clarke is a patient with multiple personality disorder. One day, Clarke turned into a student and read a book.
Suddenly, a difficult problem appears:
You are given a sequence of number $a_1, a_2, ..., a_n$ and a number $p$. Count the number of the way to choose some of number(choose none of them is also a solution) from the sequence that sum of the numbers is a multiple of $p$($0$ is also count as a multiple of $p$). Since the answer is very large, you only need to output the answer modulo $10^9+7$
输入解释
The first line contains one integer $T(1 \le T \le 10)$ - the number of test cases.
$T$ test cases follow.
The first line contains two positive integers $n, p(1 \le n, p \le 1000)$
The second line contains $n$ integers $a_1, a_2, ... a_n(|a_i| \le 10^9$).
输出解释
For each testcase print a integer, the answer.
输入样例
1
2 3
1 2
输出样例
2

Hint:
2 choice: choose none and choose all.
来自杭电HDUOJ的附加信息
Recommend hujie

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

源链接: HDU-5464

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

共提交 0

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