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 1001. Reverse Root

Ha-ha Binary search work faster then Newton metod for roots :)
Posted by Soul Reaver 14 Apr 2007 21:52
Re: Ha-ha Binary search work faster then Newton metod for roots :)
Posted by Alias (Alexander Prudaev) 16 Apr 2007 09:29
Ha - Ha, but sqrt is more faster then both :)
are you really solve it using newton method and binary search?
Re: Ha-ha Binary search work faster then Newton metod for roots :)
Posted by Soul Reaver 17 Apr 2007 00:51
Of course I know it :) and solve this problem first time with sqrt() function, but as experiment I try to solve this proble with Binary Search and Newton metods, Look at the top statistic of this problem, I have 11 result))
Re: Ha-ha Binary search work faster then Newton metod for roots :)
Posted by KIRILL(ArcSTU) 17 Apr 2007 01:54
sqrt function works 1.5 times slower on
C++ compilers then on Pascal
I think who get AC less then 0.1 sec used own implementation
of this function
Re: Ha-ha Binary search work faster then Newton metod for roots :)
Posted by Orlangur [KievNU] 18 Apr 2007 00:06
Do they not both use FPU instruction fsqrt?

Mine 0.062 is with precalculation for small numbers, faster can be only with own i/o (at least, ProgBeat succeeded in this way).

Pascal's i/o is definitely faster, this is the reason.
Re: Ha-ha Binary search work faster then Newton metod for roots :)
Posted by KIRILL(ArcSTU) 18 Apr 2007 03:29
I don't know exactly.  You can see it with help debugger
I only compare time Delphi7 vs VS2005

read/write work a little slower then scanf/printf
so the reason in sqrt I think(actually 2-3 times slower - see ranklist)

Edited by author 18.04.2007 04:38