I uses these code to do binary search:
l=0;
r=1e12;
while(fabs(l-r)>1e-6)
{
//some code
}
but it stucked with large data in my local PC.
I also doesn't work in Code Jam Africa and Arabia 2011 Online
Competition Problem C Radio Receiver.
I saw the code from the first place of today's match.
He uses this line of code instead:
REP(i,100){
means iterates for 100 times.
1e15/2^100<1e-6, so it fit the precious.
I'm wondering that is it caused by the precious of float number
operations?
--
You received this message because you are subscribed to the Google Groups
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-code?hl=en.