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

Alias (Alexander Prudaev) Re: Ha-ha Binary search work faster then Newton metod for roots :) [4] // Problem 1001. Reverse Root 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?
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))
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
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.
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