poj1961 KMP
来源:互联网 发布:毒品网络 百度云 编辑:程序博客网 时间:2024/06/06 09:07
题目 : http://poj.org/problem?id=1961
题目大意 : 输出每个位置的最大幂,其实和poj2406是一样的。
考察点 : KMP
思路 :由于s = s1 ^ n;因此len[ len[s] -next[len[s]] ] = len[s1];
由于next中记录的是最大的真前缀。故,next中包含字串s1的最大重叠数,也就是说,因为next[i]记录的是到i的最大真前缀,因此, len[i] –next[i]就是最小的独立体,独立题越小,幂就会越大的。
提交情况 : wrong answer9次原因 test写成了 text
用了next数组,个人觉得和pre数组没有区别。Next[i] 表示的是前I –1个中最大的真前缀,pre[i] 是前i个的最大真前缀,所以认为没区别,,,,,,,,,,
ACcode
#include <stdio.h>
#include <string.h>
#define MAXN 1210001
charP[MAXN];
intnext[MAXN];
voidGet_next(char P[],int m){
}
int main(){
}
- poj1961 KMP
- poj1961---KMP
- POJ1961->KMP
- 【KMP】 poj1961 Period
- poj1961 Period----KMP
- poj1961 kmp 重复串
- LA3026||poj1961(KMP)
- poj1961之KMP应用
- poj1961 Period (KMP)
- KMP POJ1961 Period
- [POJ1961]Period(KMP)
- poj1961 Period(KMP)
- kmp练习poj1961
- POJ1961 Period(KMP)
- kmp算法 和例题 poj1961
- poj1961 KMP求循环节
- POJ1961(KMP-Next数组)
- poj1961 KMP(循环节)
- poj1006 中国剩余定理
- poj2447 RSA公钥加密破译
- 2011年03月21日的日记
- activemq-jms --zhuanzai
- poj2406 KMP算法
- poj1961 KMP
- AC自动机(确定性有限状态自动机)
- 2011年04月06日
- HTML5之Web Worker
- 2011年04月06日的日记
- 模拟退火 poj3422 run away
- hdu3689 AC自动机Dp
- 平面最近圆对儿 hdu3124
- hdu3400 三分法