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

Обсуждение задачи 1621. Definite Integral

Can someone give me any tips for test #11 pls
Послано HeypaBHoBeceH 30 окт 2008 13:04
First I thought it was precision but now I don't know anymore.
I thought i would never post a thread like this one but...
Can someone give me any tips for test #11 pls
Послано HeypaBHoBeceH 30 окт 2008 17:54
this is a part of my code, f_x() is P(x):
left1 = left2 = f_x(0);
for(x = 1e-3 ; x < 6000 ; x += 1e-3)
    {
        y1 = f_x(+ x);
        y2 = f_x(- x);
        ans += ((((left1 + y1)/left1)/y1)) + ((((y2 + left2)/y2)/left2));
        left1 = y1;
        left2 = y2;
    }
    ans *= 0.5*(1e-3);
Re: Can someone give me any tips for test #11 pls
Послано Anisimov Dmitry (Novosibirsk STU) 6 ноя 2008 00:06
Try to use dx and limits which can be represented in binary form exactly (e.g. 1/1024.0 instead of 1e-3)
Re: Can someone give me any tips for test #11 pls
Послано HeypaBHoBeceH 17 ноя 2008 23:45
appreciate the tip, but still WA11...
Re: Can someone give me any tips for test #11 pls
Послано Anisimov Dmitry (Novosibirsk STU) 6 дек 2008 22:36
Why are you using plus-minus 6000 as limits?
1/P(x) could have its maximum as far as x = 10^6 and a bit further.

Edited by author 06.12.2008 22:36
Re: Can someone give me any tips for test #11 pls
Послано HeypaBHoBeceH 2 июн 2009 13:47
nvm, Accepted!

Edited by author 02.06.2009 14:16
Re: Can someone give me any tips for test #11 pls
Послано xurshid_n 31 янв 2012 13:48
Thank you a lot, I AC!!!!!!!!!!!!!!