![:wink:](./images/smilies/icon_wink.gif)
830 - Shark
Moderator: Board moderators
830 - Shark
I am trying on this problem, but got lots of WAs. I think I have checked for all conditions (at least I think
). Could anyone tell me if there's any tricky input exists?
![:wink:](./images/smilies/icon_wink.gif)
-
- Experienced poster
- Posts: 167
- Joined: Fri Oct 19, 2001 2:00 am
- Location: Saint Petersburg, Russia
Bug in shark last test case input
Hi,
There's a reason for so much errors while submiting Shark.
There's a bug in the last test case input.
The first line of each test tell us the number of lines and number of columns, unfortunately for last test case the input says there are 38 columns but in fact there are 39, that's why who's reading char by char
can have serious problems. (like I did...)
Fortunately this unsuspected column is just filled with dots so who's reading all line at once shouldn't have problems.
I had the opportunity to see the input files because the author of the problem is a teacher of mine.
Hope this helps.
Regards
Jose Santos
There's a reason for so much errors while submiting Shark.
There's a bug in the last test case input.
The first line of each test tell us the number of lines and number of columns, unfortunately for last test case the input says there are 38 columns but in fact there are 39, that's why who's reading char by char
can have serious problems. (like I did...)
Fortunately this unsuspected column is just filled with dots so who's reading all line at once shouldn't have problems.
I had the opportunity to see the input files because the author of the problem is a teacher of mine.
Hope this helps.
Regards
Jose Santos
-
- Guru
- Posts: 1080
- Joined: Thu Dec 19, 2002 7:37 pm
-
- New poster
- Posts: 13
- Joined: Wed Oct 26, 2005 10:14 pm
- Location: Iran
- Contact:
According to what erdos said, i used this code and it got accepted:
except this i read normally from the input(char by char).
Code: Select all
for(cin>>n;n--;)
{
cin>>h>>w;
if(!n)w=39;
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 830 - Shark
It looks like the input has been fixed. I read char by char without any of these workarounds and got AC.
Check input and AC output for thousands of problems on uDebug!
Re: 830 - Shark
I also had problems with the way of reading. I obtained wrong answer when reading character by character, but AC when reading line by line, so be careful...