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

建议使用的浏览器:

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

7138:String

题目描述
There is a string of length $n$, $S[l..r]$ represents the string concatenated from the lth character to the rth character, and $S_{len}$ is the length of the string($S[1..S_{len}]$ represents the whole $S$ string).

We define $F_G$ as the number of positive integers x that satisfy the following conditions:

1. $1\leq x\leq G_{len}$

2. $G[1,x]=G[G_{len}-x+1,G_{len}]$

3. The length of the common part of the intervals $[1,x]$ and $[G_{len}-x+1,G_{len}]$ is greater than $0$ and is divisible by $k$.

Now ask for the value of $\prod_{i=1}^n (F_{S[1..i]}+1)$ modulo $998244353$.
输入解释
The first line of input is a positive integer $T(T\leq 10)$ representing the number of data cases.

For each cases:

first line input a string $S$ of lowercase letters, no longer than $10^6$.

second line input a positive integer $k(1 \leq k \leq S_{len})$.
输出解释
For each cases, output a line with a positive integer representing the answer.
输入样例
1
abababac
2
输出样例
24
来自杭电HDUOJ的附加信息
Hint Note that the stack space of the judge system is a bit small, please pay attention to the reasonable allocation of memory.

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

源链接: HDU-7138

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

共提交 0

通过率 --%
时间上限 内存上限
3000/1500MS(Java/Others) 524288/524288K(Java/Others)