Description A substring of a string T is defined as: T( i, k)= TiTi+1... Ti+k-1, 1≤ i≤ i+k-1≤| T|. Given two strings A, B and one integer K, we define S, a set of triples (i, j, k): S = {( i, j, k) | k≥ K, A( i, k)= B( j, k)}. You are to give the val
//LCS模板,求长度,并记录子串 //亦可使用注释掉的那些代码,但所用空间会变大 #include<iostream> #include<cstring> #include<cmath> #include<cstdlib> #include<cstdio> using namespace std; #define N 5005 int len[N][N]; char str1[N],str2[N],str3[N]; int k; int lc
Corn Fields 2015-11-25 13:42:33 Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 10658 Accepted: 5602 Description Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wa