Done day 15
[advent-of-code-15.git] / advent-of-code-15.html
1 <!DOCTYPE html>
2 <!-- saved from url=(0030)http://adventofcode.com/day/15 -->
3 <html lang="en-us"><script async="" src="http://www.google-analytics.com/analytics.js"></script><script type="text/javascript">window["_gaUserPrefs"] = { ioo : function() { return true; } }</script><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4 <meta charset="utf-8">
5 <title>Day 15 - Advent of Code</title>
6 <!--[if lt IE 9]><script src="/static/html5.js"></script><![endif]-->
7 <link href="./advent-of-code-15_files/css" rel="stylesheet" type="text/css">
8 <link rel="stylesheet" type="text/css" href="./advent-of-code-15_files/style.css">
9 <link rel="shortcut icon" href="http://adventofcode.com/favicon.ico?2">
10 <style type="text/css">:root .adsbygoogle
11 {display:none !important;}</style><style type="text/css"></style><style id="style-1-cropbar-clipper">/* Copyright 2014 Evernote Corporation. All rights reserved. */
12 .en-markup-crop-options {
13 top: 18px !important;
14 left: 50% !important;
15 margin-left: -100px !important;
16 width: 200px !important;
17 border: 2px rgba(255,255,255,.38) solid !important;
18 border-radius: 4px !important;
19 }
20
21 .en-markup-crop-options div div:first-of-type {
22 margin-left: 0px !important;
23 }
24 </style><link rel="stylesheet" type="text/css" href="chrome-extension://pkehgijcmpdhfbdbbnkijodmdjhbjlgp/skin/socialwidgets.css"></head><!--
25
26
27
28
29 Oh, hello! Funny seeing you here.
30
31 I appreciate your enthusiasm, but you aren't going to find much down here.
32 There certainly aren't clues to any of the puzzles. You do risk spoiling a few
33 surprises for yourself, though. Best to play the normal way and discover
34 everything as it was intended, I think. The best surprises don't even appear
35 in the source until you unlock them for real.
36
37 Please be careful with automated requests; I'm not Google, and I can only take
38 so much traffic. Please be considerate so that everyone gets to play.
39
40 If you're curious about how Advent of Code works, it's running on some custom
41 Perl code. Other than a few integrations (auth, analytics, ads, social media),
42 I built the whole thing myself, including the design, animations, prose, and
43 all of the puzzles.
44
45 The puzzles probably took the longest; the easiest ones were around 45 minutes
46 each, but the harder ones took 2-3 hours, some even longer than that. A lot of
47 effort went into building this thing - I hope you're enjoying playing it as
48 much as I enjoyed making it for you!
49
50 If you'd like to hang out, I'm @ericwastl on Twitter.
51
52 - Eric Wastl
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103 -->
104 <body>
105 <header><h1><a href="http://adventofcode.com/">Advent of Code</a></h1><div class="user">Neil Smith <span class="star-count">30*</span></div><nav><ul><li><a href="http://adventofcode.com/about">[About]</a></li><li><a href="http://adventofcode.com/stats">[Stats]</a></li><li><a href="http://adventofcode.com/leaderboard">[Leaderboard]</a></li><li><a href="http://adventofcode.com/settings">[Settings]</a></li><li><a href="http://adventofcode.com/auth/logout">[Log out]</a></li></ul></nav></header>
106
107 <div id="ad">
108 <script async="" src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
109 <!-- Advent of Code Wide Skyscraper -->
110 <ins class="adsbygoogle" style="width: 160px; height: 600px;" data-ad-client="ca-pub-9420604735624631" data-ad-slot="8014013294"></ins>
111 <script>
112 (adsbygoogle = window.adsbygoogle || []).push({});
113 </script>
114 </div><!--/ad-->
115
116 <main>
117 <article class="day-desc"><h2>--- Day 15: Science for Hungry People ---</h2><p>Today, you set out on the task of perfecting your milk-dunking cookie recipe. All you have to do is find the right balance of ingredients.</p>
118 <p>Your recipe leaves room for exactly <code>100</code> teaspoons of ingredients. You make a list of the <em>remaining ingredients you could use to finish the recipe</em> (your puzzle input) and their <em>properties per teaspoon</em>:</p>
119 <ul>
120 <li><code>capacity</code> (how well it helps the cookie absorb milk)</li>
121 <li><code>durability</code> (how well it keeps the cookie intact when full of milk)</li>
122 <li><code>flavor</code> (how tasty it makes the cookie)</li>
123 <li><code>texture</code> (how it improves the feel of the cookie)</li>
124 <li><code>calories</code> (how many calories it adds to the cookie)</li>
125 </ul>
126 <p>You can only measure ingredients in whole-teaspoon amounts accurately, and you have to be accurate so you can reproduce your results in the future. The <em>total score</em> of a cookie can be found by adding up each of the properties (negative totals become <code>0</code>) and then multiplying together everything except calories.</p>
127 <p>For instance, suppose you have <span title="* I know what your preference is, but...">these two ingredients</span>:</p>
128 <pre><code>Butterscotch: capacity -1, durability -2, flavor 6, texture 3, calories 8
129 Cinnamon: capacity 2, durability 3, flavor -2, texture -1, calories 3
130 </code></pre>
131 <p>Then, choosing to use <code>44</code> teaspoons of butterscotch and <code>56</code> teaspoons of cinnamon (because the amounts of each ingredient must add up to <code>100</code>) would result in a cookie with the following properties:</p>
132 <ul>
133 <li>A <code>capacity</code> of <code>44*-1 + 56*2 = 68</code></li>
134 <li>A <code>durability</code> of <code>44*-2 + 56*3 = 80</code></li>
135 <li>A <code>flavor</code> of <code>44*6 + 56*-2 = 152</code></li>
136 <li>A <code>texture</code> of <code>44*3 + 56*-1 = 76</code></li>
137 </ul>
138 <p>Multiplying these together (<code>68 * 80 * 152 * 76</code>, ignoring <code>calories</code> for now) results in a total score of <code>62842880</code>, which happens to be the best score possible given these ingredients. If any properties had produced a negative total, it would have instead become zero, causing the whole score to multiply to zero.</p>
139 <p>Given the ingredients in your kitchen and their properties, what is the <em>total score</em> of the highest-scoring cookie you can make?</p>
140 </article>
141 <p>Your puzzle answer was <code>18965440</code>.</p><article class="day-desc"><h2>--- Part Two ---</h2><p>Your cookie recipe becomes wildly popular! Someone asks if you can make another recipe that has exactly <code>500</code> calories per cookie (so they can use it as a meal replacement). Keep the rest of your award-winning process the same (100 teaspoons, same ingredients, same scoring system).</p>
142 <p>For example, given the ingredients above, if you had instead selected <code>40</code> teaspoons of butterscotch and <code>60</code> teaspoons of cinnamon (which still adds to <code>100</code>), the total calorie count would be <code>40*8 + 60*3 = 500</code>. The total score would go down, though: only <code>57600000</code>, the best you can do in such trying circumstances.</p>
143 <p>Given the ingredients in your kitchen and their properties, what is the <em>total score</em> of the highest-scoring cookie you can make with a calorie total of <code>500</code>?</p>
144 </article>
145 <p>Your puzzle answer was <code>15862900</code>.</p><p class="day-success">Both parts of this puzzle are complete! They provide two gold stars: **</p>
146 <p>At this point, you should <a href="http://adventofcode.com/">return to your advent calendar</a> and try another puzzle.</p>
147 <p>If you still want to see it, you can <a href="http://adventofcode.com/day/15/input" target="_blank">get your puzzle input</a>.</p>
148 <p>You can also <span class="share">[Share<span class="share-content">on
149 <a href="https://twitter.com/intent/tweet?text=I%27ve+completed+%22Science+for+Hungry+People%22+%2D+Day+15+%2D+Advent+of+Code&amp;url=http%3A%2F%2Fadventofcode%2Ecom%2Fday%2F15&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank" rel="noreferrer">Twitter</a>
150 <a href="https://plus.google.com/share?url=http%3A%2F%2Fadventofcode%2Ecom%2Fday%2F15" target="_blank" rel="noreferrer">Google+</a>
151 <a href="http://www.reddit.com/submit?url=http%3A%2F%2Fadventofcode%2Ecom%2Fday%2F15&amp;title=I%27ve+completed+%22Science+for+Hungry+People%22+%2D+Day+15+%2D+Advent+of+Code" target="_blank" rel="noreferrer">Reddit</a></span>]</span>
152 this puzzle.</p>
153 </main>
154
155 <!-- ga -->
156 <script>
157 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
158 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
159 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
160 })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
161 ga('create', 'UA-69522494-1', 'auto');
162 ga('send', 'pageview');
163 </script>
164 <!-- /ga -->
165
166
167 </body></html>