KMP
hxxxx!
这个作者很懒,什么都没留下…
展开
-
poj2752 Seek the Name, Seek the Fame(KMP)
Seek the Name, Seek the FameDescriptionThe little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek原创 2017-06-26 15:21:27 · 209 阅读 · 0 评论 -
poj2406 Power Strings(KMP)
Power StringsDescriptionGiven 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, e原创 2017-06-26 15:42:33 · 207 阅读 · 0 评论 -
洛谷P3375 【模板】KMP字符串匹配
KMP字符串匹配题目描述如题,给出两个字符串s1和s2,其中s2为s1的子串,求出s2在s1中所有出现的位置。为了减少骗分的情况,接下来还要输出子串的前缀数组next。如果你不知道这是什么意思也不要问,去百度搜[kmp算法]学习一下就知道了。输入输出格式输入格式: 第一行为一个字符串,即为s1(仅包含大写字母)第二行为一个字符串,即为s2(仅包含大写字母)输出格式: 若干行,每行包含一个整数,表原创 2017-06-26 16:17:07 · 406 阅读 · 0 评论 -
SSL2828 2017年11月2日提高组T1 Sequence(kmp)
2017年11月2日提高组T1 SequenceDescriptionInputOutputSample Input6 3 1 2 3 4 5 6 1 2 3 Sample Output4 Hint分析:将A,B数组差分然后做一次kmp就行了。代码#include <cstdio> #define maxn 1000005 using namespace std;int next[maxn]原创 2017-11-02 20:02:53 · 203 阅读 · 0 评论 -
jzoj3756【NOI2014】动物园(kmp)
3756【NOI2014】动物园 (Standard IO) Description 近日,园长发现动物园中好吃懒做的动物越来越多了。例如企鹅,只会卖萌向游客要吃的。为了整治动物园的不良风气,让动物们凭自己的真才实学向游客要吃的,园长决定开设算法班,让动物们学习算法。 某天,园长给动物们讲解 KMP 算法。 园长:“对于一个字符串 S,它的长度为 L。我们可以在 O(L)的时间内,求出一个原创 2018-02-03 19:16:49 · 248 阅读 · 0 评论 -
poj1961 Period(kmp)
Period Description For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. Th...原创 2018-08-16 16:18:35 · 137 阅读 · 0 评论 -
洛谷 P3435 [POI2006]OKR-Periods of Words(kmp)
P3435 [POI2006]OKR-Periods of Words 题目描述 A string is a finite sequence of lower-case (non-capital) letters of the English alphabet. Particularly, it may be an empty sequence, i.e. a sequence of 0 le...原创 2018-08-17 11:29:33 · 251 阅读 · 0 评论 -
jzoj 5178. 【NOIP2017提高组模拟6.28】So many prefix?(kmp+dp)
5178. 【NOIP2017提高组模拟6.28】So many prefix? Description Sample Input 样例一: abababc 样例二: isdashagayisdashagaydashisnotagaydashisnotagay Sample Output 样例一: 6 样例二: 30 Data Constraint 分析:KMP + DP,考虑 KMP 中的 ...原创 2018-10-24 19:51:11 · 134 阅读 · 0 评论