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

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

Approximation method
Послано VladG 23 окт 2002 14:26
I think that this problem could be solved also by an approximation
method. (In adition to discovering the exact expression for a[1])

The method that I offer in simplifaction look as follows:

for (i=1; i<=elemNum; i++)
  a[i] = 0;

for (j=0; j<elemNum*N; j++) {
  for (i=1; i<=elemNum; i++)
    a[i] = (a[i-1] + a[i+1]) / 2 - c[i];

  printf("%.2f", a[1]);

I think that after enough number of iterations it should reach the
exact answer.

Though, some tests that I ran with this method gave the right result,
but it gave a Wrong Answer when I submitted.
May be I need to make some tunnings to my method.

What do you think?
There's an exact formula (-)
Послано Miguel Angel 24 окт 2002 05:55
> I think that this problem could be solved also by an approximation
> method. (In adition to discovering the exact expression for a[1])
>
> The method that I offer in simplifaction look as follows:
>
> for (i=1; i<=elemNum; i++)
>   a[i] = 0;
>
> for (j=0; j<elemNum*N; j++) {
>   for (i=1; i<=elemNum; i++)
>     a[i] = (a[i-1] + a[i+1]) / 2 - c[i];
>
>   printf("%.2f", a[1]);
>
> I think that after enough number of iterations it should reach the
> exact answer.
>
> Though, some tests that I ran with this method gave the right
result,
> but it gave a Wrong Answer when I submitted.
> May be I need to make some tunnings to my method.
>
> What do you think?