A string S of N chars is given
We were asked to use m strings to match . Each string can be used serval times .strings for matching can intersect with each other .
The question is to find out how many chars of S can’t be matched .
The solution is AC_AUTOMAN .
this is the first time I type this algorithm .
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std ;
#define N 300010
#define M 5100
char s[N] , z[M] ;
int i , j , k , n , m , T ;
int q[4000010] ;
struct AC_Automan {
AC_Automan() {
Len = -1 ;
}
int s[27] , nx , Len , de ;
bool En ;
}g[4000010] ;
int tag[N] ;
int main() {
scanf(