Page 2 of 5

Posted: Sun Dec 31, 2006 1:36 pm
by helloneo
artie wrote:[Thanks a lot!
Could anyone explain me why my input was faulty?
If you got AC, you may remove your code.. so it would not be a spoiler..

Posted: Sun Dec 31, 2006 3:25 pm
by Spykaj
I used Longest Common Subquecense for string A and reversed string A, is it correct ?

Posted: Sun Dec 31, 2006 3:32 pm
by helloneo
Spykaj wrote:I used Longest Common Subquecense for string A and reversed string A, is it correct ?
Yes..

Posted: Sun Dec 31, 2006 4:00 pm
by Monsoon
hmm... in my opinion during the contest tasks should be clear. This mean that you can solve them iff you find correct algo. Situation when someone must think about why he has WA, but algo seems correct is very stressful :wink:. And now is it becouse of my implementation? algorithm? tricky case? or now even how i read input or write output? :x . So what i can say about this task - ofcourse NONE can complain that they didn't solve this problem becouse of problem with reading empty lines, but the problem setters should avoid such situations.

Posted: Mon Jan 01, 2007 3:59 am
by Observer
To those who feel bad about the "empty string" thing:

I don't see why you feel bad. Maybe you don't have time to read the problem statement carefully, but it has made everything clear. As for empty strings, from the problem description:
Here, we consider also the empty string as a palindrome.
Now your program didn't handle empty strings and you said the problem statement is unclear... What the logic here? :-?

(Just my personal opinion. Thank you.)

Posted: Mon Jan 01, 2007 5:25 am
by artie
Observer wrote:To those who feel bad about the "empty string" thing:

I don't see why you feel bad. Maybe you don't have time to read the problem statement carefully, but it has made everything clear. As for empty strings, from the problem description:
Here, we consider also the empty string as a palindrome.
Now your program didn't handle empty strings and you said the problem statement is unclear... What the logic here? :-?

(Just my personal opinion. Thank you.)
IMO when algo is correct as it's implementation, getting WA is very bad

Posted: Mon Jan 01, 2007 10:50 am
by sohel
As the problem statement clearly indicated there could be empty strings, I don't think there is any reason to be frustrated !!

If this problem is unclear, then I wonder what you will say to icpc regional, coimbatore 2005... :-?

Posted: Mon Jan 01, 2007 3:19 pm
by Monsoon
I don't feel bad about this..Btw i immediately noticed that empty string can occur. But i had many wa's with an empty string just after number of testcases. ;-)

Code: Select all

scanf("%d\n",&t);
while(t--) {
...;
gets(str);
...
}
has wa, to get acc i have to use this

Code: Select all

scanf("%d",&t);
gets(str);
while(t--) {
...;
gets(str);
...
}
I know that it was only my fault (i should know that this problem can occur, but i'm solving problem for couple years and never met such situations) and i wrote that none can complain about that, but i suggested to problems setters that in my opinion they should avoid such situations, please don't take it personal :-)

P.S. i NEVER said that the problem set was unclear, i only complain about using special cases with reading input to make tasks harder...

Posted: Mon Jan 01, 2007 6:05 pm
by Karim
i used longest common subsequence between string A and reversed string A

but i am getting WA

can anyone help me ??

Code: Select all

cut got AC 
a stupid mistake :oops: (small array )

Thanks

Wrong answer.

Posted: Mon Jan 01, 2007 7:50 pm
by deepesh
Following is my code during the contest. I have tested many of the edge cases including empty string. And this works. Can you give me a few more edge cases?

I keep getting wrong answer.

Code accepted now. Removed this.

Posted: Mon Jan 01, 2007 7:59 pm
by Monsoon
Like I said empty line just after number of testcases is really ... ;-)
when you use scanf("%d\n",&cases); you ate it :-)

Code: Select all

2

aa

Posted: Mon Jan 01, 2007 7:59 pm
by emotional blind
to deepesh:

use this

Code: Select all

scanf("%d", &cases);getchar();
instead of

Code: Select all

scanf("%d\n", &cases);

Wrong answer.

Posted: Mon Jan 01, 2007 8:08 pm
by deepesh
My code has got accepted. Can you explain as to why the scanf ate away the charater?

Re: Wrong answer.

Posted: Mon Jan 01, 2007 8:10 pm
by emotional blind
deepesh wrote:My code has got accepted.
So please remove it.

Posted: Tue Jan 02, 2007 3:21 am
by Observer
Monsoon wrote:I know that it was only my fault (i should know that this problem can occur, but i'm solving problem for couple years and never met such situations) and i wrote that none can complain about that, but i suggested to problems setters that in my opinion they should avoid such situations, please don't take it personal :-)
I didn't say that you complain. :) And I said "personal" just because I am NOT the problemsetter of this task!! :wink: