10848 - Make Palindrome Checker
Moderator: Board moderators
-
- Learning poster
- Posts: 58
- Joined: Wed Dec 31, 2003 8:43 am
- Location: Dhaka, Bangladesh
- Contact:
10848 - Make Palindrome Checker
pls anyone hlep me about this problem.
i think this is an easy problem, but getting WA again and again. what's the tric ??
pls HELP ME.
L I M O N
i think this is an easy problem, but getting WA again and again. what's the tric ??
pls HELP ME.
L I M O N
Check if there is more than one space between inputs. I gave a check like this -
Regards
Sanny
Code: Select all
if (length of 1st string + length of 2nd string + length of number + 2 != length of input line)
return false
Sanny
-
- Guru
- Posts: 584
- Joined: Thu Jun 19, 2003 3:48 am
- Location: Sanok, Poland
- Contact:
I think the problem statement is so clearly written, as it doesn't give insturction to reject trailing space after second instruction. If there are no words asking me to reject it, I assume it should be accepted.
Also, it is not clear what we should do if the length of string is zero.(In my AC program, I give T for P1)
Also, it is not clear what we should do if the length of string is zero.(In my AC program, I give T for P1)
My signature:
- Please make discussion about the algorithm BRFORE posting source code.
We can learn much more in discussion than reading source code. - I HATE testing account.
- Don't send me source code for debug.
-
- Learning poster
- Posts: 58
- Joined: Wed Dec 31, 2003 8:43 am
- Location: Dhaka, Bangladesh
- Contact:
thanks Sanny, that was my problem. i just got AC now.Sanny wrote:Check if there is more than one space between inputs. I gave a check like this -RegardsCode: Select all
if (length of 1st string + length of 2nd string + length of number + 2 != length of input line) return false
Sanny
Hi:
I think I've checked everything but that's obviously not true due to my WA
, could you see my code and tell me what is wrong?
Thanx in advance,
Yandry.![:oops:](./images/smilies/icon_redface.gif)
I think I've checked everything but that's obviously not true due to my WA
![:(](./images/smilies/icon_frown.gif)
Code: Select all
Cut after AC
Yandry.
![:oops:](./images/smilies/icon_redface.gif)
Last edited by neno_uci on Thu May 12, 2005 2:04 pm, edited 1 time in total.
I checked your code. Firstly, don't use scanf() for parsing the input (you said you had fixed that). Secondly, the line
should read:
I've been able to make your code above accepted. If you want, I'll send you the changes I made.
Code: Select all
if (n1 > 1000 || n2 > 2000) return 0;
Code: Select all
if (n1 > 1000 || n3 > 2000 || n2 == 0) return 0;