Page 1 of 1

11604 - General Sultan

Posted: Sun Apr 12, 2009 5:13 am
by HIT_Nessie
My basic idea about this problem is that, given n strings(the weapon's code) and judge if one string is composite by other string.
I use dp to solve this problem but I got WA...
I don't know whether I have a misunderstanding on this problem...Plz help me, thx in advance

Re: 11604 General Sultan

Posted: Sun Apr 12, 2009 10:59 am
by Chirag Chheda
Consider the case 1+110 == 11 + 10.
The output for the above case should be ambiguous.
Hope it helps.

Re: 11604 General Sultan

Posted: Sun Apr 12, 2009 11:46 am
by HIT_Nessie
Chirag Chheda wrote:Consider the case 1+110 == 1 + 10.
The output for the above case should be ambiguous.
Hope it helps.
Sorry, I don't quite understand. Could you please explain it in details? Thanks very much..:)

Re: 11604 General Sultan

Posted: Sun Apr 12, 2009 12:44 pm
by Chirag Chheda
Try the following input

Input

Code: Select all

4
a 1
b 110
c 11
d 10
0
Output

Code: Select all

Case #1: Ambiguous.

Re: 11604 General Sultan

Posted: Sun Apr 12, 2009 1:29 pm
by LayCurse
The another example is following:
4
a 00
b 11
c 001
d 100
0
The correct answer is Ambiguous, because 001100=cd(001+100)=aba(00+11+00).

Re: 11604 General Sultan

Posted: Mon Apr 13, 2009 4:24 am
by HIT_Nessie
Thx for help, I got ac:). I did have a misunderstanding of this problem.

Re: 11604 - General Sultan

Posted: Tue Jun 16, 2009 5:54 pm
by Hasanaa
I'm getting RE pls help me ... Why ...

Code: Select all

AC...

Re: 11604 - General Sultan

Posted: Wed Jun 24, 2009 11:38 am
by yifenfei
How to slove it, i have no idea at all. Can anyone show me the algorithm or code about it? Thank you!