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 1052. Rabbit Hunt

test #4 out of bounds?
Posted by Daniel Mahu 9 Dec 2011 04:04
In my solution I read values like this:

        scanf("%d %d", &px[i], &py[i]);
        px[i] += 1000;
        py[i] += 1000;
        board[px[i]][py[i]] = 1;

and get access violation on test #4; however, if I add right before accessing the array:

        if (px[i] < 0 || py [i] < 0 || px[i] > 2000 || py[i] > 2000) {
            while (1);
        }

I get TLE on the same test.

Are all the values of test #4 within the bounds -1000 <= x,y <= 1000 ?!
Re: test #4 out of bounds?
Posted by Sandro (USU) 9 Dec 2011 14:12
Statement is fixed. Now -2000 <= x,y <= 2000 (as it was actually in tests). Thank you.