“Even more pizza” is the new practice problem proposed for the Hash code 2021 challenge.
The Hash Code challenge gets more and more attendants every year and I like particularly because it involves – of course – coding, logic, mathematics, and a deep knowledge of algorithms and data structures. In addition, a good dose of team-working is very important. These are all ingredients that are fundamental when working at any IT Company.
Last year, Google has proposed – IMHO – a very simple problem (see my previous article on the Pizza problem – Google Hash Code 2020). Instead, this year the Google Hash Code team has proposed a practice problem that is very close – as complexity – to the qualification challenges.
#Even More Pizza: the problem description
Each pizza has different ingredients and it is very important to deliver a pizza to each member of a team.
A specific pizza can be delivered to only one person: in other words, two persons cannot receive the same pizza.
At each Google Hash Code competition, there are T2 teams of 2 members, T3 teams of 3 members and T4 teams of 4 members.
#The input data
- M: the number of pizzas
- T2: the number of teams of 2 persons
- T3: the number of teams of 3 persons
- T4: the number of teams of 4 persons
| Scenario | M | T2 | T3 | T4 |
|---|---|---|---|---|
| A | 5 | 1 | 2 | 1 |
| B | 500 | 65 | 60 | 60 |
| C | 10000 | 504 | 539 | 585 |
| D | 100000 | 1696 | 3661 | 2742 |
| E | 100000 | 39748 | 49195 | 29832 |
| Scenario | Max num. of orders | Num. pizzas required to deliver orders to all the teams |
|---|---|---|
| A | 4 | 12 |
| B | 185 | 550 |
| C | 1628 | 4965 |
| D | 8099 | 25343 |
| E | 118775 | 346409 |

