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

Обсуждение задачи 2008. Артамончик

I think there is something wrong
Послано MishaRash 20 июл 2015 18:02
I solved this problem theoretically and checked ability of a jump by counting the discriminant of square equation.
I got WA on tests 30-32 using floating point numbers and trying to find good precision (type double in C) and rewrote my program using long integer type (long long) with no precisions.
The first thing I noticed is that I got WA on test 20 when I say that jump is possible if D>=0. If I check D>0, I get WA on test 32. I'm sure it's not correct, because if D=0 exactly jump is still possible.
I thought the problem could be in overflowing. Despite long long must be enough, I rewrote the program in Python 3 to avoid overflowing for sure and nothing changed.
So I think I am right and there are wrong tests. I can show my source code if needed.

Edited by author 20.07.2015 18:27
Re: I think there is something wrong
Послано MishaRash 21 июл 2015 17:45
By the way, I got AC on FreePascal using the condition that is less strict because of precisions.
Re: I think there is something wrong
Послано popolwooh 19 сен 2015 14:20
Approve this. Only condition D >= 0 allows test like this
0 1
0 0
0 2
There is additional check needed.
Re: I think there is something wrong
Послано svr 19 янв 2016 17:34
This magic works:
L^2*g^2<=(V^2-g*(y2-y1))^2 implem. in long long(g=98/10)