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

Обсуждение задачи 1350. Столовая

Could anyone explain me the task?
Послано Alexandrov Sergey 27 мар 2005 18:54
Please tell me, how I must use M from input???

And, by the way, why second person from sample input will poison?
Re: Could anyone explain me the task?
Послано Burunduk1 27 мар 2005 19:55
Assume the first man eats no products.

In canteen you can find only M products,
so if for us are bad only N - M products we have chance
to live and if for us are bad N - M + 1 products
(we know that one of them exactly is poisoned) we will die.
Could anyone explain me the task?
Послано Alexandrov Sergey 28 мар 2005 15:12
Thanks for your hint, got AC... :)
Re: Could anyone explain me the task?
Послано Smog 3 апр 2007 17:08
Does each student eat M products from canteen?
if so, do we have after  i-st student N-M*i products?
And last student can't get 3 products.

Otherwise, why second student don't take "Rafinat+Pastila+Chocolate" and stay alive?
Re: Could anyone explain me the task?
Послано dibrov.bor[SumySU] 21 апр 2008 01:49
> Does each student eat M products from canteen ?
yup
> do we have after i-st student N-M*i products ?
no, each student receive same products
menu is fixed and it consist of M products from N given
from the example first student test the food and he is OK, that means there are no stuffs in menu from his dangerous list { Rafinad, Kefir, Imbir }
so here the menu consist of 3 stuffs from { Pastila, Smetana, Chokolade, Kljukva }
the second student have 2 dangerous products from leaved and in any combination of menu he die :/
Re: Could anyone explain me the task?
Послано RASTA 19 апр 2009 18:40
let products which eat first student will be in list A
all other products in list B
for each student we count products, which his take, which in list B
if this counter = 0
then we write YES
if this counter <= N - X - M, where X is count of products in list A
then we write MAYBE
else we write NO