ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1350. Canteen

Could anyone explain me the task?
Posted by Alexandrov Sergey 27 Mar 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?
Posted by Burunduk1 27 Mar 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?
Posted by Alexandrov Sergey 28 Mar 2005 15:12
Thanks for your hint, got AC... :)
Re: Could anyone explain me the task?
Posted by Smog 3 Apr 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?
Posted by dibrov.bor[SumySU] 21 Apr 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?
Posted by RASTA 19 Apr 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