If you got AC, you may remove your code.. so it would not be a spoiler..artie wrote:[Thanks a lot!
Could anyone explain me why my input was faulty?
11151 - Longest Palindrome
Moderator: Board moderators
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
. And now is it becouse of my implementation? algorithm? tricky case? or now even how i read input or write output?
. 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.
![:wink:](./images/smilies/icon_wink.gif)
![:x](./images/smilies/icon_mad.gif)
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:
![:-?](./images/smilies/icon_confused.gif)
(Just my personal opinion. Thank you.)
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:
Now your program didn't handle empty strings and you said the problem statement is unclear... What the logic here?Here, we consider also the empty string as a palindrome.
![:-?](./images/smilies/icon_confused.gif)
(Just my personal opinion. Thank you.)
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
IMO when algo is correct as it's implementation, getting WA is very badObserver 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:
Now your program didn't handle empty strings and you said the problem statement is unclear... What the logic here?Here, we consider also the empty string as a palindrome.
(Just my personal opinion. Thank you.)
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. ![;-)](./images/smilies/icon_wink.gif)
has wa, to get acc i have to use this
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 ![:-)](./images/smilies/icon_smile.gif)
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...
![;-)](./images/smilies/icon_wink.gif)
Code: Select all
scanf("%d\n",&t);
while(t--) {
...;
gets(str);
...
}
Code: Select all
scanf("%d",&t);
gets(str);
while(t--) {
...;
gets(str);
...
}
![:-)](./images/smilies/icon_smile.gif)
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...
i used longest common subsequence between string A and reversed string A
but i am getting WA
can anyone help me ??
a stupid mistake
(small array )
Thanks
but i am getting WA
can anyone help me ??
Code: Select all
cut got AC
![:oops:](./images/smilies/icon_redface.gif)
Thanks
Wrong answer.
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.
I keep getting wrong answer.
Code accepted now. Removed this.
Last edited by deepesh on Mon Jan 01, 2007 8:13 pm, edited 1 time in total.
Like I said empty line just after number of testcases is really ... ![;-)](./images/smilies/icon_wink.gif)
when you use scanf("%d\n",&cases); you ate it![:-)](./images/smilies/icon_smile.gif)
![;-)](./images/smilies/icon_wink.gif)
when you use scanf("%d\n",&cases); you ate it
![:-)](./images/smilies/icon_smile.gif)
Code: Select all
2
aa
-
- A great helper
- Posts: 383
- Joined: Mon Oct 18, 2004 8:25 am
- Location: Bangladesh
- Contact:
to deepesh:
use this
instead of
use this
Code: Select all
scanf("%d", &cases);getchar();
Code: Select all
scanf("%d\n", &cases);
Wrong answer.
My code has got accepted. Can you explain as to why the scanf ate away the charater?
-
- A great helper
- Posts: 383
- Joined: Mon Oct 18, 2004 8:25 am
- Location: Bangladesh
- Contact:
Re: Wrong answer.
So please remove it.deepesh wrote:My code has got accepted.
I didn't say that you complain.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
![:)](./images/smilies/icon_smile.gif)
![:wink:](./images/smilies/icon_wink.gif)
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org