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

建议使用的浏览器:

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

3941:Bear-Baby

题目描述
Bear-Baby is a smart boy and he likes playing games. One day he played a simple game with one guy. In this game there are N piles of stones, and each of these piles has K stones at first. When the game starts, two participants take turns to pick up stones following this rule: the one who should act now must choose two different piles (e.g. , pile i and j, i≠j ), and remove the same number of stones from these two piles. The one who cannot act loses the game. Now Bear-Baby wants to study the game. He’d like to figure out the Sprague-Grundy value of each situation that will appear during the game.
Given the number of the piles N and the size of each pile K, Bear-Baby wonders how many different situations could appear during the game. We consider that two situations are the same if they are same after reorder the piles, i.e situations (1,1,3) (1,3,1) and (3,1,1) are the same.
输入解释
There is an integer T(T<=100) in the first line indicating the number of test cases.
  In each test case there are two numbers N and K (1<=N,K<=100) telling the number of piles and the size of each pile in one line.
输出解释
For each test case: output the case number as shown and print the number of different situations in one line. The answer may be a very large number, so print the answer modulo 1000000007.

输入样例
2
2 3
3 2
输出样例
Case #1: 4
Case #2: 5

提示
For the Case #2, from the initial situation (2,2,2), we  can get five different situations (2,2,2) (1,1,2) (0,0,2) (0,1,1) (0,0,0) 
来自杭电HDUOJ的附加信息
Author Dezoo
Recommend xubiao

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

源链接: HDU-3941

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

共提交 0

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