SP6665 ELCS - Easy Longest Common Substring
Description
In this problem, a string only consists of lowercase letters.
Substring, is a consecutive sequence of characters occurrences at least once in a string.
Common substring means a substring of two strings.
After getting TLE on LCS and LCS2, lqp18\_31 felt really depressed. So he came up with an interesting idea. He want to modify the definition of LCS and call it ELCS.
ELCS: for two given strings s1\[0…n-1\] and s2\[0…m-1\], the ELCS of them is a string p\[0…k-1\] k
Input Format
Firtst line consists one interger N.
Next N lines consist N strings.
Next one line consists one interger Q.
Next Q lines consist two intergers a and b. (0
Output Format
Q lines. Each line consists the length of the ELCS of the a-th string and b-th string