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

建议使用的浏览器:

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

5659:CA Loves Substring

题目描述
CA loves strings, especially the substrings.
Now CA has a string $S$ which consists of $N$ digits. However, she split this string into two non-empty strings. Specifically, CA spilt the string into $S1$ and $S2$ two substrings at the middle of ith character and (i+1)th. Now, she wonders that there are how many non-empty strings are substring of $S1$ or $S2$ for each $i$.
输入解释
First line contains $T$ denoting the number of testcases.
$T$ testcases follow. Each testcase contains a integer in the first line, denoting $N$, the length of string $S$. The second line is a string whose length is $N$.
$1 \le T \le 10,~2 \le N \le 200000$
输出解释
For each testcase, you need output $1$ line.
Let $F_j$ represent the answer when $i = j$ in this testcase, you need to output $\sum_{j=1}^{N-1} F_j \times 100013^{N-j-1}~mod~(10^9+7)$
输入样例
2
2
00
4
0101
输出样例
1
13300539

提示
In the second case, when $i=1$, $S1$ is "0",$S2$ is "101", All the Strings that satisfy the conditions are "0","1","10","01","101".
来自杭电HDUOJ的附加信息
Recommend wange2014

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

源链接: HDU-5659

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

共提交 0

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