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 1489. Points on a Parallelepiped



Edited by author 15.10.2006 11:24
Check each region by x and y, e.g.
if (b+c<=y && y<=b+c+b && c <= x && x<=c+a) // bottom region
Alexey Thanks. Now I have WA#7 ) [8] // Problem 1489. Points on a Parallelepiped 15 Oct 2006 18:59
I had some mistakes like
If y>=a+b+c ...
but must be
If y>=b+b+c

I have one check per one side.
For example
If y<=b - the point is on the lowest side (on the picture).
If x<=c - the point is on the leftest side.
etc.

So, it is enough to check, you see, but WA#7.

Thanks for help but still need it. )
Tolstiy_BSU Re: Thanks. Now I have WA#7 ) [6] // Problem 1489. Points on a Parallelepiped 18 Oct 2006 14:38
You need check
y > b+b+c and y < b+c..

because when point on the edge .... You can do mistake ...
(I was wrong in this)
Alexey Re: Thanks. Now I have WA#7 ) [4] // Problem 1489. Points on a Parallelepiped 18 Oct 2006 21:28
I have AC, so thank U very much!
But I still don't understand my mistake.
It is guaranted that the point is in the picture, so
I can only check one coordinate...

Cann't understand...
Midnight_Kitty Re: Thanks. Now I have WA#7 ) [3] // Problem 1489. Points on a Parallelepiped 27 Nov 2006 01:11
be careful when you do checks like
  if (x <= a) then ...
it can produce WA, becouse if x = a, point can lie on another side
Paul Diac Re: Thanks. Now I have WA#7 ) [2] // Problem 1489. Points on a Parallelepiped 21 Sep 2007 02:23
Yes, that is true.
Thank you.
The test that makes the difference is:
-------
2 2 2
0 4
4 0
-------
before this correction the answer was 4.8989794856 (wrong!)
but the right answer is 2.8284271247 (verifyed with AC program).
UXMRI: Sergey Baskakov, Raphail Akhmedisheff and Denis Nikonorov Re: Thanks. Now I have WA#7 ) // Problem 1489. Points on a Parallelepiped 26 Jun 2009 17:22
This is great test. Thank you!
TY, Paul Diac!

Edited by author 30.10.2017 01:21
SuperLight no mes // Problem 1489. Points on a Parallelepiped 26 Jun 2009 19:31
If you use real numbers, you can get situation, when point lies on none of 6 sides. So you should work with epsilon. Or you can use exact arithmetic, just multiply numbers by 100!



It means 100 and !, not 100! :)

Edited by author 26.06.2009 17:41