摘要:
题意:给出m个模式和一个文本,求各种模式的出现次数比较裸的AC自动机,成功匹配就计数就是了..View Code 1 //Accepted 3065 281MS 13724K 2340 B C++ 2 3 #include <iostream> 4 #include <cstring> 5 #include <cstdio> 6 #include <cmath> 7 #include <algorithm> 8 using namespace std; 9 const int inf=1<<28; 10 const int 阅读全文
posted @ 2012-08-22 20:34
Wheat″
阅读(143)
评论(0)
推荐(0)
摘要:
题目大意:找出匹配串在父串中出现的次数View Code 1 #include <iostream> 2 #include <string.h> 3 const int MAXN = 1000012; 4 char a[MAXN],b[MAXN];//a主串 b匹配串 5 void get_next(char *pstr,int *next) 6 { 7 int i=0; 8 *next=-1; 9 int j=-1;10 while(*(pstr+i)!='\0')11 {12 if(j==-1||*(pstr+i)==*(pstr+... 阅读全文
posted @ 2012-08-22 20:19
Wheat″
阅读(120)
评论(0)
推荐(0)
摘要:
题意:给出m个模式和一个文本,求各种模式的出现次数比较裸的AC自动机,成功匹配就计数就是了..View Code 1 //Accepted 2896 156MS 23516K 2412 B C++ 2 3 #include <iostream> 4 #include <cstring> 5 #include <cstdio> 6 #include <cmath> 7 #include <algorithm> 8 using namespace std; 9 const int inf=1<<28; 10 const int 阅读全文
posted @ 2012-08-22 20:17
Wheat″
阅读(249)
评论(0)
推荐(0)

浙公网安备 33010602011771号