HDU 2222 AC自动机模版题
摘要:
所学的AC自动机都源于斌哥和昀神的想法。题意:求目标串中出现了几个模式串。使用一个int型的end数组记录,查询一次。#include #include #include using namespace std;const int maxw = 50 * 10000 + 10;const int sigma_size = 26;const int maxl = 1000000 + 10;struct Trie{ int next[maxw][sigma_size],fail[maxw],end[maxw]; int root,L; int newnode(){ for(int i=0;iQ;. 阅读全文
posted @ 2013-10-30 22:56 新一 阅读(141) 评论(0) 推荐(0)
浙公网安备 33010602011771号