Please give some I/O. I don't know why I got WA


Thx in advance

Moderator: Board moderators
Why do you need to use Binary Search, the answer is simply of the form:Adrian Kuegel wrote: This was the test case I got wrong first (I did use binary search, and my ranges were wrong).
Well, I didn't find that formula, but a formula where I can use binary search. So during the contest, I thought it is better to implement that than losing more time to find a better formula.shamim wrote:Why do you need to use Binary Search, the answer is simply of the form:
ans = Expression();
Code: Select all
double fia=0,fib = pi/2.0 - atan2(r-d,r),fic,Hc;
while(fib - fia > eps)
{
fic = (fib + fia)/2.0;
Hc = H(fic);
if(Hc < h1) fib = fic;
else fia = fic;
}
return l*sin(fia) + h1;
Sadly, this is just a silly problem with the problemsetter's English. I already encountered this phrase several times (sadly, including one ACM ICPC regionals). By saying "round up the result" the problemsetter usually means "the result should be rounded" and this (again, usually) means "round the result using standard output routines".Experimenter wrote:anyway,I've got accepted, though the problem states I should round UP