ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1001. Обратный корень

Ha-ha Binary search work faster then Newton metod for roots :)
Послано Soul Reaver 14 апр 2007 21:52
Re: Ha-ha Binary search work faster then Newton metod for roots :)
Послано Alias (Alexander Prudaev) 16 апр 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 :)
Послано Soul Reaver 17 апр 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 :)
Послано KIRILL(ArcSTU) 17 апр 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 :)
Послано Orlangur [KievNU] 18 апр 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 :)
Послано KIRILL(ArcSTU) 18 апр 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