#P4052. [JSOI2007] 文本生成器
[JSOI2007] 文本生成器
Description
JSOI assigned team member ZYX a task to develop a computer program called "Text Generator." The users of this software are young children, and they are currently using the GW Text Generator v6.
This software can randomly generate some text — it always generates a text with fixed length and completely random characters. That is, each character in the generated text is completely random. If a text contains at least one word known by the users, then we say the text is readable (we say a text contains a word if and only if is a substring of ). However, even under such a standard, the texts generated by the current GW Text Generator v6 are almost entirely unreadable. ZYX needs to determine, among all texts generated by GW Text Generator v6, how many are readable, in order to successfully obtain the v7 update. Can you help him?
Output the answer modulo .
Input Format
The first line contains two integers, denoting the total number of words known by the users and the length of the generated text .
The next lines each contain a string , representing a word known by the users.
Output Format
Output a single integer: the answer modulo .
2 2
A
B
100
Hint
Constraints and Conventions
For all test points, it is guaranteed that:
- , .
- , where denotes the length of string .
- Each contains only uppercase English letters.
Translated by ChatGPT 5
京公网安备 11011102002149号