LCS - Longest Common Substring
A string is finite sequence of characters over a non-empty finite set Σ.
In this problem, Σ is the set of lowercase letters.
Substring, also called factor, is a consecutive sequence of characters occurrences at least once in a string.
Now your task is simple, for two given strings, find the length of the longest common substring of them.
Here common substring means a substring of two or more strings.
The input contains exactly two lines, each line consists of no more than 250000 lowercase letters, representing a string.
The length of the longest common substring. If such string doesn't exist, print "0" instead.
Input: alsdfkjfjkdsal fdjskalajfkdsla Output: 3
Notice: new testcases added
|Added by:||Bin Jin|
|Cluster:||Cube (Intel Pentium G860 3GHz)|
|Languages:||All except: C++ 4.9 SCM chicken|
Is the answer for given testcase correct ?
nlogn approach gives TLELast edit: 2015-01-28 12:15:05
Gaurav Kumar Verma:
Suffix Automation got AC in C++ but got TLE in JAVA, i dont understand y :(
geting TLE using suffix array O(nlogn) approach
AC using O(N) suffix array!
Suffix Automation gets AC:)
O(NlogN) also TLE
O(N*log(N)^2) will result in TLE.Last edit: 2014-04-09 12:01:26
why I use DC3 TLE who use DC3 AC？could you please talk to me？ firstname.lastname@example.org
My DC3 got TLE. Optimizing a little more...