|
|
back to boardPlease 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 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 Yeah... I was caught by that too :)) Re: Please Help WA 16 pretty nice test |
|
|