1 / 5
Aug 2012

Hi
can any body tell me why i get WA in GOALFR every time.
is my code really give wrong answers ???
http://www.spoj.pl/problems/GOALFR

my code :

deleted after AC

in stuct line : 'm' & 'd' are from line equation y= m x + d
l1 : is the line that between cross1 and ball (as l2 : cross2 , ball )
far1 : is the distanse between Goal Keeper center (GKc) and l1 (as far2 : GKc , l2)

i think my wrong in output form.
thanks

  • created

    Aug '12
  • last reply

    Aug '12
  • 4

    replies

  • 172

    views

  • 2

    users

  • 1

    link

Sorry but i'm sure it was in the opponent goal :
as we know the board center coord (0,0) so if GK x axis > 0 so opponent goal x >0 ( so 'fact' take 1) otherwise 'fact' = -1.
Cross bars of the net coords on x are 'cross(1,2).x' * fact .
if distanse between l1 (or l2 or both) and GK center > R so sure player can did it.
thanks leppy smile

Thanks leppy , it's Ac smiley i'm very happy, i really never note that net on the right side only.
thanks again.

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 17 11d

Want to read more? Browse other topics in C and C++ or view latest topics.