adventofcode/2015/day17/problem

55 lines
1.8 KiB
Plaintext
Raw Normal View History

2018-03-15 16:24:23 +00:00
Advent of Code
2016-12-16 22:21:15 +00:00
--- Day 17: No Such Thing as Too Much ---
2018-03-15 16:24:23 +00:00
The elves bought too much eggnog again - 150 liters this time. To fit it all
into your refrigerator, you'll need to move it into smaller containers. You
take an inventory of the capacities of the available containers.
2016-12-16 22:21:15 +00:00
2018-03-15 16:24:23 +00:00
For example, suppose you have containers of size 20, 15, 10, 5, and 5
liters. If you need to store 25 liters, there are four ways to do it:
2016-12-16 22:21:15 +00:00
 15 and 10
 20 and 5 (the first 5)
 20 and 5 (the second 5)
 15, 5, and 5
2018-03-15 16:24:23 +00:00
Filling all containers entirely, how many different combinations of
containers can exactly fit all 150 liters of eggnog?
2016-12-16 22:21:15 +00:00
Your puzzle answer was 1304.
--- Part Two ---
2018-03-15 16:24:23 +00:00
While playing with all the containers in the kitchen, another load of eggnog
arrives! The shipping and receiving department is requesting as many
containers as you can spare.
2016-12-16 22:21:15 +00:00
2018-03-15 16:24:23 +00:00
Find the minimum number of containers that can exactly fit all 150 liters of
eggnog. How many different ways can you fill that number of containers and
still hold exactly 150 litres?
2016-12-16 22:21:15 +00:00
2018-03-15 16:24:23 +00:00
In the example above, the minimum number of containers was two. There were
three ways to use that many containers, and so the answer there would be 3.
2016-12-16 22:21:15 +00:00
Your puzzle answer was 18.
Both parts of this puzzle are complete! They provide two gold stars: **
2018-03-15 16:24:23 +00:00
At this point, you should return to your advent calendar and try another
puzzle.
2016-12-16 22:21:15 +00:00
If you still want to see it, you can get your puzzle input.
References
Visible links
. http://adventofcode.com/
. http://adventofcode.com/about
. http://adventofcode.com/stats
. http://adventofcode.com/leaderboard
. http://adventofcode.com/settings
. http://adventofcode.com/auth/logout
. http://adventofcode.com/
. http://adventofcode.com/day/17/input