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

建议使用的浏览器:

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

2811:Deputy General

题目描述
War is cruel .Every one has a boss except LvBu. LvBu want to rally the troops to make his army stronger .
The rule is: everyone may have 0~2 deputy generals and must have only one boss(except LvBu).Everyone has his own level(all levels are different),and his deputy generals' level must less than his. You can assume no one is more levelful than LvBu.
For example , LvBu's level is 4,ChenGong's level is 3,ZhangLiao's level is 2 and GaoShun's level is 1.So,We can make five way :

Now ,give you the number of generals in LvBu's army.Please tell me the number of possible methods?
The answer might be very large. Output your answers mod k.
输入解释
Each line contains two integers n and k, indicating the number of LvBu's generals (including LvBu).
1<= n <= 1000;2<=k<=1,000,000,000
输出解释
For each case, output an answer mod k.
输入样例
1 10007
2 10007
3 10007
4 10007
输出样例
1
1
2
5
来自杭电HDUOJ的附加信息
Author shǎ崽
Recommend lcy

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

源链接: HDU-2811

最后修改于 2020-10-25T22:57:05+00:00 由爬虫自动更新

共提交 0

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