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

Обсуждение задачи 1820. Уральские бифштексы

Probably wrong example and checking in task.
Послано Roman Mikhailov 21 сен 2012 15:08
The cook must cook the one steak during 2 minutes (each side during 1 minute). Right?

In example n = 3, k = 2, then:
* at first step he cook 2 stake during 2 minutes;
* at second step he cook 1 stake during 2 minutes;
Answer = 2 + 2 (minutes), but in example 3?

If try to send solution based on above logic, checker answered with mistake.

Probably checking occurs on this way (all test passed):

answer == (k >= n) ? 2 : n * 2 / k + ((n*2 % k == 0) ? 0 : 1)

but, more correctly (in my opinion) variant:

answer == (k >= n) ? 2 : n * 2 / k + ((n % k == 0) ? 0 : 1)
Re: Probably wrong example and checking in task.
Послано Bogatyr 23 сен 2012 17:56
Your solution to n=3, k=2 is not optimal.   Hint: examine different orderings, trying to keep the frying pan as full as possible all the time.   In your solution, you have the frying pan half empty twice.