
串
Dmenghu
这个作者很懒,什么都没留下…
展开
-
串的模式匹配算法
算法一(一般算法): int Index(SString S,SString T,int pos) { int i=pos,j=1; while(i<=S.len&&j<=T.len) { if(S[i]==T[i]) { i++; j++;原创 2018-08-06 16:59:04 · 259 阅读 · 0 评论 -
POJ - 2406 Power Strings(字符串周期)
Given two strings a and b we define a*b to be their concatenation. For example, if a = “abc” and b = “def” then a*b = “abcdef”. If we think of concatenation as multiplication, exponentiation by a non-...原创 2018-08-28 11:12:27 · 230 阅读 · 0 评论 -
数据结构实验之串一:KMP简单应用
数据结构实验之串一:KMP简单应用 Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 给定两个字符串string1和string2,判断string2是否为string1的子串。 Input 输入包含多组数据,每组测试数据包含两行,第一行代表string1(长度小于1000000),第二行代表string2(...原创 2018-08-27 09:20:01 · 283 阅读 · 0 评论 -
查找最大元素
对于输入的每个字符串,查找其中的最大字母,在该字母后面插入字符串“(max)”。 Input 输入数据包括多个测试实例,每个实例由一行长度不超过100的字符串组成,字符串仅由大小写字母构成。 Output 对于每个测试实例输出一行字符串,输出的结果是插入字符串“(max)”后的结果,如果存在多个最大的字母,就在每一个最大字母后面都插入”(max)”。 Sample Input a...原创 2018-08-21 14:25:35 · 260 阅读 · 0 评论