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

建议使用的浏览器:

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

6509:Problem J. Count The String

题目描述
Define string A match with B if A is same as B replacing the ′*′ character in B with arbitrary number of characters (possible zero).
Given string S and T.
We want to know how many non-empty substrings in S can match with T.
The substring of S is defined as $S_L$$S_{L+1}$ . . . $S_R$(1 ≤ L ≤ R ≤ |S|), two substrings are considered different if L or R are different.
输入解释
Input is given from Standard Input in the following format:
S
T
Constraints
1 ≤ |S|, |T| ≤ 100000
characters in S are lowercase
characters in T are lowercase or character ′*′
, and there are at most 10 ′*′ in T
输出解释
Print one line denotes the number of non-empty substrings in S that can match with T
输入样例
aaaa
a*a
abba
a*a
输出样例
6
1
来自杭电HDUOJ的附加信息
Recommend

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

源链接: HDU-6509

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

共提交 0

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