401 - Palindromes
Moderator: Board moderators
Re: Palindromes 401 WA
Search the board first. Don't open a new thread if there is one already.
Ami ekhono shopno dekhi...
HomePage
HomePage
Re: 401 palindromes WA help
hello plz can any one help????????
Thanx vaiya
Thanx vaiya
Last edited by samin on Fri Oct 24, 2008 9:23 pm, edited 1 time in total.
Re: 401- Palindromes WA. I'm going crazy
Last edited by Obaida on Tue Nov 04, 2008 8:12 am, edited 1 time in total.
try_try_try_try_&&&_try@try.com
This may be the address of success.
This may be the address of success.
401 getting WA
#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!
#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!
i love to wait... wait for better... and better will come...
http://akanoi.webs.com/
http://akanoi.webs.com/
Re: 401 getting WA
Search the board first. Don't create a new thread for a problem that already exists!
You can find in/out here.
You can find in/out here.
Re: 401 palindromes WA help
To samin.
Problem says:
See the output format in this post above and in the problem.
Compare the format with yours.
Problem says:
May be you are not printing the blank line.In addition, after each output line, you must print an empty line.
See the output format in this post above and in the problem.
Compare the format with yours.
Last edited by lnr on Fri Oct 17, 2008 8:45 pm, edited 1 time in total.
Re: 401- Palindromes WA. I'm going crazy
To Obaida
Problem says:
See the output format of this problem.
There are other threads for this problem.
See those also to be sure about the output format.
Problem says:
May be you are not printing an extra blank line.In addition, after each output line, you must print an empty 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
To pushpit.saxena
Try these.
input:
output:
Try these.
input:
Code: Select all
ISSEJML11JML322I
SV2OSV2
8SZSJYYL2528
Code: Select all
ISSEJML11JML322I -- is a mirrored string.
SV2OSV2 -- is a mirrored string.
8SZSJYYL2528 -- is a mirrored string.
-
- Learning poster
- Posts: 58
- Joined: Wed Dec 31, 2003 8:43 am
- Location: Dhaka, Bangladesh
- Contact:
Re: 401 palindromes WA help
no more WA, visit: http://www.youngprogrammer.com
http://www.the-sports.co
Sports Stories
Sports Stories
Re: 401- Palindromes WA. I'm going crazy
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.!!!!

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.!!!!
try_try_try_try_&&&_try@try.com
This may be the address of success.
This may be the address of success.
Re: 401- Palindromes WA. I'm going crazy
Last edited by pok on Sat Dec 13, 2008 10:56 pm, edited 1 time in total.
-
- Learning poster
- Posts: 78
- Joined: Sun Nov 30, 2008 5:00 pm
- Location: IUT-OIC, Dhaka, Bangladesh
Re: 401- Palindromes WA. I'm going crazy
Your output is not correct for this test case:
it is a regular palindrome, not a mirrored one.
Code: Select all
AAAAAGAAAAA
May be tomorrow is a better day............ 

Re: 401- Palindromes WA. I'm going crazy
after editing i submitted my code..
but i got WA again..
i cant understand why i got WA this time..
pls help me..
pls help me..
but i got WA again..
i cant understand why i got WA this time..
pls help me..
Code: Select all
removed after AC..
Last edited by pok on Sat Dec 13, 2008 10:56 pm, edited 1 time in total.
-
- Learning poster
- Posts: 78
- Joined: Sun Nov 30, 2008 5:00 pm
- Location: IUT-OIC, Dhaka, Bangladesh
Re: 401- Palindromes WA. I'm going crazy
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:
the output should be:
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.]
Code: Select all
Ebb3
BBABB
Code: Select all
Ebb3 -- is not a palindrome.
BBABB -- is a regular palindrome.
Wish you good luck

[I have changed your code a little and now it is AC.]
May be tomorrow is a better day............ 

Re: 401- Palindromes WA. I'm going crazy
Thanks a lot Articuno ..
now my code is AC..
GOD bless u..
take care..
now my code is AC..
GOD bless u..
take care..