sicily 1282. Computer Game
摘要:
// 题意: A是主串,B是子串,都由数字组成, 查询B串在A串第一次出现的位置,若找不到则输出no solution// 注意子串的最大长度是60000,但主串的长度未知,所以要开大些#include <iostream> //KMP算法#include<stdio.h>using namespace std;int A[1000000],B[80000]; //A是主串,B是子串,查询B串在A串的哪些地方出现int n,m,next[80000]; //n,m分别是A,B的串长度,A,B的下标是从1开始的void get_next(){ next[1... 阅读全文
posted @ 2011-07-16 21:34 sysu_mjc 阅读(710) 评论(2) 推荐(0) 编辑