#P10470. 前缀统计
前缀统计
Problem Description
Given strings , you will then make queries. In each query, a string is given. Find how many strings among are prefixes of .
The total length of all input strings does not exceed , and they contain only lowercase letters.
Input Format
The first line contains two integers .
The next lines each contain a string .
The next lines each contain a string for querying.
Output Format
For each query, output an integer representing the answer.
Each answer occupies one line.
3 2
ab
bc
abc
abc
efg
2
0
Hint
Constraints: .
Translated by ChatGPT 5