11604 - General Sultan

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

Moderator: Board moderators

Post Reply
HIT_Nessie
New poster
Posts: 6
Joined: Wed Nov 19, 2008 8:08 am

11604 - General Sultan

Post by HIT_Nessie » Sun Apr 12, 2009 5:13 am

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

Chirag Chheda
Learning poster
Posts: 74
Joined: Sat Jun 21, 2008 12:24 pm
Location: India

Re: 11604 General Sultan

Post by Chirag Chheda » Sun Apr 12, 2009 10:59 am

Consider the case 1+110 == 11 + 10.
The output for the above case should be ambiguous.
Hope it helps.
Last edited by Chirag Chheda on Sun Apr 12, 2009 12:45 pm, edited 1 time in total.

HIT_Nessie
New poster
Posts: 6
Joined: Wed Nov 19, 2008 8:08 am

Re: 11604 General Sultan

Post by HIT_Nessie » Sun Apr 12, 2009 11:46 am

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..:)

Chirag Chheda
Learning poster
Posts: 74
Joined: Sat Jun 21, 2008 12:24 pm
Location: India

Re: 11604 General Sultan

Post by Chirag Chheda » Sun Apr 12, 2009 12:44 pm

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.

LayCurse
New poster
Posts: 11
Joined: Sun Feb 25, 2007 3:14 pm
Location: Kyoto, Japan

Re: 11604 General Sultan

Post by LayCurse » Sun Apr 12, 2009 1:29 pm

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).

HIT_Nessie
New poster
Posts: 6
Joined: Wed Nov 19, 2008 8:08 am

Re: 11604 General Sultan

Post by HIT_Nessie » Mon Apr 13, 2009 4:24 am

Thx for help, I got ac:). I did have a misunderstanding of this problem.

Hasanaa
New poster
Posts: 1
Joined: Sun Sep 14, 2008 9:17 am

Re: 11604 - General Sultan

Post by Hasanaa » Tue Jun 16, 2009 5:54 pm

I'm getting RE pls help me ... Why ...

Code: Select all

AC...

yifenfei
New poster
Posts: 1
Joined: Wed Jun 24, 2009 11:25 am

Re: 11604 - General Sultan

Post by yifenfei » Wed Jun 24, 2009 11:38 am

How to slove it, i have no idea at all. Can anyone show me the algorithm or code about it? Thank you!

Post Reply

Return to “Volume 116 (11600-11699)”