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

Обсуждение задачи 1796. Парк аттракционов

Key points of the algorithm
Послано DiG 1 май 2012 20:42
1) First of all you have to calculate maximum of tickets the teacher can buy ((amount of money) div (price of one ticket))
2) Next step you have to find minimum of tickets. You must pick up one banknote with minimum denomination and calculate amount again: in sample test you get 0 1 0 0 0 0 sequence. Then calculate amonut of money again. So, now you can get minimun of tickets ((new amount of money) div (price of one ticket) + 1).
3) So, now you have minimum and maximum of tickets. Just output the number of possible answers in the first line (tMax - tMin + 1) and the variants in ascending order (for i:=tMin to tMax do write(i,' ');

Good luck and get AC!
Re: Key points of the algorithm
Послано [TDUweAI] daminus 25 июн 2013 23:54
this algo get WA on test #13

Edited by author 25.06.2013 23:54
Re: Key points of the algorithm
Послано BillSu 28 апр 2014 05:59
I think you miss one important step: Think hard about how flexible your tickets is. Not just minimum and maximum tickets, otherwise you will still get WA.
Re: Key points of the algorithm
Послано miro.v.k 24 апр 2016 23:20
Thank you :) !