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

建议使用的浏览器:

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

6595:Everything Is Generated In Equal Probability

题目描述
One day, Y_UME got an integer $N$ and an interesting program which is shown below:



Y_UME wants to play with this program. Firstly, he randomly generates an integer $n \in [1, N]$ in equal probability. And then he randomly generates a permutation of length $n$ in equal probability. Afterwards, he runs the interesting program(function calculate()) with this permutation as a parameter and then gets a returning value. Please output the expectation of this value modulo $998244353$.

A permutation of length $n$ is an array of length $n$ consisting of integers only $\in [1, n]$ which are pairwise different.

An inversion pair in a permutation $p$ is a pair of indices $(i, j)$ such that $i > j$ and $p_i < p_j$. For example, a permutation $[4, 1, 3, 2]$ contains $4$ inversions: $(2, 1), (3, 1), (4, 1), (4, 3)$.

In mathematics, a subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements. Note that empty subsequence is also a subsequence of original sequence.

Refer to https://en.wikipedia.org/wiki/Subsequence for better understanding.
输入解释
There are multiple test cases.

Each case starts with a line containing one integer $N(1 \leq N \leq 3000)$.

It is guaranteed that the sum of $N$s in all test cases is no larger than $5 \times 10^4$.
输出解释
For each test case, output one line containing an integer denoting the answer.
输入样例
1
2
3
输出样例
0
332748118
554580197
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6595

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

共提交 0

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