[hdu2222] Keywords Search
Description
给定 \(n\) 个长度不超过 \(50\) 的由小写英文字母组成的单词准备查询,以及一篇长为 \(m\) 的文章,问:文中出现了多少个待查询的单词。多组数据。
Input
第一行一个整数 \(T\),表示数据组数;
对于每组数据,第一行一个整数 \(n\),接下去 \(n\) 行表示 \(n\) 个单词,最后一行输入一个字符串,表示文章。
Output
对于每组数据,输出一个数,表示文中出现了多少个待查询的单词。
Sample Input
1
5
she
he
say
shr
her
yasherhs
Sample Output
3
Hint
对于全部数据,\(1\le n\le 10^4,1\le m\le 10^6\)。
题解
AC自动机模板题
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include