随笔分类 - ACM---字符串
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1711 题意就是求b数组在a数组出现的位置;就是kmp模板; #include<stdio.h> #include<iostream> #include<algorithm> #include<strin
阅读全文
摘要:题目链接:http://poj.org/problem?id=3461 和 减花布条 的题对比一下; 求s2中s1的个数kmp模板; #include<stdio.h> #include<iostream> #include<algorithm> #include<string.h> using n
阅读全文
摘要:题目链接:http://poj.org/problem?id=2406 题意:就是求串s能够最多由多少个相同的串a串联而成; 例如 ababab 由3个ab串联而成; abababa 只能由1个abababa组成; kmp中的Next[n](下标从0开始)表示n个元素的前缀和后缀的最大匹配; a b
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2087 kmp模板题: #include <cstdio> #include <cstring> #include <iostream> using namespace std; #define N 11
阅读全文

浙公网安备 33010602011771号