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

建议使用的浏览器:

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

7131:Nun Heh Heh Aaaaaaaaaaa

题目描述
Vasily Tadokorov is a stringologist. He thinks a string is fragrant if it can be divided into two parts — $\texttt{nunhehheh}$ as the prefix and a number of (excluding $0$) $\texttt{a}$ as the suffix. For example, $\texttt{nunhehhehaaaaaa}$ is fragrant, but $\texttt{nunhehheh}$ and $\texttt{nunhehhehoooaaa}$ are not fragrant.

Today Vasily Tadokorov has some strings consisting of lowercase English letters. For each string, he wants to know how many subsequences of this string are fragrant. A string $a$ is a subsequence of a string $b$ if $a$ can be obtained from $b$ by deletion of several (including $0$) characters.
输入解释
The first line contains an integer $T\ (1 \leq T \leq 1000)$, denoting the number of strings.

Each of the next $T$ lines contains a string $S\ (1 \leq |S| \leq 10^5)$ consisting of lowercase English letters.

The total length of the strings in the input will not exceed $10^6$.
输出解释
For each of the given $T$ strings, output the answer modulo $998244353$.
输入样例
2
nunhehhehahaahahahahahahaahaahahahahha
nunhehhehhehhahaahahahaahaahahaaaahaa
输出样例
114514
1919810

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

源链接: HDU-7131

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

共提交 1

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