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
11604 - General Sultan
Moderator: Board moderators
-
- Learning poster
- Posts: 74
- Joined: Sat Jun 21, 2008 12:24 pm
- Location: India
Re: 11604 General Sultan
Consider the case 1+110 == 11 + 10.
The output for the above case should be ambiguous.
Hope it helps.
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.
-
- New poster
- Posts: 6
- Joined: Wed Nov 19, 2008 8:08 am
Re: 11604 General Sultan
Sorry, I don't quite understand. Could you please explain it in details? Thanks very much..Chirag Chheda wrote:Consider the case 1+110 == 1 + 10.
The output for the above case should be ambiguous.
Hope it helps.

-
- Learning poster
- Posts: 74
- Joined: Sat Jun 21, 2008 12:24 pm
- Location: India
Re: 11604 General Sultan
Try the following input
Input
Output
Input
Code: Select all
4
a 1
b 110
c 11
d 10
0
Code: Select all
Case #1: Ambiguous.
Re: 11604 General Sultan
The another example is following:
The correct answer is Ambiguous, because 001100=cd(001+100)=aba(00+11+00).4
a 00
b 11
c 001
d 100
0
-
- New poster
- Posts: 6
- Joined: Wed Nov 19, 2008 8:08 am
Re: 11604 General Sultan
Thx for help, I got ac:). I did have a misunderstanding of this problem.
Re: 11604 - General Sultan
I'm getting RE pls help me ... Why ...
Code: Select all
AC...
Re: 11604 - General Sultan
How to slove it, i have no idea at all. Can anyone show me the algorithm or code about it? Thank you!