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

Обсуждение задачи 1864. Посиделки у Дена

Soporboy Botirov [TUIT Urgench] What is WA#9 [21] // Задача 1864. Посиделки у Дена 15 окт 2011 14:54
Any one yes test?

how about this one sample

5
5 3 3 3 3

? this ans right 76 5 5 5 5?

Edited by author 15.10.2011 14:59
Vitaliy Karelin Re: What is WA#9 [2] // Задача 1864. Посиделки у Дена 15 окт 2011 15:38
I have 76 5 5 5 5 too, but WA#9 also too
Yan_Kurganov (Kovrov STA) Re: What is WA#9 [1] // Задача 1864. Посиделки у Дена 15 окт 2011 15:59
my solution also WA 9 test
76 5 5 5 5 too

Edited by author 15.10.2011 15:59

Edited by author 15.10.2011 15:59
morbidel Re: What is WA#9 // Задача 1864. Посиделки у Дена 15 окт 2011 16:19
Mine gives 76 6 6 6 6 but WA 4 :)

Edited by author 15.10.2011 16:19
Nily Re: What is WA#9 // Задача 1864. Посиделки у Дена 15 окт 2011 16:20
my solution also WA 9 test
76 5 5 5 5 too
Zhandarbek Re: What is WA#9 [1] // Задача 1864. Посиделки у Дена 15 окт 2011 16:59
mine gives 100 0 0 0 0
Yan_Kurganov (Kovrov STA) Re: What is WA#9 // Задача 1864. Посиделки у Дена 15 окт 2011 17:07
You've got the AC? as may be the answer?

if all friends and Dan drank equally, then each are drank at 2.8 liters => each of them has bought more than drinking

sorry for bad english :)
Rashid Gaziyev Re: What is WA#9 [2] // Задача 1864. Посиделки у Дена 15 окт 2011 17:08
I think it should be 100 0 0 0 0.
Because everyone drank 3,8l and 4 of them bought 3l and Dan doesn't have to pay them.

Edited by author 15.10.2011 17:10
George_Aloyan[PTSObninsk] Re: What is WA#9 [1] // Задача 1864. Посиделки у Дена 15 окт 2011 17:26
Why?
They brought 5+3+3+3+3 = 17, so everyone drank 17/6 = 2,8(3).
andy Re: What is WA#9 // Задача 1864. Посиделки у Дена 15 окт 2011 17:32
George_Aloyan[PTSObninsk] is rigth
IgorKoval(from Pskov) Re: What is WA#9 [9] // Задача 1864. Посиделки у Дена 15 окт 2011 18:18
This wtf situation from precision.
Эта всё из-за точности.

For example:
Например:
4.99999999999999999999999999
But in real this is 5. When this are arounded in floor we get 4.
Но на самом деле это число 5. А при округлении вниз получаем 4.

So!
Итак!

This get WA9
floor(100.0*(a[i]-half)/mt);

But this get AC
floor(100.0*(a[i]-half)/mt+0.0001);

P.S.: get 10 times WA9 =)
Edited by author 15.10.2011 18:19

Edited by author 15.10.2011 18:19

Edited by author 15.10.2011 18:20
Yan_Kurganov (Kovrov STA) Re: What is WA#9 // Задача 1864. Посиделки у Дена 15 окт 2011 18:32
IgorKoval(from Pskov) писал(a) 15 октября 2011 18:18
This wtf situation from precision.
But this get AC
floor(100.0*(a[i]-half)/mt+0.0001);
Thank you very much. AC
George_Aloyan[PTSObninsk] Re: What is WA#9 // Задача 1864. Посиделки у Дена 15 окт 2011 18:34
Thanks a lot, but really a strange situation)I understand the problem now, but... *Started reversing my solution* :)
MOPDOBOPOT (USU) Re: What is WA#9 [2] // Задача 1864. Посиделки у Дена 15 окт 2011 20:23
+0.0001 gave me WA#11
but +0.00001 gives AC ;)
svr Re: What is WA#9 [1] // Задача 1864. Посиделки у Дена 15 окт 2011 20:26
Friends!
Problem can be solved easy in int type only without any 0.0001 and so on.
Multiply all by common denumenators and have joy of AC.
[kp] Re: What is WA#9 // Задача 1864. Посиделки у Дена 15 окт 2011 21:48
min multiplied coefficient is 5 - to get the AC=)(on Java)
on c++ I used coefficient - 1000

Edited by author 15.10.2011 22:00
kasarino Re: What is WA#9 // Задача 1864. Посиделки у Дена 25 дек 2014 15:43
Thank you!
Спасибо!
Nikita Re: What is WA#9 [2] // Задача 1864. Посиделки у Дена 13 апр 2016 22:12
Thanks, I had a WA#5, added +0.0001 and got AC
MatrixDeity Re: What is WA#9 [1] // Задача 1864. Посиделки у Дена 23 ноя 2017 18:24
Hi, everyone!

I had WA#9 too, but I wrote 'long double' instead of 'double' and got AC. It means it was precision's trouble.

Edited by author 23.11.2017 18:25
Hristo Nikolaev (B&W) Re: What is WA#9 // Задача 1864. Посиделки у Дена 5 дек 2022 21:16
I had the same problem.
changing double to long double didn`t help,
but adding 0.0001 to the result before casting it to int got my code AC.
Apparently it`s an epsilon problem.
alp Re: What is WA#9 [1] // Задача 1864. Посиделки у Дена 16 окт 2011 00:46
AC program 76 5 5 5 5
balandini Re: What is WA#9 // Задача 1864. Посиделки у Дена 8 фев 2012 14:33
My AC program answers to the test:5
                                  5 3 3 3 3
76 5 5 5 5 too.