|
|
back to boardHa - 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 |
|
|