#2780. [SPOJ] 8093 Sevenk Love Oimaster

[SPOJ] 8093 Sevenk Love Oimaster

题目描述

Oimaster and sevenk love each other.

But recently,sevenk heard that a girl named ChuYuXun was dating with oimaster.As a woman's nature, sevenk felt angry and began to check oimaster's online talk with ChuYuXun.

Oimaster talked with ChuYuXun nn times, and each online talk actually is a string.Sevenk asks qq questions like this, "how many strings in oimaster's online talk contain this string as their substrings?"

题意:给出 nn 个串 aia_iqq 次询问,每次给定一个串 sis_i,问 sis_i 是多少个 aia_i 的子串。

输入格式

There are two integers n,qn,q in the first line, the number of strings ​and the number of questions.
And nn lines follow, each of them is a string describing oimaster's online talk.
And qq lines follow, each of them is a question.

输出格式

For each question, output the answer in one line.

3 3
abcabcabc
aaa
aafe
abc
a
ca
1
3
1

数据规模与约定

对于 100%100\% 的数据,1n1041\leq n\leq10^41q6×1041\leq q\leq 6\times 10^4ai105\sum |a_i|\leq 10^5si3.6×105\sum |s_i| \leq 3.6\times 10^5