随笔分类 - 字符串
摘要:开始搞ac自动机啦 之前看着费劲的现在轻易就理解了,剩下的就是多做题了 加油!!! 先来个模板题 题目链接:HihoCoder - 1036 1 #include <cstdio> 2 #include <cstring> 3 const int maxn=1000010; 4 5 int n; 6
阅读全文
摘要:题目连接:https://vjudge.net/problem/UVALive-3942 trie树 dp[i]=sum(dp[i+len(x)]%mod; dp[i]表示从字符i开始的字符串的分解方案方案数,x是s[i……L]的前缀 lrj: 1 // LA3942 Remember the Wo
阅读全文
摘要:题目连接:https://hihocoder.com/problemset/problem/1014 1 #include<cstdio> 2 #include<cstring> 3 const int maxn=110; 4 struct trie 5 { 6 char a; 7 int cnt;
阅读全文
摘要:题目链接:https://cn.vjudge.net/contest/159024#problem/C
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2222 ac自动机模板题。 刚开始学这个-_-|| 先缓缓。
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2328 多串找最长公共字串。 KMP:951ms strstr:124ms 函数名: strstr 原型是朴素的字符串比较方法功 能: 在字符串中查找指定字符串的第一次出现用 法: char *strst
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1238 找多个串的最长公共子串。 枚举最短串的子串temp,求子串的反串vs,用其他串与vs或temp匹配(一个成功即可),其他串都存在该子串则更新答案。 用KMP 31ms,用strstr 0ms。 K
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4763 nex。
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4847 水。
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3294 题目不难,感觉输出比较麻烦。
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4513 manacher。稍微多了一点限制,延伸时要特殊处理一下。
阅读全文
摘要:题目链接:http://acm.fzu.edu.cn/problem.php?pid=1901 nex数组。
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3336 nex数组。
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2594 将两个串连接,中间用'#'连接,进行KMP。
阅读全文
摘要:题目链接:http://poj.org/problem?id=2752 KMP的nex数组。
阅读全文
摘要:题目链接:http://poj.org/problem?id=2406 KMP的nex数组求循环节。
阅读全文
摘要:题目链接:http://acm.hust.edu.cn/problem/show/1010 KMP的nex数组。
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1358 还是KMP中nex数组的运用。
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3746 用到KMP的nex数组。 len-nex[len]是循环节长度。
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2087 和hdu1686几乎一样,一点需要注意细节,已在代码中注明。
阅读全文

浙公网安备 33010602011771号