CF1278F.Cards
省选/NOI-
通过率:0%
时间限制:4.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Consider the following experiment. You have a deck of m cards, and exactly one card is a joker. n times, you do the following: shuffle the deck, take the top card of the deck, look at it and return it into the deck.
Let x be the number of times you have taken the joker out of the deck during this experiment. Assuming that every time you shuffle the deck, all m! possible permutations of cards are equiprobable, what is the expected value of xk? Print the answer modulo 998244353.
考虑以下实验:你有一副 m 张牌的牌堆,其中恰好有一张是王牌(joker)。重复进行 n 次如下操作:洗牌,取出牌堆最上方的一张牌,查看其花色后将其放回牌堆。
设 x 为该实验中取出王牌的次数。假设每次洗牌时,所有 m! 种可能的牌序排列都是等概率的,求 xk 的期望值。请输出答案对 998244353 取模的结果。
输入格式
The only line contains three integers n, m and k (1≤n,m<998244353, 1≤k≤5000).
唯一的一行包含三个整数 n、m 和 k(1≤n,m<998244353,1≤k≤5000)。
输出格式
Print one integer — the expected value of xk, taken modulo 998244353 (the answer can always be represented as an irreducible fraction ba, where bmod998244353=0; you have to print a⋅b−1mod998244353).
输出一个整数——xk 的期望值对 998244353 取模的结果(答案总可表示为既约分数 ba,其中 bmod998244353=0;你需要输出 a⋅b−1mod998244353)。
输入输出样例
输入#1
1 1 1
输出#1
1
输入#2
1 1 5000
输出#2
1
输入#3
2 2 2
输出#3
499122178
输入#4
998244352 1337 5000
输出#4
326459680
输入解题思路,AI测评打分。不知道怎么写?