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

建议使用的浏览器:

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

7207:Find different

题目描述
You are given two integers $n$,$m$.

Two array $x=\{x_0,x_1,\dots ,x_{l-1}\},y=\{ y_0,y_1,\dots ,\ y_{l-1}\}$ of length $l$ are considered **different** if $x$ couldn't become $ y$ by performing the following operations any number of times:

$\bullet\ $operation 1$:$ Change $x$ to $b$ , for each $i$ $(0\leq i< l), b_i\ =\ (x_i + 1 )\ mod\ m$

$\bullet\ $operation 2$:$ Change $x$ to $b$ , for each $i$ $(0\leq i< l),b_i\ =\ x_{ (i+1)\ mod\ l } $

As an example, if $m=3,\ l=3$, $(0,2,2)$ and $(0,1,0)$ are considered **not different** because $(0,2,2)$ can become $(0,1,0)$ as follows:
$(0,2,2)\stackrel{operation \ 1}{\longrightarrow}(1,0,0)\stackrel{operation \ 2}{\longrightarrow}(0,0,1)\stackrel{operation \ 2}{\longrightarrow}(0,1,0)$

For each $i$ $($$1\leq i\leq n$$)$, find the number of different integer array $a$ of length $i$, satisfied $\forall j \in ( 0,1,\dots ,{i-1} ) , 0\le a_j \le m-1$.

Since the answer may be too large, print it modulo $998244353$.
输入解释
The first line of the input contains one integer $T$ $($$1\leq T\leq 100$$)$--- the number of test cases. Then $T$ testcases follow.

Each of the next $T$ lines contains two integers $n,m$ $($$1\leq n,m\leq 100000$$)$.

The sum of $n$ over all testcases doesn't exceed $10^{6}$.
输出解释
For each testcase,output one line contains $n$ integers, separated by space, the $i$-th integer indicating the number of different $a$ of length $i$, modulo $998244353$.

**Don‘t have spaces at the end of the line**
输入样例
2
10 2
10 100000
输出样例
1 2 2 4 4 8 10 20 30 56
1 50001 338600275 682529035 345997022 799071125 767573961 525777344 672451750 695859947

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

源链接: HDU-7207

最后修改于 2022-09-15T06:17:24+00:00 由爬虫自动更新

共提交 0

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