LCS  Longest Common Substring
A string is finite sequence of characters over a nonempty 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.
Input
The input contains exactly two lines, each line consists of no more than 250000 lowercase letters, representing a string.
Output
The length of the longest common substring. If such string doesn't exist, print "0" instead.
Example
Input: alsdfkjfjkdsal fdjskalajfkdsla Output: 3
Notice: new testcases added
Added by:  Bin Jin 
Date:  20070924 
Time limit:  0.294s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel Pentium G860 3GHz) 
Languages:  All except: C++ 4.9 SCM chicken 
hide comments
Omer Farukh:
20150314 19:37:04
Is the answer for given testcase correct ?


Dhruv Mullick:
20150128 12:14:40
nlogn approach gives TLE Last edit: 20150128 12:15:05 

Gaurav Kumar Verma:
20141016 22:11:06
Suffix Automation got AC in C++ but got TLE in JAVA, i dont understand y :( 

zicowa:
20140321 18:16:58
geting TLE using suffix array O(nlogn) approach 

Terence:
20140320 06:12:57
AC using O(N) suffix array! 

knb_dtu:
20140317 11:13:21
Suffix Automation gets AC:) 

Chandan Mittal:
20140116 15:55:33
O(NlogN) also TLE


jimmy:
20130717 07:47:20
O(N*log(N)^2) will result in TLE. Last edit: 20140409 12:01:26 

luyuncheng:
20130315 09:07:25
why I use DC3 TLE who use DC3 AC？could you please talk to me？ luyuncheng@sina.com 

Julio [UFSCar]:
20130303 03:49:24
My DC3 got TLE. Optimizing a little more... 