11104 - Cousins

All about problems in Volume 111. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

arsalan_mousavian
Experienced poster
Posts: 111
Joined: Mon Jan 09, 2006 6:19 pm
Location: Tehran, Iran
Contact:

11104 - Cousins

Post by arsalan_mousavian »

i misunderstood the problem statement ? can some one help me to understand the problem ? :(
Thanks in Advance . . .
Arsalan
In being unlucky I have the record.
vinay
Experienced poster
Posts: 104
Joined: Thu Apr 13, 2006 2:26 pm
Location: India
Contact:

Post by vinay »

i too don't understand it , what could be the strings for which n will be three(3)

any cases for n=3 or n=4???
:oops:
If I will myself do hashing, then who will do coding !!!
gvcormac
Problemsetter & Reviewer
Posts: 194
Joined: Fri Mar 15, 2002 2:00 am
Contact:

Post by gvcormac »

vinay wrote:i too don't understand it , what could be the strings for which n will be three(3)

any cases for n=3 or n=4???
:oops:
n=3:

a
aaaaaaaa
vinay
Experienced poster
Posts: 104
Joined: Thu Apr 13, 2006 2:26 pm
Location: India
Contact:

Post by vinay »

ok then hoe to proceed... :oops:

has it anything to do with LCS :D
If I will myself do hashing, then who will do coding !!!
sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo »

vinay wrote: has it anything to do with LCS :D
Yes
joeluchoa
New poster
Posts: 28
Joined: Sat Jul 31, 2004 12:11 am
Location: Brasil

Post by joeluchoa »

I've got WA!! Can somebody help me??
I want tests cases, please!!!

This my code:

Code: Select all

Removed after AC
Last edited by joeluchoa on Mon Oct 02, 2006 4:20 am, edited 1 time in total.
http://acm.uva.es/problemset/usersnew.php?user=47903

All men are like grass,and all their
glory is like the flowers of the field;
the grass withers and the flowers fall,
but the word of the Lord stands forever.
[1 Peter 1:24-25]
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

You can try the following test cases

Input:

Code: Select all

abcdefgh
ijklmnop
ab
pqrstuvwxyz
Output:

Code: Select all

2
3
Hope it helps.
Ami ekhono shopno dekhi...
HomePage
joeluchoa
New poster
Posts: 28
Joined: Sat Jul 31, 2004 12:11 am
Location: Brasil

Post by joeluchoa »

Thanks, i got AC now! :wink:
http://acm.uva.es/problemset/usersnew.php?user=47903

All men are like grass,and all their
glory is like the flowers of the field;
the grass withers and the flowers fall,
but the word of the Lord stands forever.
[1 Peter 1:24-25]
vinay
Experienced poster
Posts: 104
Joined: Thu Apr 13, 2006 2:26 pm
Location: India
Contact:

Post by vinay »

ok some more hint please :oops:
If I will myself do hashing, then who will do coding !!!
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

I am giving an example, hope this helps...

Suppose we are given...
abcde
mnopqrstuvab

/* Removed */

Edit : My description was wrong.
'abcde' and 'mnopqrstuvab' are second cousins.
Last edited by Jan on Thu Nov 09, 2006 1:22 pm, edited 1 time in total.
Ami ekhono shopno dekhi...
HomePage
vinay
Experienced poster
Posts: 104
Joined: Thu Apr 13, 2006 2:26 pm
Location: India
Contact:

Post by vinay »

i think a better sequence would have been this:
abcde
mnopabcd
mnopqrstabcd
mnopqrstuvab

rather than what u said..

abcde
mnoabc
mnopqrstab
mnopqrstuvab

isn't it so??
If I will myself do hashing, then who will do coding !!!
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

There can be a lot of sequences, I just showed one. They are second cousins. You dont have to find the sequence, but the best strategy.
Last edited by Jan on Thu Nov 09, 2006 1:23 pm, edited 1 time in total.
Ami ekhono shopno dekhi...
HomePage
vinay
Experienced poster
Posts: 104
Joined: Thu Apr 13, 2006 2:26 pm
Location: India
Contact:

Post by vinay »

still can't find the best strategy... :cry:
If I will myself do hashing, then who will do coding !!!
sunny
Experienced poster
Posts: 124
Joined: Sun Sep 11, 2005 10:22 pm
Location: Civil-BUET

Post by sunny »

so, there cant be any input where i've 2 print "not related" .
i got AC without considering this.
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

Actually you can always relate two strings. So, "not related" is impossible.
Ami ekhono shopno dekhi...
HomePage
Post Reply

Return to “Volume 111 (11100-11199)”