Optimisation ideas - Longest common substring
问题 I have this program which is supposed to find the Longest Common Substring of a number of strings. Which it does, but if the strings are very long (i.e. >8000 characters long), it works slowly (1.5 seconds). Is there any way to optimise that? The program is this: //#include "stdafx.h" #include <iostream> #include <string> #include <vector> #include <cassert> using namespace std; const unsigned short MAX_STRINGS = 10; const unsigned int MAX_SIZE=10000; vector<string> strings; unsigned int len;