2014年5月20日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1358求某个前缀的周期,用Next求循环节的题目#include #include #include #include using namespace std ;char B[1000005] ;int Next[... 阅读全文
posted @ 2014-05-20 21:35 LegendaryAC 阅读(140) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3746kmp的Nxet数组求字符串循环节例题lenB%(lenB-Next[lenB])==0则其有周期lenB/(lenB-Next[lenB]),其中最小循环节长度是lenB-Next[lenB]#includ... 阅读全文
posted @ 2014-05-20 21:14 LegendaryAC 阅读(369) 评论(0) 推荐(0) 编辑
 
摘要: http://codeforces.com/problemset/problem/432/D在前缀是后缀的前提下,求这个前缀在原串中出现了多少次出现的次数可以用dp求解,前缀是后缀直接用Next判断,较为综合的kmp考察,这题没写出来就是kmp基础不牢,不应该#include #include #i... 阅读全文
posted @ 2014-05-20 20:14 LegendaryAC 阅读(310) 评论(0) 推荐(0) 编辑