随笔分类 -  kmp

摘要:For each prefix with length P of a given string S,if S[i]=S[i+P] for i in [0..SIZE(S)-p-1], then the prefix is a “period” of S. We want to all the per 阅读全文
posted @ 2019-08-06 17:23 晴天要下雨 阅读(367) 评论(0) 推荐(0)
摘要:Homer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had. Marge: Yeah, what is it? Homer: Take me for example. I 阅读全文
posted @ 2019-08-06 16:05 晴天要下雨 阅读(622) 评论(0) 推荐(1)
摘要:Period Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 22012 Accepted: 10679 Description For each prefix of a given string S with N charact 阅读全文
posted @ 2019-08-04 22:26 晴天要下雨 阅读(152) 评论(0) 推荐(0)
摘要:Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 65854 Accepted: 27197 Description Given two strings a and b we define a*b to be their conca 阅读全文
posted @ 2019-08-04 22:01 晴天要下雨 阅读(113) 评论(0) 推荐(0)
摘要:(https://www.luogu.org/problemnew/show/P4391) 题目描述 给你一个字符串,它是由某个字符串不断自我连接形成的。 但是这个字符串是不确定的,现在只想知道它的最短长度是多少. 输入输出格式 输入格式: 第一行给出字符串的长度,1 < L ≤ 1,000,000 阅读全文
posted @ 2019-07-13 22:51 晴天要下雨 阅读(216) 评论(0) 推荐(0)
摘要:给定一个模式串S,以及一个模板串P,所有字符串中只包含大小写英文字母以及阿拉伯数字。 模板串P在模式串S中多次作为子串出现。 求出模板串P在模式串S中所有出现的位置的起始下标。 输入格式 第一行输入整数N,表示字符串P的长度。 第二行输入字符串P。 第三行输入整数M,表示字符串S的长度。 第四行输入 阅读全文
posted @ 2019-07-13 17:56 晴天要下雨 阅读(175) 评论(0) 推荐(0)