HDU 2222 Keywords Search (AC自动机模板题)
题目链接HDU2222题目大意给多个模式串,求长串中出现多少次模式串。分析字符串多模式匹配模板题,注意模式串有可能会有重复,用单词标记数组维护模板出现的次数,匹配时用一个标记数组保证每个单词结点只计算一次即可。代码#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
原创
2017-09-14 21:52:25 ·
468 阅读 ·
0 评论