The longest common subsequence problem (LCS) is finding the longest subsequence
common to all sequences in a set of sequences (often just two). It is a classic computer
science problem, the basis of diff, and has applications in bioinformatics.
Given a set of sequences, you have to pick up 3 sequences with the length of LCS of the
3 sequences is maximum.
There are several test cases. First line of test case contains a number n (3<=n<=15),
denoting the number of sequences. Following are n sequences, each on a line. The
sequences do not contain any spaces. Each sequence has max length 100.
For each test case, output the length of LCS of the 3 sequences that have maximum LCS
length of these sequences.
4 a ab abc abcd
2
Migrated from old NTUJ.
No. | Testdata Range | Score |
---|