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

## Обсуждение задачи 1300. Налогообложение

Problem 1300 is UNFAIR!
Послано Walrus 24 авг 2006 22:16
In this problem we need to calculate R(S): F(R) = S,
where F(R) = R – T(R) + L%*R – T(L%*R).
But function F(R) is NOT increase monotonically!
In other words, it is possible to find R: F(R) = F(R+1).
So, it is impossible to calculate unique R(S).

Example:
99
1000000000 10
2000000000 40
3000000000 41
0          77
100000000
2000000000
3000000000
4200000000
5000000000
1100000001
2200000000
3300000001
-1

If in your program R(S) = max{R: F(R) = S}
(and you'll get AC)

If in your program R(S) = min{R: F(R) = S}
(and you'll get WA #7)

Which of they are correct? And why?
Re: Problem 1300 is UNFAIR!
Послано Chmel_Tolstiy 15 июл 2008 03:15
Admins. I think Walrus is right. may be need to change a statement...
Re: Problem 1300 is UNFAIR!
Послано svr 24 ноя 2008 21:07
It is mathematical situation and not of statement.
max{R: F(R) = S} may be =1/3 and approxed by double with eps. After rounding this eps may convert 0.4999999999~0.0
in 0.5000000000001~1. Thus we must solve the problem above
fractions __int64/_int64.

Got Ac when R is double but after floor(R*100+0.5)/100
This problem is another example that in double
calculations we need in description of the author algorithm.

Edited by author 26.08.2009 12:56
Re: Problem 1300 is UNFAIR!
Послано Fly [Yaroslavl_SU] 6 дек 2008 20:47
There is no fractions. I just used int64. :)
Re: Problem 1300 is UNFAIR!
Послано svr 8 дек 2008 12:36
Suggestion to find R(S) = max{R: F(R) = S}
must be added with information: In what class of numbers
should we seach of the S?
1) Numbers of pattern ########.## - rubles and copeys
2) All real numbers