2012年10月8日

POJ 2406 Power Strings (KMP)

摘要: 题目地址:http://poj.org/problem?id=2406对于这道题,考的就是KMP算法中对于子串的自匹配模式的考察。具体的KMP算法可参看KMP算法详解,主要看对B串的处理。这题给出一个比较特殊的测试数据供大家参考aabaaaba结果应该为2 1 #include <stdio.h> 2 #include <string.h> 3 4 void result(char str[1000001]) 5 { 6 int i; 7 int j; 8 int len = strlen(str); 9 int p[1000001];10 p[0] = -1;11 . 阅读全文

posted @ 2012-10-08 12:10 NULL00 阅读(540) 评论(0) 推荐(0) 编辑

导航