当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1560:DNA sequence

题目描述
The twenty-first century is a biology-technology developing century. We know that a gene is made of DNA. The nucleotide bases from which DNA is built are A(adenine), C(cytosine), G(guanine), and T(thymine). Finding the longest common subsequence between DNA/Protein sequences is one of the basic problems in modern computational molecular biology. But this problem is a little different. Given several DNA sequences, you are asked to make a shortest sequence from them so that each of the given sequence is the subsequence of it.

For example, given "ACGT","ATGC","CGTT" and "CAGT", you can make a sequence in the following way. It is the shortest but may be not the only one.

输入解释
The first line is the test case number t. Then t test cases follow. In each case, the first line is an integer n ( 1<=n<=8 ) represents number of the DNA sequences. The following k lines contain the k sequences, one per line. Assuming that the length of any sequence is between 1 and 5.
输出解释
For each test case, print a line containing the length of the shortest sequence that can be made from these sequences.
输入样例
1
4
ACGT
ATGC
CGTT
CAGT
输出样例
8
来自杭电HDUOJ的附加信息
Author LL
Recommend LL

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-1560

最后修改于 2020-10-25T22:46:01+00:00 由爬虫自动更新

共提交 677

通过率 48.89%
时间上限 内存上限
15000/5000MS(Java/Others) 32768/32768K(Java/Others)