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

建议使用的浏览器:

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

6915:String Game

题目描述
Clair and Bob play a game.Clair writes a string of lowercase characters, in which Bob sets the puzzle by selecting one of his favorite subsequence as the key word of the game. But Bob was so stupid that he might get some letters wrong.

Now Clair wants to know whether Bob's string is a subsequence of Clair's string. and how many times does Bob's string appear as a subsequence in Clair's string. As the answer maybe too large, you should output the answer modulo $10^{9}+7$.
输入解释
The input may contain multiple test cases.

Each test case contains exactly two lines. The first line is Clair’s string, and the second line is Bob’s string. The length of both strings are no more than 5000.
输出解释
For each test case, output one line, including a single integer representing how many times Bob’s string appears as a subsequence in Clair’s string. The answer should modulo $10^{9} + 7$.
输入样例
eeettt
et
eeettt
te
输出样例
9
0
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6915

最后修改于 2021-06-22T18:18:52+00:00 由爬虫自动更新

共提交 4

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