随笔分类 -  KMP

摘要:题目链接 昨天刚刚学习了EXKMP 于是我就用了EXKMP做了这道题 找完pre后就用前缀和就好 为了节约清空的时间,我加了时间戳t[] 1 #include<algorithm> 2 #include<iostream> 3 #include<cstdlib> 4 #include<cstring 阅读全文
posted @ 2016-02-25 16:32 HugeGun 阅读(360) 评论(0) 推荐(1)
摘要:用a[i][j]表示 匹配到i 转移到 匹配到j 的方案数 用矩阵快速幂求解 1 #include<algorithm> 2 #include<iostream> 3 #include<cstdlib> 4 #include<cstring> 5 #include<cstdio> 6 #includ 阅读全文
posted @ 2016-02-25 11:09 HugeGun 阅读(208) 评论(0) 推荐(0)
摘要:(我和lesphere,reverse研究了这个东西一上午)QAQ kmp是求字符串S的任意前缀与字符串T的最长的相同的前缀和后缀 exkmp第求字符串S的任意后缀与字符串T的最长公共前缀 与kmp相同,我们先来看S与S自己匹配,也就是求S得任意后缀与S的最长公共前缀pre[]数组 假设我们已经得到 阅读全文
posted @ 2016-02-24 21:57 HugeGun 阅读(745) 评论(1) 推荐(1)
摘要:题目链接 LargeDumpling大神:这不是KMP裸题吗?%%% 1 #include<algorithm> 2 #include<iostream> 3 #include<cstdlib> 4 #include<cstring> 5 #include<cstdio> 6 #include<st 阅读全文
posted @ 2016-02-23 21:17 HugeGun 阅读(172) 评论(0) 推荐(0)