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

Обсуждение задачи 1047. Простые вычисления

binary search
Послано jagatsastry 20 ноя 2007 14:24
any hint as to how binary search technique can be used for this problem?
Re: binary search
Послано KIRILL(ArcSTUpid coder:) 20 ноя 2007 15:06
Yua can do bs over a1, recalc sequence on each step
and check either last element of new sequence greater An+1 or less
Re: binary search
Послано jagatsastry 1 дек 2007 01:44
Do you mean to say i should choose a random number as a[1] and based on that value calculate a[n]. Then in the subsequent steps adjust the value of a[1] depending on how close the previous value of a[n] calculated was to the given value of a[n]. Is this the idea?
Re: binary search
Послано KIRILL(ArcSTUpid coder:) 1 дек 2007 04:07
jagatsastry писал(a) 1 декабря 2007 01:44
Do you mean to say i should choose a random number as a[1] and based on that value calculate a[n]. Then in the subsequent steps adjust the value of a[1] depending on how close the previous value of a[n] calculated was to the given value of a[n]. Is this the idea?

it's another approximation method

you can do bs of a[1] on range l:=-1000 to r:=1000
mid=(l+r)/2
a[1]=mid
then  calc new a'[n]
if a'[n] > a[n](wich is given) then r=mid else l=mid
that's all