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

Обсуждение задачи 1261. Чаевые

I don't under the meaning of this problem.Could somebody explain?
Послано CNEinstein 17 апр 2004 20:36
Re: I don't under the meaning of this problem.Could somebody explain?
Послано Vesper 21 апр 2004 17:46
A programmer has a set of banknotes valued 1, 3, 9 ..., 3^k,... one each. He has to pay N in a restaurant (provided) He must pay that much M so: M can be paid with banknotes the programmer has, i.e. he cannot pay 5, because he does not have 2 bank notes with value of 1; and M-N must be represented the same way, i.e. if N is 4, M cannot be 9, because 5 cannot be represented as a sum of 3^K, one or less for each K. So if asked 4, a programmer must pay 13, 13=9+3+1, 13-4=9.

I hope you will understand this clumsy explanation.
Thanks you for your help! I got AC.
Послано CNEinstein 21 апр 2004 21:34
Re: I don't under the meaning of this problem.Could somebody explain?
Послано Edric Mao 25 окт 2011 19:49
Thanks for the explanation.
Re: I don't under the meaning of this problem.Could somebody explain?
Послано Ahmmed Jubayer Rumman 28 июл 2020 19:57
here 4 can be represented as 1+3^1  . why i have to pay 13 ? I failed to understand the problem ?