Feedback | If you notice incorrect translations in Contester, please let author know.
|
|
Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. Question by Arnold Drita.
DNA Tester
Scientists have recently found a new planet able to sustain life. Not only that, but this planet also has some life forms similair to those on earch.
Our job is, to analyse the DNA samples from those life forms, and compare them to DNA samples from our own creatures, and find the longest matching substring.
Input specification
First, you will be given two numbers, n and m : 1<=n,m<=2000, representing the length of the two strings. Then you will be given the strings themselves.
Output specification
Give the length of the longest matching DNA string on both DNA samples. Note, the DNA from creatures of our planet consists of only (A, T, C, G), but the DNA from the other planet can have any character from A to Z.
Input I b>
td> |
10 5
AMKGLCUITE
AGCTA
td>
tr>
|
Output 1 b> td>
|
4
td> tr> |
|
Input 2 b>
td> |
15 7
QWERTYUIOPAICUG
ATCGACT
td>
tr>
|
Output 2 b> td>
|
3
td> tr> |
|
Для отправки решений необходимо выполнить вход.
|