/*
** KMP 20170129 by Sara丶YF
*/
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
using namespace std;
const int Maxn = 50005;
const int Int = 1 << 9;
int t;
char str_s[Maxn];
char str_t[Maxn];
void get_next(char *str_t,int *next)
{
int len_t = strlen(str_t);
int j = 0;
int k = -1;
next[0] = -1;
while(j < len_t-1)
{
if(k == -1 || str_t[j] == str_t[k])
{
++k;
++j;
next[j] = k;
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载