HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Winner's Camp > problem:


03. 50673 - DNA Testing

Guest
• Discussion of problem (1)

Volume problems

• 51004 - Word Search Game
• 03. 50673 - DNA Testing
• 06. 50714 - The knight
• 12. 50723 - Tribonacci
• 04. 50649 - Puzzle
• 01. 50722 - Scientist's problem
• 02. 50376 - Sequences
• 05. 50713 - Castle and the girls
• 08. 50370 - Number of rectangles in ...
• 09. 50716 - All Palindromes

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
10 5
AMKGLCUITE
AGCTA
Output 1
4
     
Input 2
15 7
QWERTYUIOPAICUG
ATCGACT
Output 2
3

Для отправки решений необходимо выполнить вход.

www.contester.ru