← Back to topics
Topic

"trougao"

f
fizaaaa
can someone check my code?
http://www.z-trening.com/new/www/html/submit.php?submit=7100048997&subm_code=1
Thanks in advance :)
F
FilipKeri
In your code you have this:

______________________________________

return abs( x[a] * ( y[b] - y[c] ) + x[b] * ( y[c] - y[a] ) + x[c] * ( y[a] - y[b] )

______________________________________

I think you must have this

______________________________________

return abs( x[a] * ( y[b] - y[c] ) + x[b] * ( y[c] - y[a] ) + x[c] * ( y[a] - y[b] ) / 2.0

______________________________________

because I think your return is too big for int64, I guess

I was having the same problem in pascal and I was getting WA on same test cases. It helped me
f
fizaaaa
Gives the same results as before .... 2,3,6,9 WR

http://www.z-trening.com/new/www/html/submit.php?submit=7100049004&subm_code=1