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

建议使用的浏览器:

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

4295:4 substrings problem

题目描述
  One day you heard the following joke
    In America, you write strings.
    In Soviet Russia, String writes YOU!!
1
  And find that now string is writting you! So to get rid of it, you must solve the following problem:
  Given a string S and its four substring a,b,c, and d. In a configuration, you can place four substrings exactly one position it occurs in S (they may overlap), and characters covered by at least one such substring is called “covered”.
  You should solve for minimum and maximum possible number of covered characters in a configuration.
  You may assume that s contains only lowercase letters, and is of length less than 4096. However, lengths of a,b,c, and d would never exceed 64.
-------------------------------------------------------------------
1An infamous Russian reversal
输入解释
  There are several test cases.
  For each test case there are 5 lines, denoting S,a,b,c, and d, respectively.
  Please process until the EOF (End Of File).
输出解释
  For each test case, please print a single line with two integers, first the minimum, then the maximum.
输入样例
hello
he
l
l
o
abacaba
ab
ba
a
c
输出样例
4 5
4 6
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-4295

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

共提交 0

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