Page 9 of 14

Re: Palindromes 401 WA

Posted: Mon Jul 14, 2008 10:53 pm
by Jan
Search the board first. Don't open a new thread if there is one already.

Re: 401 palindromes WA help

Posted: Fri Jul 18, 2008 9:57 pm
by samin
hello plz can any one help????????


Thanx vaiya

Re: 401- Palindromes WA. I'm going crazy

Posted: Tue Jul 29, 2008 10:09 am
by Obaida

Code: Select all

Accepted after a lot wA....... 
:D :D :D

401 getting WA

Posted: Sun Aug 31, 2008 6:27 am
by abid_iut
#include<stdio.h>
#include<string.h>

int main()
{
char nor[25],rev[25];
int i,j=0,l,l1=0,l2=0,l3=0,l4=0;
//freopen("401.txt","r",stdin);
while(scanf("%s",nor)){
if(nor[0]=='\0')break;
l=strlen(nor);
l1=0;l2=0;l3=0;l4=0;
j=0;
for(i=l-1;i>=0;i--){
rev[j]=nor;
j++;
}
j=0;
for(i=0;i<l;i++){
if(nor==rev[j]){
l1=1;
j++;
}
else {l1=0;break;}
}

for(i=0;i<l;i++){
if(nor== 'A'||nor=='E'||nor=='3'||nor=='H'||nor=='I'||nor=='J'||nor=='L'||nor=='M'||nor[i]=='O'||nor[i]=='S'||nor[i]=='2'||nor[i]=='T'||nor[i]=='U'||nor[i]=='V'||nor[i]=='W'||nor[i]=='X'||nor[i]=='Y'||nor[i]=='5'||nor[i]=='Z'||nor[i]=='1'||nor[i]=='8' ){
l3=1;
}
else {l3=0;break;}
}

if(l1==0 && l3==0)printf("%s -- is not a palindrome.\n",nor);
else if(l1==1 && l3==0)printf("%s -- is a regular palindrome.\n",nor);
else if(l1==0 && l3==1)printf("%s -- is a mirrored string.\n",nor);
else printf("%s -- is a mirrored palindrome.\n",nor);
printf("\n");
for(i=0;i<l;i++)nor[i]='\0';
for(j=0;j<l;j++)rev[j]='\0';
}

return 0;
}


pls help!

Re: 401 getting WA

Posted: Sun Aug 31, 2008 7:58 am
by sohel
Search the board first. Don't create a new thread for a problem that already exists!
You can find in/out here.

Re: 401 palindromes WA help

Posted: Fri Oct 17, 2008 7:39 pm
by lnr
To samin.
Problem says:
In addition, after each output line, you must print an empty line.
May be you are not printing the blank line.
See the output format in this post above and in the problem.
Compare the format with yours.

Re: 401- Palindromes WA. I'm going crazy

Posted: Fri Oct 17, 2008 7:48 pm
by lnr
To Obaida
Problem says:
In addition, after each output line, you must print an empty line.
May be you are not printing an extra blank line.
See the output format of this problem.
There are other threads for this problem.
See those also to be sure about the output format.

Re: 401 palindromes WA help

Posted: Fri Oct 17, 2008 8:01 pm
by lnr
To pushpit.saxena

Try these.
input:

Code: Select all

ISSEJML11JML322I
SV2OSV2
8SZSJYYL2528
output:

Code: Select all

ISSEJML11JML322I -- is a mirrored string.

SV2OSV2 -- is a mirrored string.

8SZSJYYL2528 -- is a mirrored string.

Re: 401 palindromes WA help

Posted: Sat Nov 01, 2008 6:55 pm
by L I M O N

Re: 401- Palindromes WA. I'm going crazy

Posted: Tue Nov 04, 2008 8:09 am
by Obaida
Thank you very much for the help. :)
But you know one thing i waited and waited for a help cause no one beside me to help. :(
You know it wass kidding with me. The number of wrong answer i got is too much.!!!!

Re: 401- Palindromes WA. I'm going crazy

Posted: Thu Dec 11, 2008 9:39 pm
by pok
why i got WA ??
pls help me..
i'll b crazy for this problem..

Code: Select all

removed after AC..

Re: 401- Palindromes WA. I'm going crazy

Posted: Fri Dec 12, 2008 2:21 pm
by Articuno
Your output is not correct for this test case:

Code: Select all

AAAAAGAAAAA
it is a regular palindrome, not a mirrored one.

Re: 401- Palindromes WA. I'm going crazy

Posted: Fri Dec 12, 2008 9:50 pm
by pok
after editing i submitted my code..
but i got WA again..
i cant understand why i got WA this time..
pls help me..

Code: Select all

removed after AC..
pls help me..

Re: 401- Palindromes WA. I'm going crazy

Posted: Sat Dec 13, 2008 7:50 am
by Articuno
You did not consider the case when a character of input string is not found in your array b. You do not use any flag to determine that. That's why your program is giving wrong answer for these cases:

Code: Select all

Ebb3
BBABB
the output should be:

Code: Select all

Ebb3 -- is not a palindrome.

BBABB -- is a regular palindrome.

And you should not consider '[' or ']' as it is not in the problem description.
Wish you good luck :)
[I have changed your code a little and now it is AC.]

Re: 401- Palindromes WA. I'm going crazy

Posted: Sat Dec 13, 2008 10:53 pm
by pok
Thanks a lot Articuno ..
now my code is AC..
GOD bless u..
take care..