Merge branch 'master' of git.njae.me.uk:advent-of-code-16
[advent-of-code-16.git] / day11.html
1 <!DOCTYPE html>
2 <html lang="en-us">
3 <head>
4 <meta charset="utf-8"/>
5 <title>Day 11 - Advent of Code 2016</title>
6 <!--[if lt IE 9]><script src="/static/html5.js"></script><![endif]-->
7 <link href='//fonts.googleapis.com/css?family=Source+Code+Pro:300&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
8 <link rel="stylesheet" type="text/css" href="/static/style.css?9"/>
9 <link rel="shortcut icon" href="/favicon.ico?2"/>
10 </head><!--
11
12
13
14
15 Oh, hello! Funny seeing you here.
16
17 I appreciate your enthusiasm, but you aren't going to find much down here.
18 There certainly aren't clues to any of the puzzles. The best surprises don't
19 even appear in the source until you unlock them for real.
20
21 Please be careful with automated requests; I'm not Google, and I can only take
22 so much traffic. Please be considerate so that everyone gets to play.
23
24 If you're curious about how Advent of Code works, it's running on some custom
25 Perl code. Other than a few integrations (auth, analytics, ads, social media),
26 I built the whole thing myself, including the design, animations, prose, and
27 all of the puzzles.
28
29 The puzzles probably took the longest; the easiest ones were around 45 minutes
30 each, but the harder ones took 2-3 hours, and a few even longer than that. A
31 lot of effort went into building this thing - I hope you're enjoying playing it
32 as much as I enjoyed making it for you!
33
34 If you'd like to hang out, I'm @ericwastl on Twitter.
35
36 - Eric Wastl
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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 <body>
89 <header><div><h1 class="title-global"><a href="/">Advent of Code</a></h1><nav><ul><li><a href="/2016/about">[About]</a></li><li><a href="/2016/support">[AoC++]</a></li><li><a href="/2016/events">[Events]</a></li><li><a href="/2016/settings">[Settings]</a></li><li><a href="/2016/auth/logout">[Log Out]</a></li></ul></nav><div class="user">Neil Smith <span class="supporter">(AoC++)</span> <span class="star-count">22*</span></div></div><div><h1 class="title-event">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">/*</span><a href="/2016">2016</a><span class="title-event-wrap">*/</span></h1><nav><ul><li><a href="/2016">[Calendar]</a></li><li><a href="/2016/leaderboard">[Leaderboard]</a></li><li><a href="/2016/stats">[Stats]</a></li><li><a href="/2016/sponsors">[Sponsors]</a></li></ul></nav></div></header>
90
91 <div id="sidebar">
92 <div id="sponsor"><div class="quiet">Our <a href="/2016/sponsors">sponsors</a> help make AoC possible:</div><p><a href="http://www.novetta.com/careers/#opportunities" target="_blank" onclick="if(ga)ga('send','event','sponsor','click',this.href);">Novetta</a> - Unleash your imagination. Innovate at Novetta.</p></div>
93 <div id="ad">
94 <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
95 <!-- Advent of Code Wide Skyscraper -->
96 <ins class="adsbygoogle"
97 style="display:inline-block;width:160px;height:600px"
98 data-ad-client="ca-pub-9420604735624631"
99 data-ad-slot="8014013294"></ins>
100 <script>
101 (adsbygoogle = window.adsbygoogle || []).push({});
102 </script>
103 </div><!--/ad-->
104 </div><!--/sidebar-->
105
106 <main>
107 <article class="day-desc"><h2>--- Day 11: Radioisotope Thermoelectric Generators ---</h2><p>You come upon a column of four floors that have been entirely sealed off from the rest of the building except for a small dedicated lobby. There are some radiation warnings and a big sign which reads "Radioisotope Testing Facility".</p>
108 <p>According to the project status board, this facility is currently being used to experiment with <a href="https://en.wikipedia.org/wiki/Radioisotope_thermoelectric_generator">Radioisotope Thermoelectric Generators</a> (RTGs, or simply "generators") that are designed to be paired with specially-constructed microchips. Basically, an RTG is a highly radioactive rock that generates electricity through heat.</p>
109 <p>The <span title="The previous version, model number PB-NUK, used Blutonium.">experimental RTGs</span> have poor radiation containment, so they're dangerously radioactive. The chips are prototypes and don't have normal radiation shielding, but they do have the ability to <em>generate an elecromagnetic radiation shield when powered</em>. Unfortunately, they can <em>only</em> be powered by their corresponding RTG. An RTG powering a microchip is still dangerous to other microchips.</p>
110 <p>In other words, if a chip is ever left in the same area as another RTG, and it's not connected to its own RTG, the chip will be <em>fried</em>. Therefore, it is assumed that you will follow procedure and keep chips connected to their corresponding RTG when they're in the same room, and away from other RTGs otherwise.</p>
111 <p>These microchips sound very interesting and useful to your current activities, and you'd like to try to retrieve them. The fourth floor of the facility has an assembling machine which can make a self-contained, shielded computer for you to take with you - that is, if you can bring it all of the RTGs and microchips.</p>
112 <p>Within the radiation-shielded part of the facility (in which it's safe to have these pre-assembly RTGs), there is an elevator that can move between the four floors. Its capacity rating means it can carry at most yourself and two RTGs or microchips in any combination. (They're rigged to some heavy diagnostic equipment - the assembling machine will detach it for you.) As a security measure, the elevator will only function if it contains at least one RTG or microchip. The elevator always stops on each floor to recharge, and this takes long enough that the items within it and the items on that floor can irradiate each other. (You can prevent this if a Microchip and its Generator end up on the same floor in this way, as they can be connected while the elevator is recharging.)</p>
113 <p>You make some notes of the locations of each component of interest (your puzzle input). Before you don a hazmat suit and start moving things around, you'd like to have an idea of what you need to do.</p>
114 <p>When you enter the containment area, you and the elevator will start on the first floor.</p>
115 <p>For example, suppose the isolated area has the following arrangement:</p>
116 <pre class="wrap"><code>The first floor contains a hydrogen-compatible microchip and a lithium-compatible microchip.
117 The second floor contains a hydrogen generator.
118 The third floor contains a lithium generator.
119 The fourth floor contains nothing relevant.
120 </code></pre>
121 <p>As a diagram (<code>F#</code> for a Floor number, <code>E</code> for Elevator, <code>H</code> for Hydrogen, <code>L</code> for Lithium, <code>M</code> for Microchip, and <code>G</code> for Generator), the initial state looks like this:</p>
122 <pre><code>F4 . . . . .
123 F3 . . . LG .
124 F2 . HG . . .
125 F1 E . HM . LM
126 </code></pre>
127 <p>Then, to get everything up to the assembling machine on the fourth floor, the following steps could be taken:</p>
128 <ul>
129 <li><p>Bring the Hydrogen-compatible Microchip to the second floor, which is safe because it can get power from the Hydrogen Generator:</p><pre><code>F4 . . . . .
130 F3 . . . LG .
131 F2 E HG HM . .
132 F1 . . . . LM
133 </code></pre></li>
134 <li><p>Bring both Hydrogen-related items to the third floor, which is safe because the Hydrogen-compatible microchip is getting power from its generator:</p><pre><code>F4 . . . . .
135 F3 E HG HM LG .
136 F2 . . . . .
137 F1 . . . . LM
138 </code></pre></li>
139 <li><p>Leave the Hydrogen Generator on floor three, but bring the Hydrogen-compatible Microchip back down with you so you can still use the elevator:</p><pre><code>F4 . . . . .
140 F3 . HG . LG .
141 F2 E . HM . .
142 F1 . . . . LM
143 </code></pre></li>
144 <li><p>At the first floor, grab the Lithium-compatible Microchip, which is safe because Microchips don't affect each other:</p><pre><code>F4 . . . . .
145 F3 . HG . LG .
146 F2 . . . . .
147 F1 E . HM . LM
148 </code></pre></li>
149 <li><p>Bring both Microchips up one floor, where there is nothing to fry them:</p><pre><code>F4 . . . . .
150 F3 . HG . LG .
151 F2 E . HM . LM
152 F1 . . . . .
153 </code></pre></li>
154 <li><p>Bring both Microchips up again to floor three, where they can be temporarily connected to their corresponding generators while the elevator recharges, preventing either of them from being fried:</p><pre><code>F4 . . . . .
155 F3 E HG HM LG LM
156 F2 . . . . .
157 F1 . . . . .
158 </code></pre></li>
159 <li><p>Bring both Microchips to the fourth floor:</p><pre><code>F4 E . HM . LM
160 F3 . HG . LG .
161 F2 . . . . .
162 F1 . . . . .
163 </code></pre></li>
164 <li><p>Leave the Lithium-compatible microchip on the fourth floor, but bring the Hydrogen-compatible one so you can still use the elevator; this is safe because although the Lithium Generator is on the destination floor, you can connect Hydrogen-compatible microchip to the Hydrogen Generator there:</p><pre><code>F4 . . . . LM
165 F3 E HG HM LG .
166 F2 . . . . .
167 F1 . . . . .
168 </code></pre></li>
169 <li><p>Bring both Generators up to the fourth floor, which is safe because you can connect the Lithium-compatible Microchip to the Lithium Generator upon arrival:</p><pre><code>F4 E HG . LG LM
170 F3 . . HM . .
171 F2 . . . . .
172 F1 . . . . .
173 </code></pre></li>
174 <li><p>Bring the Lithium Microchip with you to the third floor so you can use the elevator:</p><pre><code>F4 . HG . LG .
175 F3 E . HM . LM
176 F2 . . . . .
177 F1 . . . . .
178 </code></pre></li>
179 <li><p>Bring both Microchips to the fourth floor:</p><pre><code>F4 E HG HM LG LM
180 F3 . . . . .
181 F2 . . . . .
182 F1 . . . . .
183 </code></pre></li>
184 </ul>
185 <p>In this arrangement, it takes <code>11</code> steps to collect all of the objects at the fourth floor for assembly. (Each elevator stop counts as one step, even if nothing is added to or removed from it.)</p>
186 <p>In your situation, what is the <em>minimum number of steps</em> required to bring all of the objects to the fourth floor?</p>
187 </article>
188 <p>Your puzzle answer was <code>47</code>.</p><article class="day-desc"><h2>--- Part Two ---</h2><p>You step into the cleanroom separating the lobby from the isolated area and put on the hazmat suit.</p>
189 <p>Upon entering the isolated containment area, however, you notice some extra parts on the first floor that weren't listed on the record outside:</p>
190 <ul>
191 <li>An elerium generator.</li>
192 <li>An elerium-compatible microchip.</li>
193 <li>A dilithium generator.</li>
194 <li>A dilithium-compatible microchip.</li>
195 </ul>
196 <p>These work just like the other generators and microchips. You'll have to get them up to assembly as well.</p>
197 <p>What is the <em>minimum number of steps</em> required to bring all of the objects, including these four new ones, to the fourth floor?</p>
198 </article>
199 <p>Your puzzle answer was <code>71</code>.</p><p class="day-success">Both parts of this puzzle are complete! They provide two gold stars: **</p>
200 <p>At this point, you should <a href="/2016">return to your advent calendar</a> and try another puzzle.</p>
201 <p>If you still want to see it, you can <a href="11/input" target="_blank">get your puzzle input</a>.</p>
202 <p>You can also <span class="share">[Share<span class="share-content">on
203 <a href="https://twitter.com/intent/tweet?text=I%27ve+completed+%22Radioisotope+Thermoelectric+Generators%22+%2D+Day+11+%2D+Advent+of+Code+2016&amp;url=http%3A%2F%2Fadventofcode%2Ecom%2F2016%2Fday%2F11&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank">Twitter</a>
204 <a href="https://plus.google.com/share?url=http%3A%2F%2Fadventofcode%2Ecom%2F2016%2Fday%2F11" target="_blank">Google+</a>
205 <a href="http://www.reddit.com/submit?url=http%3A%2F%2Fadventofcode%2Ecom%2F2016%2Fday%2F11&amp;title=I%27ve+completed+%22Radioisotope+Thermoelectric+Generators%22+%2D+Day+11+%2D+Advent+of+Code+2016" target="_blank">Reddit</a
206 ></span>]</span> this puzzle.</p>
207 </main>
208
209 <!-- ga -->
210 <script>
211 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
212 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
213 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
214 })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
215 ga('create', 'UA-69522494-1', 'auto');
216 ga('send', 'pageview');
217 </script>
218 <!-- /ga -->
219 </body>
220 </html>