摘要:
题目 意思 就是说给你N个单词 问模式串里面含有多少个单词;方法 AC 自动机 首先建立好自动机;然后在构建 fail 指针的时候标记一下路径;然后用模式串去匹配的过程中,不要重复匹配;走过的路程就标记,然后就是简单的计数了; AC自动机解决多字符匹配问题时候;很好用;#include<iostream>#include<stdio.h>#include<cstring>#include<algorithm>using namespace std;struct date{ date *next[27],*fail; bool flag; int 阅读全文
posted @ 2013-04-12 13:33
浪舟
阅读(135)
评论(0)
推荐(0)