随笔分类 -  字符串

摘要:开始搞ac自动机啦 之前看着费劲的现在轻易就理解了,剩下的就是多做题了 加油!!! 先来个模板题 题目链接:HihoCoder - 1036 1 #include <cstdio> 2 #include <cstring> 3 const int maxn=1000010; 4 5 int n; 6 阅读全文
posted @ 2017-05-23 21:54 yijiull 阅读(139) 评论(0) 推荐(0)
摘要:题目连接: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 阅读全文
posted @ 2017-04-21 19:17 yijiull 阅读(141) 评论(0) 推荐(0)
摘要:题目连接: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; 阅读全文
posted @ 2017-04-21 08:02 yijiull 阅读(134) 评论(0) 推荐(0)
摘要:题目链接:https://cn.vjudge.net/contest/159024#problem/C 阅读全文
posted @ 2017-04-17 17:47 yijiull 阅读(191) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2222 ac自动机模板题。 刚开始学这个-_-|| 先缓缓。 阅读全文
posted @ 2017-03-25 00:42 yijiull 阅读(112) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2328 多串找最长公共字串。 KMP:951ms strstr:124ms 函数名: strstr 原型是朴素的字符串比较方法功 能: 在字符串中查找指定字符串的第一次出现用 法: char *strst 阅读全文
posted @ 2017-03-25 00:39 yijiull 阅读(106) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1238 找多个串的最长公共子串。 枚举最短串的子串temp,求子串的反串vs,用其他串与vs或temp匹配(一个成功即可),其他串都存在该子串则更新答案。 用KMP 31ms,用strstr 0ms。 K 阅读全文
posted @ 2017-03-25 00:34 yijiull 阅读(103) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4763 nex。 阅读全文
posted @ 2017-03-25 00:23 yijiull 阅读(113) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4847 水。 阅读全文
posted @ 2017-03-25 00:20 yijiull 阅读(143) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3294 题目不难,感觉输出比较麻烦。 阅读全文
posted @ 2017-03-25 00:15 yijiull 阅读(150) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4513 manacher。稍微多了一点限制,延伸时要特殊处理一下。 阅读全文
posted @ 2017-03-25 00:03 yijiull 阅读(131) 评论(0) 推荐(0)
摘要:题目链接:http://acm.fzu.edu.cn/problem.php?pid=1901 nex数组。 阅读全文
posted @ 2017-03-24 23:43 yijiull 阅读(93) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3336 nex数组。 阅读全文
posted @ 2017-03-24 23:39 yijiull 阅读(90) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2594 将两个串连接,中间用'#'连接,进行KMP。 阅读全文
posted @ 2017-03-24 23:34 yijiull 阅读(102) 评论(0) 推荐(0)
摘要:题目链接:http://poj.org/problem?id=2752 KMP的nex数组。 阅读全文
posted @ 2017-03-24 23:29 yijiull 阅读(117) 评论(0) 推荐(0)
摘要:题目链接:http://poj.org/problem?id=2406 KMP的nex数组求循环节。 阅读全文
posted @ 2017-03-24 23:25 yijiull 阅读(138) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hust.edu.cn/problem/show/1010 KMP的nex数组。 阅读全文
posted @ 2017-03-24 23:23 yijiull 阅读(79) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1358 还是KMP中nex数组的运用。 阅读全文
posted @ 2017-03-24 23:19 yijiull 阅读(129) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3746 用到KMP的nex数组。 len-nex[len]是循环节长度。 阅读全文
posted @ 2017-03-24 21:38 yijiull 阅读(129) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2087 和hdu1686几乎一样,一点需要注意细节,已在代码中注明。 阅读全文
posted @ 2017-03-24 21:23 yijiull 阅读(147) 评论(0) 推荐(0)