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

Обсуждение задачи 1417. Космическая распальцовка

Precision problem
Послано Samsonov Alex [USU] 11 ноя 2005 20:27
I've writtan the program and it seems that I use correct solution. But the output for the sample is:

0.32985
0.33622
0.33390

Extended in Pascal doesn't help.
Should we use some specific things?
Re: Precision problem
Послано sgn 14 дек 2005 19:42
I have WA on test 9 and I don't know why too :)
Re: Precision problem
0.32985
0.33622
0.33390
The sum of this number is not 1.
But I make next operations:
I write N-1 numbers as I find in program.
And the last number I write as subtraction 1 and N-1 previous numbers.

So I have WA2.

Can somebody explain me why?
Re: Precision problem
Послано Alexander Prudaev 22 май 2006 18:08
992050/2971042=0,33390642071....
maybe use round(100000*x)/100000?
Re: Precision problem
Послано Vedernikoff Sergey 30 июн 2006 14:00
You can just output not 5 digits after decimal point, but more. I've outputted 8 digits - and AC in 1st attempt... My program finds not 5, but 10 exact digits after decimal point.

P. S. I've used not extended, but even REAL in Pascal...

P. P. S. And if my program outputs 5 digits - it's output corresponds to the sample output. So, may be your algo isn't right?

Edited by author 30.06.2006 14:03