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 1405. Goat in the Garden 5

Please Help WA 16
Posted by Lomir 1 Feb 2007 02:15
Firstly i calculate the longest rope lenths at each tree.
Then just try to tether goats to every tree, calculating the square.
If sum of 2 maxrope are larger then lenght between trees:
double maxrad = std::max(maxr[i], maxr[j]);
double minrad = l - maxrad;
if (minrad < 1.0)
{
    maxrad = maxrad - (1 - minrad);
    minrad = 1.0;
}
if (maxrad >= 1.0)
maxsize = std::max(maxsize, square(maxrad)+sqree(minrad));
Re: Please Help WA 16
Posted by KIRILL(ArcSTU) 1 Feb 2007 03:53
Try this test
4
0 0
5 0
6 0
6.5 0

Right answer is 53.4071
Re: Please Help WA 16
Posted by Lomir 1 Feb 2007 06:05
Thx, really nice test.
Now AC :)
Re: Please Help WA 16
Posted by Denis Koshman 5 Aug 2008 05:47
Yeah... I was caught by that too :))
Re: Please Help WA 16
Posted by crossheart 5 Dec 2012 08:22
pretty nice test