ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1313. Some Words about Sport

100*100 not enough?
Posted by $wordfish 9 Jul 2012 23:57
So the problems says that 1 <= N <= 100, so I declare a nice unsigned char mem[100*100].
I get WA on test 4.
I go and read all the discussion about wrong awsers but none of those offer anything I didn't figure out already.
I change the declaration to unsigned char mem[256*256] and voila, the solution is magically accepted.
Does anyone have an idea why 100*100 bytes aren't enough?
Re: 100*100 not enough?
Posted by Artem Khyzha 10 Jul 2012 08:16
I wrote a solution in Pascal (ages ago :-)), which AFAIR checks whether index is in range while accessing to some element in array. And I had [1..100,1..100]. That is why I suppose that somewhere in your program you access out of array.
Re: 100*100 not enough?
Posted by Bogatyr 16 Sep 2012 16:44
100x100 is enough, assuming you start your indexing at 0 and end at n-1