Done day 15
[advent-of-code-15.git] / advent-of-code-15.html
diff --git a/advent-of-code-15.html b/advent-of-code-15.html
new file mode 100644 (file)
index 0000000..fa2a1cc
--- /dev/null
@@ -0,0 +1,167 @@
+<!DOCTYPE html>
+<!-- saved from url=(0030)http://adventofcode.com/day/15 -->
+<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">
+<meta charset="utf-8">
+<title>Day 15 - Advent of Code</title>
+<!--[if lt IE 9]><script src="/static/html5.js"></script><![endif]-->
+<link href="./advent-of-code-15_files/css" rel="stylesheet" type="text/css">
+<link rel="stylesheet" type="text/css" href="./advent-of-code-15_files/style.css">
+<link rel="shortcut icon" href="http://adventofcode.com/favicon.ico?2">
+<style type="text/css">:root .adsbygoogle
+{display:none !important;}</style><style type="text/css"></style><style id="style-1-cropbar-clipper">/* Copyright 2014 Evernote Corporation. All rights reserved. */
+.en-markup-crop-options {
+    top: 18px !important;
+    left: 50% !important;
+    margin-left: -100px !important;
+    width: 200px !important;
+    border: 2px rgba(255,255,255,.38) solid !important;
+    border-radius: 4px !important;
+}
+
+.en-markup-crop-options div div:first-of-type {
+    margin-left: 0px !important;
+}
+</style><link rel="stylesheet" type="text/css" href="chrome-extension://pkehgijcmpdhfbdbbnkijodmdjhbjlgp/skin/socialwidgets.css"></head><!--
+
+
+
+
+Oh, hello!  Funny seeing you here.
+
+I appreciate your enthusiasm, but you aren't going to find much down here.
+There certainly aren't clues to any of the puzzles.  You do risk spoiling a few
+surprises for yourself, though.  Best to play the normal way and discover
+everything as it was intended, I think.  The best surprises don't even appear
+in the source until you unlock them for real.
+
+Please be careful with automated requests; I'm not Google, and I can only take
+so much traffic.  Please be considerate so that everyone gets to play.
+
+If you're curious about how Advent of Code works, it's running on some custom
+Perl code. Other than a few integrations (auth, analytics, ads, social media),
+I built the whole thing myself, including the design, animations, prose, and
+all of the puzzles.
+
+The puzzles probably took the longest; the easiest ones were around 45 minutes
+each, but the harder ones took 2-3 hours, some even longer than that. A lot of
+effort went into building this thing - I hope you're enjoying playing it as
+much as I enjoyed making it for you!
+
+If you'd like to hang out, I'm @ericwastl on Twitter.
+
+- Eric Wastl
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+-->
+<body>
+<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>
+
+<div id="ad">
+<script async="" src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
+<!-- Advent of Code Wide Skyscraper -->
+<ins class="adsbygoogle" style="width: 160px; height: 600px;" data-ad-client="ca-pub-9420604735624631" data-ad-slot="8014013294"></ins>
+<script>
+(adsbygoogle = window.adsbygoogle || []).push({});
+</script>
+</div><!--/ad-->
+
+<main>
+<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>
+<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>
+<ul>
+<li><code>capacity</code> (how well it helps the cookie absorb milk)</li>
+<li><code>durability</code> (how well it keeps the cookie intact when full of milk)</li>
+<li><code>flavor</code> (how tasty it makes the cookie)</li>
+<li><code>texture</code> (how it improves the feel of the cookie)</li>
+<li><code>calories</code> (how many calories it adds to the cookie)</li>
+</ul>
+<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>
+<p>For instance, suppose you have <span title="* I know what your preference is, but...">these two ingredients</span>:</p>
+<pre><code>Butterscotch: capacity -1, durability -2, flavor 6, texture 3, calories 8
+Cinnamon: capacity 2, durability 3, flavor -2, texture -1, calories 3
+</code></pre>
+<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>
+<ul>
+<li>A <code>capacity</code> of <code>44*-1 + 56*2 = 68</code></li>
+<li>A <code>durability</code> of <code>44*-2 + 56*3 = 80</code></li>
+<li>A <code>flavor</code> of <code>44*6 + 56*-2 = 152</code></li>
+<li>A <code>texture</code> of <code>44*3 + 56*-1 = 76</code></li>
+</ul>
+<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>
+<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>
+</article>
+<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>
+<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>
+<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>
+</article>
+<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>
+<p>At this point, you should <a href="http://adventofcode.com/">return to your advent calendar</a> and try another puzzle.</p>
+<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>
+<p>You can also <span class="share">[Share<span class="share-content">on
+  <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>
+  <a href="https://plus.google.com/share?url=http%3A%2F%2Fadventofcode%2Ecom%2Fday%2F15" target="_blank" rel="noreferrer">Google+</a>
+  <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>
+ this puzzle.</p>
+</main>
+
+<!-- ga -->
+<script>
+(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+ga('create', 'UA-69522494-1', 'auto');
+ga('send', 'pageview');
+</script>
+<!-- /ga -->
+
+
+</body></html>
\ No newline at end of file