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

建议使用的浏览器:

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

7119:Ball

题目描述
There are $n$ grooves distributed on a slope evenly. We index the highest groove with $n$, while the lowest is $1$. If we choose a number $i$, let a ball fall freely over the $i$th groove, three different situations may happen. If the $i$th groove is empty, then the ball will occupy it. If the $i$th groove is already occupied, the ball will roll down and occupy the first empty groove. If all the grooves below the $i$th groove are occupied, the ball will fall out of the slope.

Now Lucida has $m$ balls. He wondered how many different ways for him to throw these balls such that there are exactly $k$ of them falling out of the slope.

A way to throw these m balls can be represented by a sequence p($\{p_1,p_2,...,p_n\}$, $1\leq p_i\leq n$). $p_i$ means that the $i$th ball is fall freely over the $p_i$ groove.

Two ways are considered the same if the sequence $p$ is the same.
输入解释
This problem contains multiple test cases.

The first line contains a single integer $T$ ($1\leq T \leq 1000$).

The following $T$ lines each contains three integers $n, m, t$ ($1 \leq n\leq 500$,$1\leq m\leq 1000$, $0\leq t\leq 500$, $t < m \leq n + t$), the number of grooves, and the number of balls.
输出解释
For each test case, output one line contains one integer indicating the answer.

Since the answer can be very large, you only need to output the answer modulo $998244353$.
输入样例
1
3 2 0
输出样例
8

来自杭电HDUOJ的附加信息
Hint For the sample, there are 3 grooves in total. We throw two balls and none of them falls out of the slope. There are 9 different ways to throw the balls and the only way that causes one of them to fall is to throw both of them over the first groove. So the answer will be 9-1=8.

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

源链接: HDU-7119

最后修改于 2021-10-23T19:11:34+00:00 由爬虫自动更新

共提交 0

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