1729.
String
时间限制 3000 ms
内存限制 512 MB
Bob has a dictionary with N words in it.
Now there is a list of words in which the middle part of the word has continuous letters disappeared. The middle part does not include the first and last character.
We only know the prefix and suffix of each word, and the number of characters missing is uncertain, it could be 0. But the prefix and suffix of each word can not overlap.
For each word in the list, Bob wants to determine which word is in the dictionary by prefix and suffix.
There are probably many answers. You just have to figure out how many words may be the answer.
输入数据
输出数据
For each test case, output Q lines, an integer per line, represents the answer to each word in the list.
样例输入
复制
1
4 4
aba
cde
acdefa
cdef
a a
cd ef
ac a
ce f
\n
· \n
\n
\n
\n
\n
· \n
· \n
· \n
· \n