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

Обсуждение задачи 1600. Аэропорт

If you got WA#3 or WA#16
Послано kolesnik_av 24 мар 2008 23:20
ds:=sqr(b)-a*c;

the checking must look like this
if ds+0.000000000001>=0 then
...
Re: If you got WA#3 or WA#16
Послано Olympic Bear (Nikolay Dubchuk) 10 июн 2008 17:36
Also when I calculated square roots for
a*t^2 + 2*b*t + c = 0 as
t1,2 = (-b +- sqrt(b^2 - a*c)) / a
I had wa3.
When I use b = 2.0 * b
t1,2 = (-b +- sqrt(b^2 - 4.0*a*c)) / (2.0*a)
I got AC.
It is very curiously...
Re: If you got WA#3 or WA#16
Послано yujj 13 июн 2008 15:05
I has WA#3. Even, i use check ds+0.000000000001>=0. I don't understand what's wrong. :(
Can you talk me what in test 3?
Re: If you got WA#3 or WA#16
Послано Hadi Moshayedi 24 июл 2008 15:18
If ds passes this test, it may be less than zero. so, if it is less than zero, reset it to zero. otherwise, sqrt won't perform as expected.
Re: If you got WA#3 or WA#16
Послано Denis Koshman 19 авг 2008 04:14
Also check for possible -0.000 replies (that happens in printf("%.3lf") when number is negative, but becomes zero after round-up). Some checkers do not like that.
Re: If you got WA#3 or WA#16
Послано Linas 19 окт 2008 22:40
Is negative time a possible answer? :(
Re: If you got WA#3 or WA#16
Послано Azrail 1 дек 2008 14:14
There is curious fact, that you can get AC with eps = .1!
Most important do not forget about:
Hadi Moshayedi писал(a) 24 июля 2008 15:18
If ds passes this test, it may be less than zero. so, if it is less than zero, reset it to zero. otherwise, sqrt won't perform as expected.
Re: If you got WA#3 or WA#16
Послано Felix_Mate 30 авг 2015 20:40
Thanks!
Re: If you got WA#3 or WA#16
Послано Mortus 24 июл 2023 18:06
I also checked abs(ds) < eps , then t = -b/(2*a)

Without it, it was WA3