Page 3 of 3

Re: 760 - DNA Sequencing

Posted: Thu May 31, 2012 1:15 pm
by amyth469
magurmach wrote:Used SA and then kept all the ans in a set so that it gets ordered in lexicographical way.

But getting WA!
Please help.

code link:
Removed after AC
I also have the same problem magurmach..
What did you do to get AC ?

Re: 760 - DNA Sequencing

Posted: Mon Jul 09, 2012 6:36 pm
by mostafiz93
In problem statement it is said that "prints as output the longest common sequence(s) in lexicographical order.", but i got WA submitting the common Sub-sequences. I changed my dp function to print the continuous sequences and got accepted.

So, don't think "common sequence" as sub-sequence. :)

Re: 760 - DNA Sequencing

Posted: Sat Aug 04, 2012 1:13 am
by brianfry713
Input:

Code: Select all

tgtgcattcgcggcacaagagtcccgggtccctgtagctttgatcagctcgaatccatttagatctttagctcgcagcgaacaaggcgaaaagacccggcccgttctaaatactttagatgttgtgtggattctcggaagatggcaagatagctcgtggaaatctacaacgagggtgaagtaggctcgttgtcaggataaggtccaacaatttaagcgcgatactgcctccatggaagcaggcaacgctttcctaaacctaaccatcaaaaggcagtgtctcag
gtgagttacgccaacaacagtagcgaaagtaccgcttatgggtaggagtagcacaactatcaaaacttcgacctccacttgaagcagttacgacgatttgattccgacccatcaataaccaatagttaccgcatacattcgtgttactaagattaactaaagcaacctgggcagatgcgggcgaggattattggtacgttgaaggatccattcatcatgtttctagtcccatcatcacacccaactccgcgagttgaccgacagcttcgtatgacccaatcatttgt

gtctttggctcgtagccta
cttttccgtgtgcctggcccagtgttcggggttacccttaacggaacactccagttaaagggtagggcaactgtagtcgggctatctccctctcctctgcctgtcgagcactcgtgtgtatgcctaggcccagtttttagtcagtcggtagcgtattaagccgcaagtcaagcagaccggcctcgcgacgaacgccacgccgtagaaccgtttggatctgttggactaaaccgacgagtgccaatg
AC output:

Code: Select all

atcaaaa
atccatt
ccaacaa
ccatcaa
gaagcag

cgtag
ctcgt
gccta
gtagc
tttgg
?????, on my machine, your code at http://ideone.com/ZEtUF is printing:

Code: Select all

atcaaaa
atccatt
ccaacaa
ccatcaa
gaagcag

cgtagaa
ctcgttt
gcctaaa
gtagcaa
tttggag

Re: 760 - DNA Sequencing

Posted: Sun Aug 26, 2012 12:06 pm
by Bidhan
If you don't know the reason of getting wrong answer.
1. Given strings can be empty.
2. Same longest common sequences can be found twice, in which case you should print that only once.

Input

Code: Select all

a


bidbi
bi
Output

Code: Select all

No common sequence.

bi