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 1125. Hopscotch

HINT for WA2
Posted by tiancaihb 15 Aug 2009 11:25
The statement is poor. It says M*N, which is usually considered as M in x-axis and N in y-axis.
But actually, for M=2,N=3 they mean
xxx
xxx
(That can be infered from "The next M lines contain a matrix with nonnegative integer elements")
And we can't understand that from Sample because it's a square!

***  So,if you always get WA2,try to swap m,n.  ***
I changed scanf("%d %d",&m,&n) to scanf("%d %d",&n,&m) and got AC.
Sorry for my poor English.

Edited by author 15.08.2009 11:30

Edited by author 15.08.2009 11:31
Re: HINT for WA2
Posted by Jane Soboleva (SumNU) 2 Oct 2015 16:40
Nevermind, i'm stupid... another hint for WA #2: when generate your numbers a^2+b^2=c^2, and then you invert things like (+3X, +4X) for X=1...while coordinates are valid, and then later you want to invert (+6X, +8X) — don't! Because you invert the same place once more.

Edited by author 02.10.2015 16:50