Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Java: Общие вопросы > Интересная задачка.


Автор: unkis 19.10.2015, 21:27
Народ привет,

А вы как думаете, сколько кофе автоматов в следующей задачки?


Model a system that allows programmers to gat coffee and of course pay for it.

Programmers will do the following to get coffee:
•    First gather information regarding which types of coffee are available (espresso, latte macchiato or cappuccino) and pick their personal favorite. This will take 0.5 seconds.
•    Second pay the coffee they want at the cash register using cash or credit. This will take 0.25 second for credit and 0.5 seconds for cash payments.
•    Third find a coffee machine and pick the type of coffee they paid for


The system allows:
•    10 programmers to pick their favorite type of coffee at the same time
•    5 programmers to pay their coffee at the same time
•    2 programmers to get their paid coffee from the machine at the same time


A programmer will do the following to get coffee from a coffee machine:
•    find a cup (0.25 seconds)
•    put it under the outlet (0.25 seconds)
•    pick the type of coffee the programmer paid (0.25 seconds)
•    wait till the machine is finished filling the cup (This will take 0.25 second for espresso, 0.5 seconds for latte macchiato and 0.75 seconds for cappuccino.)
•    when the machine is done the programmer will take her cup and leave (0.25 seconds)

Measure the following things using 100 programmers:
•    how much coffee is sold (total and per payment type)
•    how much coffee is dispensed by each coffee machine (total and per type of coffee)
•    how much time does the average programmer spend getting her coffee
•    how long did it take the fastest and the slowest programmer to get her coffee


Challenge it with 200, 500 and 1000 programmers.








Автор: a0730 20.10.2015, 14:04
Количество автоматов любое.
Начните с десяти.
Десять автоматов - это 10 мин в очереди для самой тормознутой программистки.


Этот ответ добавлен с нового Винграда - http://ru.vingrad.com/Interesnaya-zadachka-id562536adae20159f3f8b4567#findElement_E7045_56261fa7ae2015695304768a_0

Автор: Mirkes 27.10.2015, 20:10
Я не совсем понял условие: две программистки могут забрать свой кофе одновременно из одной машины? Или в целом по системе? Если в целом по системе, то всего две машины. Если из каждой, то все гораздо интереснее.
Мы можем играть числом машин от 1 до числа программисток и более. Кроме того не указано, как часто программистки хотят кофе и хотят ли они его одновременно, по очереди или в случайный момент времени.

Так что задача настолько плохо поставлена, что ответ можно выбирать произвольно.

Этот ответ добавлен с нового Винграда - http://ru.vingrad.com/Interesnaya-zadachka-id562536adae20159f3f8b4567#findElement_E7045_562fb016ae201540788870a9_0

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)