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

建议使用的浏览器:

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

5456:Matches Puzzle Game

题目描述
As an exciting puzzle game for kids and girlfriends, the Matches Puzzle Game asks the player to find the number of possible equations $A - B = C$ with exactly $n~(5\le n\le 500)$ matches (or sticks).

In these equations, $A,B$ and $C$ are positive integers. The equality sign needs two matches and the sign of subtraction needs just one. Leading zeros are not allowed.

Please answer the number, modulo a given integer $m~(3\le m\le 2\times 10^9)$.
输入解释
The input contains several test cases. The first line of the input is a single integer $t$ which is the number of test cases. Then $t~(1\le t\le 30)$ test cases follow.

Each test case contains one line with two integers $n~(5\le n\le 500)$ and $m~(3\le m\le 2\times 10^9)$.
输出解释
For each test case, you should output the answer modulo $m$.
输入样例
4
12 1000000007
17 1000000007
20 1000000007
147 1000000007
输出样例
Case #1: 1
Case #2: 5
Case #3: 38
Case #4: 815630825
来自杭电HDUOJ的附加信息
Recommend wange2014

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

源链接: HDU-5456

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

共提交 0

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