
----------KMP
mfcheer
他不停地跑啊跑 就为了追上那个曾经被寄予厚望的自己
-
原创 poj-3461 Oulipo 【kmp】
Oulipo Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 26367 Accepted: 10522 Description The French author Georges Perec (1936–1982) once wrote a book, La2015-03-06 20:36:24336
0
-
原创 poj 2752 Seek the Name, Seek the Fame 【kmp】
题目链接:http://poj.org/problem?id=2752题意:求即是前缀有是后缀的子串有几个,输出长度。思路:考察next数组的性质。具体见代码。#include <stdio.h> #include <iostream> #include <math.h> #include <stdlib.h> #include <ctype.h> #include <algor2015-06-05 18:15:11338
0
-
原创 LIGHTOJ 1255-SUBSTRING FREQUENCY 【KMP】
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1255题意:求母串中包含子串的个数,可重叠。代码:#include <stdio.h> #include <iostream> #include <math.h> #include <stdlib.h> #include <ctype.h> #include <2015-06-05 23:24:18426
0
-
原创 hdu 3336 Count the string 【kmp + dp】
题目链接:http://acm.acmcoder.com/showproblem.php?pid=3336题意:求给出的字符串的所有前缀出现的次数和。dp的思想还是看的别人的题解。窝就不写啦。代码:#include <stdio.h> #include <iostream> #include <string.h> #include <algorithm> #include <math.h> #inc2015-06-05 18:12:20360
0
-
原创 hdu 2594 Simpsons’ Hidden Talents 【KMP】
题目链接:http://acm.acmcoder.com/showproblem.php?pid=2594题意:求最长的串 同时是s1的前缀又是s2的后缀。输出子串和长度。思路:kmp代码:#include <vector> #include <string> #include <algorithm> #include <iostream> #include <stdio.h> #include2015-06-05 17:08:4519
0
-
原创 字符串匹配 【kmp】
字符串匹配 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 214 Solved: 81 Description 给你两个字符串A,B,请输出B字符串在A字符串中出现了几次。Input 多组测试数据,每组输入两个字符串。字符串的长度 <= 1000000.Output 输出B在A中出现的次数。Sample Input aaa aa2015-03-30 21:48:27521
0
-
原创 The Minimum Length 【kmp】
The Minimum Length Time Limit:1000MS Memory Limit:131072KB 64bit IO Format:%lld & %llu Submit Status Description There is a string A. The length of A is less than 1,000,000. I re2015-03-07 14:31:56405
0
-
原创 hdu-2087 剪花布条 【kmp】
剪花布条 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10026 Accepted Submission(s): 6482 Problem Description 一块花布条,里面有些图案,另有一块直接可2015-03-06 21:21:23412
0
-
原创 hdu-1711
kmp 模板题 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int a[1000005],b[10005]; int nex2014-11-18 22:39:37431
0
-
原创 hdu-1358 Period 【kmp】
Period Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3443 Accepted Submission(s): 1727 Problem Description For each prefix of2015-03-07 12:26:38511
0
-
原创 poj-2406 Power Strings 【kmp】
Power Strings Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 34716 Accepted: 14367 Description Given two strings a and b we define a*b to be their conca2015-03-07 14:52:59612
0
-
原创 hdu-3746 Cyclic Nacklace 【kmp】
Cyclic Nacklace Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3253 Accepted Submission(s): 1488 Problem Description CC always2015-03-07 10:13:25546
0
-
原创 LIGHTOJ 1258 – MAKING HUGE PALINDROMES 【KMP】
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1258题意:为了使原串变为回文串,可任意添加字符,求变为回文串之后字符的长度。解法:求字符串与其反串的最大公共长度len,则最后回文字符串的长度为:原串长度*2-len;代码:#include <stdio.h> #include <iostream> #include <2015-06-05 23:22:20414
0