Page 2 of 3

Posted: Mon Dec 05, 2005 3:42 pm
by mamun
A very simple mistake. I'll let you find where it is.
Input

Code: Select all

SAD
DOG
Output

Code: Select all

23
32

Posted: Mon Dec 05, 2005 3:47 pm
by Timo
try this input

Code: Select all

input

RAAR
RAMA

output

66
65
I hope you can get AC.
:D

Posted: Mon Dec 05, 2005 4:05 pm
by abhi
thanks a lot to both of you . i got AC..........
but the time was 0.002s how can i make it faster ??? :wink:

Posted: Tue Dec 06, 2005 2:40 am
by Timo
congratulations for you AC.

you can use gets() to read the data for improve your program speed.

:D

Re: 10260 - Soundex

Posted: Sun Mar 22, 2009 4:55 pm
by MasterHunter
I tried the input mentioned above and got the correct output... My code:

Code: Select all

Accepted
Can anybody help me? I got WA =/

Re: 10260 - Soundex

Posted: Sun Mar 22, 2009 5:46 pm
by helloneo
MasterHunter wrote:I tried the input mentioned above and got the correct output... My code:

Can anybody help me? I got WA =/
I'm not sure whether printing '\0' is ok..
I'll do it like this..

Code: Select all

if (next_char != '\0')
    printf("%c", next_char);

Re: 10260 - Soundex

Posted: Sun Mar 22, 2009 5:55 pm
by MasterHunter
OMG
Thanks a LOT, man :D
Got AC

Re: 10260 - Soundex

Posted: Sun Jun 12, 2011 10:06 pm
by plamplam
I think this is the most common mistake that everyone makes, let S be the soundex number that you are calculating. Now, if only the string "A"(or other characters or combination of characters for which no soundex exists) is given as input, DO NOT print 0. But if you don't print anything then you get Wrong Answer too :wink: . So what you need to do is just print a blank line.
So the bottomline is, your code needs to have the following part:
if (s != 0){printf("%llu\n", s);}
else {printf("\n");}
(I got Wrong Answers 3 times just because of the newline :x )

And one more thing, consider this case RMRNRMRNRMRNRNRNRMR, the soundex value here exceeds 2^31 even 2^32 - 1, so use long long or unsigned long long. I got AC with unsigned long long. Hope this helps, best of luck. Happy coding

Re: 10260 - Soundex

Posted: Wed Oct 01, 2014 9:56 am
by bgcsaif
My code gives me right output I assume. But WA. I need help.

http://ideone.com/QTQ7wQ

Re: 10260 - Soundex

Posted: Wed Oct 01, 2014 11:42 pm
by brianfry713
Try input B

Re: 10260 - Soundex

Posted: Thu Oct 02, 2014 8:16 am
by bgcsaif
Here is my codes after correction. But it's still WA. . . . .http://ideone.com/dUXOhL :(

Re: 10260 - Soundex

Posted: Thu Oct 02, 2014 1:36 pm
by lighted
Input

Code: Select all

LR
Acc Output

Code: Select all

46

Re: 10260 - Soundex

Posted: Thu Oct 02, 2014 4:09 pm
by bgcsaif

Re: 10260 - Soundex

Posted: Thu Oct 02, 2014 4:21 pm
by lighted
Try input A

Re: 10260 - Soundex

Posted: Fri Oct 03, 2014 11:21 am
by bgcsaif
Oops! I forgot to check that single positioned default number. Thank you sir! I got Accepted afterall. . . . . :)