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 1710. Boris, You Are Wrong!

Useful tests for you, guys
Posted by Vedernikoff Sergey (HSE: АОП) 12 Apr 2009 15:01
0 0
0 1000
1 0
YES

0 0
1 1000
1 0
YES

0 0
1 1000
2 0
YES
Re: Useful tests for you, guys
Posted by Smilodon_am 18 Apr 2009 17:57
Real thanks, Sergey.
I had WA3. When I test my program with your tests, I get wrong answer on the second test. My mistake was in comparing the angle ACB with 90 degrees. There was (in C++):
if (angle==pi/2.0)...
but the right text would be:
if (fabs(angle-pi/2.0)<=1e-11)...

When I fixed the problem I got AC.
Re: Useful tests for you, guys
Posted by Vedernikoff Sergey (HSE: АОП) 21 Apr 2009 16:52
Never forget to use EPS when compare real numbers. Without it, result of the work of your program is almost unpredictable
Re: Useful tests for you, guys
Posted by Oleg Strekalovsky [Vologda SPU] 18 May 2009 00:12
Vedernikoff Sergey (HSE: АОП) wrote 12 April 2009 15:01
0 0
0 1000
1 0
YES

0 0
1 1000
1 0
YES

0 0
1 1000
2 0
YES
0<=|x|,|y|<=100
But tests are useful :)

Edited by author 18.05.2009 12:28
Re: Useful tests for you, guys
Posted by Vedernikoff Sergey (HSE: АОП) 19 May 2009 21:05
If 1000 insted of 100 prevents your program from passing the tests, then your program is really horrible =)
P.S. I've written 1000 instead of 100 as a very corner cases specially to test possible error instability.
Re: Useful tests for you, guys
Posted by Sevenk 29 Aug 2009 09:54
I have known that.