removed all aoc copywrite
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,49 +0,0 @@
|
|||||||
# Day 1 Puzzle Text.
|
|
||||||
|
|
||||||
--- Day 1: Calorie Counting ---
|
|
||||||
Santa's reindeer typically eat regular reindeer food, but they need a lot of magical energy to deliver presents on Christmas. For that, their favorite snack is a special type of star fruit that only grows deep in the jungle. The Elves have brought you on their annual expedition to the grove where the fruit grows.
|
|
||||||
|
|
||||||
To supply enough magical energy, the expedition needs to retrieve a minimum of fifty stars by December 25th. Although the Elves assure you that the grove has plenty of fruit, you decide to grab any fruit you see along the way, just in case.
|
|
||||||
|
|
||||||
Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!
|
|
||||||
|
|
||||||
The jungle must be too overgrown and difficult to navigate in vehicles or access from the air; the Elves' expedition traditionally goes on foot. As your boats approach land, the Elves begin taking inventory of their supplies. One important consideration is food - in particular, the number of Calories each Elf is carrying (your puzzle input).
|
|
||||||
|
|
||||||
The Elves take turns writing down the number of Calories contained by the various meals, snacks, rations, etc. that they've brought with them, one item per line. Each Elf separates their own inventory from the previous Elf's inventory (if any) by a blank line.
|
|
||||||
|
|
||||||
For example, suppose the Elves finish writing their items' Calories and end up with the following list:
|
|
||||||
```
|
|
||||||
1000
|
|
||||||
2000
|
|
||||||
3000
|
|
||||||
|
|
||||||
4000
|
|
||||||
|
|
||||||
5000
|
|
||||||
6000
|
|
||||||
|
|
||||||
7000
|
|
||||||
8000
|
|
||||||
9000
|
|
||||||
|
|
||||||
10000
|
|
||||||
```
|
|
||||||
This list represents the Calories of the food carried by five Elves:
|
|
||||||
|
|
||||||
The first Elf is carrying food with 1000, 2000, and 3000 Calories, a total of 6000 Calories.
|
|
||||||
The second Elf is carrying one food item with 4000 Calories.
|
|
||||||
The third Elf is carrying food with 5000 and 6000 Calories, a total of 11000 Calories.
|
|
||||||
The fourth Elf is carrying food with 7000, 8000, and 9000 Calories, a total of 24000 Calories.
|
|
||||||
The fifth Elf is carrying one food item with 10000 Calories.
|
|
||||||
In case the Elves get hungry and need extra snacks, they need to know which Elf to ask: they'd like to know how many Calories are being carried by the Elf carrying the most Calories. In the example above, this is 24000 (carried by the fourth Elf).
|
|
||||||
|
|
||||||
Find the Elf carrying the most Calories. How many total Calories is that Elf carrying?
|
|
||||||
|
|
||||||
--- Part Two ---
|
|
||||||
By the time you calculate the answer to the Elves' question, they've already realized that the Elf carrying the most Calories of food might eventually run out of snacks.
|
|
||||||
|
|
||||||
To avoid this unacceptable situation, the Elves would instead like to know the total Calories carried by the top three Elves carrying the most Calories. That way, even if one of those Elves runs out of snacks, they still have two backups.
|
|
||||||
|
|
||||||
In the example above, the top three Elves are the fourth Elf (with 24000 Calories), then the third Elf (with 11000 Calories), then the fifth Elf (with 10000 Calories). The sum of the Calories carried by these three elves is 45000.
|
|
||||||
|
|
||||||
Find the top three Elves carrying the most Calories. How many Calories are those Elves carrying in total?
|
|
||||||
@@ -1,140 +0,0 @@
|
|||||||
addx 1
|
|
||||||
addx 4
|
|
||||||
addx -2
|
|
||||||
addx 3
|
|
||||||
addx 3
|
|
||||||
addx 1
|
|
||||||
noop
|
|
||||||
addx 5
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 5
|
|
||||||
addx 2
|
|
||||||
addx 3
|
|
||||||
noop
|
|
||||||
addx 2
|
|
||||||
addx 4
|
|
||||||
noop
|
|
||||||
addx -1
|
|
||||||
noop
|
|
||||||
addx 3
|
|
||||||
addx -10
|
|
||||||
addx -17
|
|
||||||
noop
|
|
||||||
addx -3
|
|
||||||
addx 2
|
|
||||||
addx 25
|
|
||||||
addx -24
|
|
||||||
addx 2
|
|
||||||
addx 5
|
|
||||||
addx 2
|
|
||||||
addx 3
|
|
||||||
noop
|
|
||||||
addx 2
|
|
||||||
addx 14
|
|
||||||
addx -9
|
|
||||||
noop
|
|
||||||
addx 5
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx -2
|
|
||||||
addx 5
|
|
||||||
addx 2
|
|
||||||
addx -5
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx -19
|
|
||||||
addx -11
|
|
||||||
addx 5
|
|
||||||
addx 3
|
|
||||||
noop
|
|
||||||
addx 2
|
|
||||||
addx 3
|
|
||||||
addx -2
|
|
||||||
addx 2
|
|
||||||
noop
|
|
||||||
addx 3
|
|
||||||
addx 4
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 5
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 5
|
|
||||||
addx -3
|
|
||||||
addx 8
|
|
||||||
noop
|
|
||||||
addx -15
|
|
||||||
noop
|
|
||||||
addx -12
|
|
||||||
addx -9
|
|
||||||
noop
|
|
||||||
addx 6
|
|
||||||
addx 7
|
|
||||||
addx -6
|
|
||||||
addx 4
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 4
|
|
||||||
addx 1
|
|
||||||
addx 5
|
|
||||||
addx -11
|
|
||||||
addx 29
|
|
||||||
addx -15
|
|
||||||
noop
|
|
||||||
addx -12
|
|
||||||
addx 17
|
|
||||||
addx 7
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx -32
|
|
||||||
addx 3
|
|
||||||
addx -8
|
|
||||||
addx 7
|
|
||||||
noop
|
|
||||||
addx -2
|
|
||||||
addx 5
|
|
||||||
addx 2
|
|
||||||
addx 6
|
|
||||||
addx -8
|
|
||||||
addx 5
|
|
||||||
addx 2
|
|
||||||
addx 5
|
|
||||||
addx 17
|
|
||||||
addx -12
|
|
||||||
addx -2
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 7
|
|
||||||
addx 9
|
|
||||||
addx -8
|
|
||||||
addx 2
|
|
||||||
addx -33
|
|
||||||
addx -1
|
|
||||||
addx 2
|
|
||||||
noop
|
|
||||||
addx 26
|
|
||||||
addx -22
|
|
||||||
addx 19
|
|
||||||
addx -16
|
|
||||||
addx 8
|
|
||||||
addx -1
|
|
||||||
addx 3
|
|
||||||
addx -2
|
|
||||||
addx 2
|
|
||||||
addx -17
|
|
||||||
addx 24
|
|
||||||
addx 1
|
|
||||||
noop
|
|
||||||
addx 5
|
|
||||||
addx -1
|
|
||||||
noop
|
|
||||||
addx 5
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 1
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
@@ -1,184 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 10: Cathode-Ray Tube ---</h2><p>You avoid the ropes, plunge into the river, and swim to shore.</p>
|
|
||||||
<p>The Elves yell something about meeting back up with them upriver, but the river is too loud to tell exactly what they're saying. They finish crossing the bridge and disappear from view.</p>
|
|
||||||
<p>Situations like this must be why the Elves prioritized getting the communication system on your handheld device working. You pull it out of your pack, but the amount of water slowly draining from a big crack in its screen tells you it probably won't be of much immediate use.</p>
|
|
||||||
<p><em>Unless</em>, that is, you can design a replacement for the device's video system! It seems to be some kind of <a href="https://en.wikipedia.org/wiki/Cathode-ray_tube" target="_blank">cathode-ray tube</a> screen and simple CPU that are both driven by a precise <em>clock circuit</em>. The clock circuit ticks at a constant rate; each tick is called a <em>cycle</em>.</p>
|
|
||||||
<p>Start by figuring out the signal being sent by the CPU. The CPU has a single register, <code>X</code>, which starts with the value <code>1</code>. It supports only two instructions:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>addx V</code> takes <em>two cycles</em> to complete. <em>After</em> two cycles, the <code>X</code> register is increased by the value <code>V</code>. (<code>V</code> can be negative.)</li>
|
|
||||||
<li><code>noop</code> takes <em>one cycle</em> to complete. It has no other effect.</li>
|
|
||||||
</ul>
|
|
||||||
<p>The CPU uses these instructions in a program (your puzzle input) to, somehow, tell the screen what to draw.</p>
|
|
||||||
<p>Consider the following small program:</p>
|
|
||||||
<pre><code>noop
|
|
||||||
addx 3
|
|
||||||
addx -5
|
|
||||||
</code></pre>
|
|
||||||
<p>Execution of this program proceeds as follows:</p>
|
|
||||||
<ul>
|
|
||||||
<li>At the start of the first cycle, the <code>noop</code> instruction begins execution. During the first cycle, <code>X</code> is <code>1</code>. After the first cycle, the <code>noop</code> instruction finishes execution, doing nothing.</li>
|
|
||||||
<li>At the start of the second cycle, the <code>addx 3</code> instruction begins execution. During the second cycle, <code>X</code> is still <code>1</code>.</li>
|
|
||||||
<li>During the third cycle, <code>X</code> is still <code>1</code>. After the third cycle, the <code>addx 3</code> instruction finishes execution, setting <code>X</code> to <code>4</code>.</li>
|
|
||||||
<li>At the start of the fourth cycle, the <code>addx -5</code> instruction begins execution. During the fourth cycle, <code>X</code> is still <code>4</code>.</li>
|
|
||||||
<li>During the fifth cycle, <code>X</code> is still <code>4</code>. After the fifth cycle, the <code>addx -5</code> instruction finishes execution, setting <code>X</code> to <code>-1</code>.</li>
|
|
||||||
</ul>
|
|
||||||
<p>Maybe you can learn something by looking at the value of the <code>X</code> register throughout execution. For now, consider the <em>signal strength</em> (the cycle number multiplied by the value of the <code>X</code> register) <em>during</em> the 20th cycle and every 40 cycles after that (that is, during the 20th, 60th, 100th, 140th, 180th, and 220th cycles).</p>
|
|
||||||
<p>For example, consider this larger program:</p>
|
|
||||||
<pre><code>addx 15
|
|
||||||
addx -11
|
|
||||||
addx 6
|
|
||||||
addx -3
|
|
||||||
addx 5
|
|
||||||
addx -1
|
|
||||||
addx -8
|
|
||||||
addx 13
|
|
||||||
addx 4
|
|
||||||
noop
|
|
||||||
addx -1
|
|
||||||
addx 5
|
|
||||||
addx -1
|
|
||||||
addx 5
|
|
||||||
addx -1
|
|
||||||
addx 5
|
|
||||||
addx -1
|
|
||||||
addx 5
|
|
||||||
addx -1
|
|
||||||
addx -35
|
|
||||||
addx 1
|
|
||||||
addx 24
|
|
||||||
addx -19
|
|
||||||
addx 1
|
|
||||||
addx 16
|
|
||||||
addx -11
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 21
|
|
||||||
addx -15
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx -3
|
|
||||||
addx 9
|
|
||||||
addx 1
|
|
||||||
addx -3
|
|
||||||
addx 8
|
|
||||||
addx 1
|
|
||||||
addx 5
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx -36
|
|
||||||
noop
|
|
||||||
addx 1
|
|
||||||
addx 7
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 2
|
|
||||||
addx 6
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 1
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 7
|
|
||||||
addx 1
|
|
||||||
noop
|
|
||||||
addx -13
|
|
||||||
addx 13
|
|
||||||
addx 7
|
|
||||||
noop
|
|
||||||
addx 1
|
|
||||||
addx -33
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 2
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 8
|
|
||||||
noop
|
|
||||||
addx -1
|
|
||||||
addx 2
|
|
||||||
addx 1
|
|
||||||
noop
|
|
||||||
addx 17
|
|
||||||
addx -9
|
|
||||||
addx 1
|
|
||||||
addx 1
|
|
||||||
addx -3
|
|
||||||
addx 11
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 1
|
|
||||||
noop
|
|
||||||
addx 1
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx -13
|
|
||||||
addx -19
|
|
||||||
addx 1
|
|
||||||
addx 3
|
|
||||||
addx 26
|
|
||||||
addx -30
|
|
||||||
addx 12
|
|
||||||
addx -1
|
|
||||||
addx 3
|
|
||||||
addx 1
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx -9
|
|
||||||
addx 18
|
|
||||||
addx 1
|
|
||||||
addx 2
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 9
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx -1
|
|
||||||
addx 2
|
|
||||||
addx -37
|
|
||||||
addx 1
|
|
||||||
addx 3
|
|
||||||
noop
|
|
||||||
addx 15
|
|
||||||
addx -21
|
|
||||||
addx 22
|
|
||||||
addx -6
|
|
||||||
addx 1
|
|
||||||
noop
|
|
||||||
addx 2
|
|
||||||
addx 1
|
|
||||||
noop
|
|
||||||
addx -10
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
addx 20
|
|
||||||
addx 1
|
|
||||||
addx 2
|
|
||||||
addx 2
|
|
||||||
addx -6
|
|
||||||
addx -11
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
noop
|
|
||||||
</code></pre>
|
|
||||||
<p>The interesting signal strengths can be determined as follows:</p>
|
|
||||||
<ul>
|
|
||||||
<li>During the 20th cycle, register <code>X</code> has the value <code>21</code>, so the signal strength is 20 * 21 = <em>420</em>. (The 20th cycle occurs in the middle of the second <code>addx -1</code>, so the value of register <code>X</code> is the starting value, <code>1</code>, plus all of the other <code>addx</code> values up to that point: 1 + 15 - 11 + 6 - 3 + 5 - 1 - 8 + 13 + 4 = 21.)</li>
|
|
||||||
<li>During the 60th cycle, register <code>X</code> has the value <code>19</code>, so the signal strength is 60 * 19 = <code><em>1140</em></code>.</li>
|
|
||||||
<li>During the 100th cycle, register <code>X</code> has the value <code>18</code>, so the signal strength is 100 * 18 = <code><em>1800</em></code>.</li>
|
|
||||||
<li>During the 140th cycle, register <code>X</code> has the value <code>21</code>, so the signal strength is 140 * 21 = <code><em>2940</em></code>.</li>
|
|
||||||
<li>During the 180th cycle, register <code>X</code> has the value <code>16</code>, so the signal strength is 180 * 16 = <code><em>2880</em></code>.</li>
|
|
||||||
<li>During the 220th cycle, register <code>X</code> has the value <code>18</code>, so the signal strength is 220 * 18 = <code><em>3960</em></code>.</li>
|
|
||||||
</ul>
|
|
||||||
<p>The sum of these signal strengths is <code><em>13140</em></code>.</p>
|
|
||||||
<p>Find the signal strength during the 20th, 60th, 100th, 140th, 180th, and 220th cycles. <em>What is the sum of these six signal strengths?</em></p>
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
Monkey 0:
|
|
||||||
Starting items: 59, 74, 65, 86
|
|
||||||
Operation: new = old * 19
|
|
||||||
Test: divisible by 7
|
|
||||||
If true: throw to monkey 6
|
|
||||||
If false: throw to monkey 2
|
|
||||||
|
|
||||||
Monkey 1:
|
|
||||||
Starting items: 62, 84, 72, 91, 68, 78, 51
|
|
||||||
Operation: new = old + 1
|
|
||||||
Test: divisible by 2
|
|
||||||
If true: throw to monkey 2
|
|
||||||
If false: throw to monkey 0
|
|
||||||
|
|
||||||
Monkey 2:
|
|
||||||
Starting items: 78, 84, 96
|
|
||||||
Operation: new = old + 8
|
|
||||||
Test: divisible by 19
|
|
||||||
If true: throw to monkey 6
|
|
||||||
If false: throw to monkey 5
|
|
||||||
|
|
||||||
Monkey 3:
|
|
||||||
Starting items: 97, 86
|
|
||||||
Operation: new = old * old
|
|
||||||
Test: divisible by 3
|
|
||||||
If true: throw to monkey 1
|
|
||||||
If false: throw to monkey 0
|
|
||||||
|
|
||||||
Monkey 4:
|
|
||||||
Starting items: 50
|
|
||||||
Operation: new = old + 6
|
|
||||||
Test: divisible by 13
|
|
||||||
If true: throw to monkey 3
|
|
||||||
If false: throw to monkey 1
|
|
||||||
|
|
||||||
Monkey 5:
|
|
||||||
Starting items: 73, 65, 69, 65, 51
|
|
||||||
Operation: new = old * 17
|
|
||||||
Test: divisible by 11
|
|
||||||
If true: throw to monkey 4
|
|
||||||
If false: throw to monkey 7
|
|
||||||
|
|
||||||
Monkey 6:
|
|
||||||
Starting items: 69, 82, 97, 93, 82, 84, 58, 63
|
|
||||||
Operation: new = old + 5
|
|
||||||
Test: divisible by 5
|
|
||||||
If true: throw to monkey 5
|
|
||||||
If false: throw to monkey 7
|
|
||||||
|
|
||||||
Monkey 7:
|
|
||||||
Starting items: 81, 78, 82, 76, 79, 80
|
|
||||||
Operation: new = old + 3
|
|
||||||
Test: divisible by 17
|
|
||||||
If true: throw to monkey 3
|
|
||||||
If false: throw to monkey 4
|
|
||||||
@@ -1,208 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 11: Monkey in the Middle ---</h2><p>As you finally start making your way upriver, you realize your pack is much lighter than you remember. Just then, one of the items from your pack goes flying overhead. Monkeys are playing <a href="https://en.wikipedia.org/wiki/Keep_away" target="_blank">Keep Away</a> with your missing things!</p>
|
|
||||||
<p>To get your stuff back, you need to be able to predict where the monkeys will throw your items. After some careful observation, you realize the monkeys operate based on <em>how worried you are about each item</em>.</p>
|
|
||||||
<p>You take some notes (your puzzle input) on the items each monkey currently has, how worried you are about those items, and how the monkey makes decisions based on your worry level. For example:</p>
|
|
||||||
<pre><code>Monkey 0:
|
|
||||||
Starting items: 79, 98
|
|
||||||
Operation: new = old * 19
|
|
||||||
Test: divisible by 23
|
|
||||||
If true: throw to monkey 2
|
|
||||||
If false: throw to monkey 3
|
|
||||||
|
|
||||||
Monkey 1:
|
|
||||||
Starting items: 54, 65, 75, 74
|
|
||||||
Operation: new = old + 6
|
|
||||||
Test: divisible by 19
|
|
||||||
If true: throw to monkey 2
|
|
||||||
If false: throw to monkey 0
|
|
||||||
|
|
||||||
Monkey 2:
|
|
||||||
Starting items: 79, 60, 97
|
|
||||||
Operation: new = old * old
|
|
||||||
Test: divisible by 13
|
|
||||||
If true: throw to monkey 1
|
|
||||||
If false: throw to monkey 3
|
|
||||||
|
|
||||||
Monkey 3:
|
|
||||||
Starting items: 74
|
|
||||||
Operation: new = old + 3
|
|
||||||
Test: divisible by 17
|
|
||||||
If true: throw to monkey 0
|
|
||||||
If false: throw to monkey 1
|
|
||||||
</code></pre>
|
|
||||||
<p>Each monkey has several attributes:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>Starting items</code> lists your <em>worry level</em> for each item the monkey is currently holding in the order they will be inspected.</li>
|
|
||||||
<li><code>Operation</code> shows how your worry level changes as that monkey inspects an item. (An operation like <code>new = old * 5</code> means that your worry level after the monkey inspected the item is five times whatever your worry level was before inspection.)</li>
|
|
||||||
<li><code>Test</code> shows how the monkey uses your worry level to decide where to throw an item next.
|
|
||||||
<ul>
|
|
||||||
<li><code>If true</code> shows what happens with an item if the <code>Test</code> was true.</li>
|
|
||||||
<li><code>If false</code> shows what happens with an item if the <code>Test</code> was false.</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p>After each monkey inspects an item but before it tests your worry level, your relief that the monkey's inspection didn't damage the item causes your worry level to be <em>divided by three</em> and rounded down to the nearest integer.</p>
|
|
||||||
<p>The monkeys take turns inspecting and throwing items. On a single monkey's <em>turn</em>, it inspects and throws all of the items it is holding one at a time and in the order listed. Monkey <code>0</code> goes first, then monkey <code>1</code>, and so on until each monkey has had one turn. The process of each monkey taking a single turn is called a <em>round</em>.</p>
|
|
||||||
<p>When a monkey throws an item to another monkey, the item goes on the <em>end</em> of the recipient monkey's list. A monkey that starts a round with no items could end up inspecting and throwing many items by the time its turn comes around. If a monkey is holding no items at the start of its turn, its turn ends.</p>
|
|
||||||
<p>In the above example, the first round proceeds as follows:</p>
|
|
||||||
<pre><code>Monkey 0:
|
|
||||||
Monkey inspects an item with a worry level of 79.
|
|
||||||
Worry level is multiplied by 19 to 1501.
|
|
||||||
Monkey gets bored with item. Worry level is divided by 3 to 500.
|
|
||||||
Current worry level is not divisible by 23.
|
|
||||||
Item with worry level 500 is thrown to monkey 3.
|
|
||||||
Monkey inspects an item with a worry level of 98.
|
|
||||||
Worry level is multiplied by 19 to 1862.
|
|
||||||
Monkey gets bored with item. Worry level is divided by 3 to 620.
|
|
||||||
Current worry level is not divisible by 23.
|
|
||||||
Item with worry level 620 is thrown to monkey 3.
|
|
||||||
Monkey 1:
|
|
||||||
Monkey inspects an item with a worry level of 54.
|
|
||||||
Worry level increases by 6 to 60.
|
|
||||||
Monkey gets bored with item. Worry level is divided by 3 to 20.
|
|
||||||
Current worry level is not divisible by 19.
|
|
||||||
Item with worry level 20 is thrown to monkey 0.
|
|
||||||
Monkey inspects an item with a worry level of 65.
|
|
||||||
Worry level increases by 6 to 71.
|
|
||||||
Monkey gets bored with item. Worry level is divided by 3 to 23.
|
|
||||||
Current worry level is not divisible by 19.
|
|
||||||
Item with worry level 23 is thrown to monkey 0.
|
|
||||||
Monkey inspects an item with a worry level of 75.
|
|
||||||
Worry level increases by 6 to 81.
|
|
||||||
Monkey gets bored with item. Worry level is divided by 3 to 27.
|
|
||||||
Current worry level is not divisible by 19.
|
|
||||||
Item with worry level 27 is thrown to monkey 0.
|
|
||||||
Monkey inspects an item with a worry level of 74.
|
|
||||||
Worry level increases by 6 to 80.
|
|
||||||
Monkey gets bored with item. Worry level is divided by 3 to 26.
|
|
||||||
Current worry level is not divisible by 19.
|
|
||||||
Item with worry level 26 is thrown to monkey 0.
|
|
||||||
Monkey 2:
|
|
||||||
Monkey inspects an item with a worry level of 79.
|
|
||||||
Worry level is multiplied by itself to 6241.
|
|
||||||
Monkey gets bored with item. Worry level is divided by 3 to 2080.
|
|
||||||
Current worry level is divisible by 13.
|
|
||||||
Item with worry level 2080 is thrown to monkey 1.
|
|
||||||
Monkey inspects an item with a worry level of 60.
|
|
||||||
Worry level is multiplied by itself to 3600.
|
|
||||||
Monkey gets bored with item. Worry level is divided by 3 to 1200.
|
|
||||||
Current worry level is not divisible by 13.
|
|
||||||
Item with worry level 1200 is thrown to monkey 3.
|
|
||||||
Monkey inspects an item with a worry level of 97.
|
|
||||||
Worry level is multiplied by itself to 9409.
|
|
||||||
Monkey gets bored with item. Worry level is divided by 3 to 3136.
|
|
||||||
Current worry level is not divisible by 13.
|
|
||||||
Item with worry level 3136 is thrown to monkey 3.
|
|
||||||
Monkey 3:
|
|
||||||
Monkey inspects an item with a worry level of 74.
|
|
||||||
Worry level increases by 3 to 77.
|
|
||||||
Monkey gets bored with item. Worry level is divided by 3 to 25.
|
|
||||||
Current worry level is not divisible by 17.
|
|
||||||
Item with worry level 25 is thrown to monkey 1.
|
|
||||||
Monkey inspects an item with a worry level of 500.
|
|
||||||
Worry level increases by 3 to 503.
|
|
||||||
Monkey gets bored with item. Worry level is divided by 3 to 167.
|
|
||||||
Current worry level is not divisible by 17.
|
|
||||||
Item with worry level 167 is thrown to monkey 1.
|
|
||||||
Monkey inspects an item with a worry level of 620.
|
|
||||||
Worry level increases by 3 to 623.
|
|
||||||
Monkey gets bored with item. Worry level is divided by 3 to 207.
|
|
||||||
Current worry level is not divisible by 17.
|
|
||||||
Item with worry level 207 is thrown to monkey 1.
|
|
||||||
Monkey inspects an item with a worry level of 1200.
|
|
||||||
Worry level increases by 3 to 1203.
|
|
||||||
Monkey gets bored with item. Worry level is divided by 3 to 401.
|
|
||||||
Current worry level is not divisible by 17.
|
|
||||||
Item with worry level 401 is thrown to monkey 1.
|
|
||||||
Monkey inspects an item with a worry level of 3136.
|
|
||||||
Worry level increases by 3 to 3139.
|
|
||||||
Monkey gets bored with item. Worry level is divided by 3 to 1046.
|
|
||||||
Current worry level is not divisible by 17.
|
|
||||||
Item with worry level 1046 is thrown to monkey 1.
|
|
||||||
</code></pre>
|
|
||||||
<p>After round 1, the monkeys are holding items with these worry levels:</p>
|
|
||||||
<pre><code>Monkey 0: 20, 23, 27, 26
|
|
||||||
Monkey 1: 2080, 25, 167, 207, 401, 1046
|
|
||||||
Monkey 2:
|
|
||||||
Monkey 3:
|
|
||||||
</code></pre>
|
|
||||||
<p>Monkeys 2 and 3 aren't holding any items at the end of the round; they both inspected items during the round and threw them all before the round ended.</p>
|
|
||||||
<p>This process continues for a few more rounds:</p>
|
|
||||||
<pre><code>After round 2, the monkeys are holding items with these worry levels:
|
|
||||||
Monkey 0: 695, 10, 71, 135, 350
|
|
||||||
Monkey 1: 43, 49, 58, 55, 362
|
|
||||||
Monkey 2:
|
|
||||||
Monkey 3:
|
|
||||||
|
|
||||||
After round 3, the monkeys are holding items with these worry levels:
|
|
||||||
Monkey 0: 16, 18, 21, 20, 122
|
|
||||||
Monkey 1: 1468, 22, 150, 286, 739
|
|
||||||
Monkey 2:
|
|
||||||
Monkey 3:
|
|
||||||
|
|
||||||
After round 4, the monkeys are holding items with these worry levels:
|
|
||||||
Monkey 0: 491, 9, 52, 97, 248, 34
|
|
||||||
Monkey 1: 39, 45, 43, 258
|
|
||||||
Monkey 2:
|
|
||||||
Monkey 3:
|
|
||||||
|
|
||||||
After round 5, the monkeys are holding items with these worry levels:
|
|
||||||
Monkey 0: 15, 17, 16, 88, 1037
|
|
||||||
Monkey 1: 20, 110, 205, 524, 72
|
|
||||||
Monkey 2:
|
|
||||||
Monkey 3:
|
|
||||||
|
|
||||||
After round 6, the monkeys are holding items with these worry levels:
|
|
||||||
Monkey 0: 8, 70, 176, 26, 34
|
|
||||||
Monkey 1: 481, 32, 36, 186, 2190
|
|
||||||
Monkey 2:
|
|
||||||
Monkey 3:
|
|
||||||
|
|
||||||
After round 7, the monkeys are holding items with these worry levels:
|
|
||||||
Monkey 0: 162, 12, 14, 64, 732, 17
|
|
||||||
Monkey 1: 148, 372, 55, 72
|
|
||||||
Monkey 2:
|
|
||||||
Monkey 3:
|
|
||||||
|
|
||||||
After round 8, the monkeys are holding items with these worry levels:
|
|
||||||
Monkey 0: 51, 126, 20, 26, 136
|
|
||||||
Monkey 1: 343, 26, 30, 1546, 36
|
|
||||||
Monkey 2:
|
|
||||||
Monkey 3:
|
|
||||||
|
|
||||||
After round 9, the monkeys are holding items with these worry levels:
|
|
||||||
Monkey 0: 116, 10, 12, 517, 14
|
|
||||||
Monkey 1: 108, 267, 43, 55, 288
|
|
||||||
Monkey 2:
|
|
||||||
Monkey 3:
|
|
||||||
|
|
||||||
After round 10, the monkeys are holding items with these worry levels:
|
|
||||||
Monkey 0: 91, 16, 20, 98
|
|
||||||
Monkey 1: 481, 245, 22, 26, 1092, 30
|
|
||||||
Monkey 2:
|
|
||||||
Monkey 3:
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
After round 15, the monkeys are holding items with these worry levels:
|
|
||||||
Monkey 0: 83, 44, 8, 184, 9, 20, 26, 102
|
|
||||||
Monkey 1: 110, 36
|
|
||||||
Monkey 2:
|
|
||||||
Monkey 3:
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
After round 20, the monkeys are holding items with these worry levels:
|
|
||||||
Monkey 0: 10, 12, 14, 26, 34
|
|
||||||
Monkey 1: 245, 93, 53, 199, 115
|
|
||||||
Monkey 2:
|
|
||||||
Monkey 3:
|
|
||||||
</code></pre>
|
|
||||||
<p>Chasing all of the monkeys at once is impossible; you're going to have to focus on the <em>two most active</em> monkeys if you want any hope of getting your stuff back. Count the <em>total number of times each monkey inspects items</em> over 20 rounds:</p>
|
|
||||||
<pre><code><em>Monkey 0 inspected items 101 times.</em>
|
|
||||||
Monkey 1 inspected items 95 times.
|
|
||||||
Monkey 2 inspected items 7 times.
|
|
||||||
<em>Monkey 3 inspected items 105 times.</em>
|
|
||||||
</code></pre>
|
|
||||||
<p>In this example, the two most active monkeys inspected items 101 and 105 times. The level of <em>monkey business</em> in this situation can be found by multiplying these together: <code><em>10605</em></code>.</p>
|
|
||||||
<p>Figure out which monkeys to chase by counting how many items they inspect over 20 rounds. <em>What is the level of monkey business after 20 rounds of stuff-slinging simian shenanigans?</em></p>
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
abccccccccccccccccccaaaaaaaaacccccccccccccccccccccccccccccccccccccaaaa
|
|
||||||
abcccccccccccccccaaaaaaaaaaacccccccccccccccccccccccccccccccccccccaaaaa
|
|
||||||
abcaaccaacccccccccaaaaaaaaaacccccccccccccccccccccaaacccccccccccccaaaaa
|
|
||||||
abcaaaaaaccccccccaaaaaaaaaaaaacccccccccccccccccccaacccccccccccccaaaaaa
|
|
||||||
abcaaaaaacccaaacccccaaaaaaaaaaaccccccccccccccccccaaaccccccccccccccccaa
|
|
||||||
abaaaaaaacccaaaaccccaaaaaacaaaacccccccccccaaaacjjjacccccccccccccccccca
|
|
||||||
abaaaaaaaaccaaaaccccaaaaaaccccccaccccccccccaajjjjjkkcccccccccccccccccc
|
|
||||||
abaaaaaaaaccaaacccccccaaaccccccaaccccccccccajjjjjjkkkaaacccaaaccaccccc
|
|
||||||
abccaaacccccccccccccccaaccccaaaaaaaacccccccjjjjoookkkkaacccaaaaaaccccc
|
|
||||||
abcccaacccccccccccccccccccccaaaaaaaaccccccjjjjoooookkkkcccccaaaaaccccc
|
|
||||||
abcccccccaacccccccccccccccccccaaaacccccccijjjoooooookkkkccaaaaaaaccccc
|
|
||||||
abccaaccaaaccccccccccccccccccaaaaacccccciijjooouuuoppkkkkkaaaaaaaacccc
|
|
||||||
abccaaaaaaaccccccccccaaaaacccaacaaaccciiiiiooouuuuupppkkklllaaaaaacccc
|
|
||||||
abccaaaaaacccccccccccaaaaacccacccaaciiiiiiqooouuuuuupppkllllllacaccccc
|
|
||||||
abcccaaaaaaaacccccccaaaaaaccccaacaiiiiiqqqqoouuuxuuupppppplllllccccccc
|
|
||||||
abccaaaaaaaaaccaaaccaaaaaaccccaaaaiiiiqqqqqqttuxxxuuuppppppplllccccccc
|
|
||||||
abccaaaaaaaacccaaaaaaaaaaacccaaaahiiiqqqttttttuxxxxuuuvvpppplllccccccc
|
|
||||||
abcaaaaaaacccaaaaaaaaaaacccccaaaahhhqqqqtttttttxxxxuuvvvvvqqlllccccccc
|
|
||||||
abcccccaaaccaaaaaaaaaccccccccacaahhhqqqttttxxxxxxxyyyyyvvvqqlllccccccc
|
|
||||||
abcccccaaaccaaaaaaaacccccccccccaahhhqqqtttxxxxxxxyyyyyyvvqqqlllccccccc
|
|
||||||
SbcccccccccccaaaaaaaaaccccccccccchhhqqqtttxxxxEzzzyyyyvvvqqqmmlccccccc
|
|
||||||
abcccccccccccaaaaaaaacccaacccccccchhhppptttxxxxyyyyyvvvvqqqmmmcccccccc
|
|
||||||
abccccccccccaaaaaaaaaaccaacccccccchhhpppptttsxxyyyyyvvvqqqmmmccccccccc
|
|
||||||
abcaacccccccaaaaaaacaaaaaaccccccccchhhppppsswwyyyyyyyvvqqmmmmccccccccc
|
|
||||||
abaaaacccccccaccaaaccaaaaaaacccccccchhhpppsswwyywwyyyvvqqmmmddcccccccc
|
|
||||||
abaaaaccccccccccaaaccaaaaaaacccccccchhhpppsswwwwwwwwwvvqqqmmdddccccccc
|
|
||||||
abaaaacccccccccaaaccaaaaaaccccccccccgggpppsswwwwrrwwwwvrqqmmdddccccccc
|
|
||||||
abccccccaaaaaccaaaacaaaaaaccccccaacccggpppssswwsrrrwwwvrrqmmdddacccccc
|
|
||||||
abccccccaaaaaccaaaacccccaaccccaaaaaacggpppssssssrrrrrrrrrnmmdddaaccccc
|
|
||||||
abcccccaaaaaaccaaaccccccccccccaaaaaacggppossssssoorrrrrrrnnmdddacccccc
|
|
||||||
abcccccaaaaaaccccccccaaaaccccccaaaaacgggoooossoooonnnrrnnnnmddaaaacccc
|
|
||||||
abccccccaaaaaccccccccaaaacccccaaaaaccgggoooooooooonnnnnnnnndddaaaacccc
|
|
||||||
abccccccaaaccccccccccaaaacccccaaaaacccgggoooooooffennnnnnnedddaaaacccc
|
|
||||||
abcccccccccccccccccccaaacccccccaacccccggggffffffffeeeeeeeeeedaaacccccc
|
|
||||||
abccccccccccccccccccaaacccccaccaaccccccggfffffffffeeeeeeeeeecaaacccccc
|
|
||||||
abccccccccccccccccccaaaacccaaaaaaaaaccccfffffffaaaaaeeeeeecccccccccccc
|
|
||||||
abccccccccaacaaccccaaaaaacaaaaaaaaaaccccccccccaaaccaaaaccccccccccccccc
|
|
||||||
abccccccccaaaaacccaaaaaaaaaaacaaaaccccccccccccaaaccccaaccccccccccaaaca
|
|
||||||
abcccccccaaaaaccccaaaaaaaaaaacaaaaacccccccccccaaaccccccccccccccccaaaaa
|
|
||||||
abcccccccaaaaaacccaaaaaaaaaacaaaaaacccccccccccaaccccccccccccccccccaaaa
|
|
||||||
abcccccccccaaaaccaaaaaaaaaaaaaaccaaccccccccccccccccccccccccccccccaaaaa
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 12: Hill Climbing Algorithm ---</h2><p>You try contacting the Elves using your <span title="When you look up the specs for your handheld device, every field just says "plot".">handheld device</span>, but the river you're following must be too low to get a decent signal.</p>
|
|
||||||
<p>You ask the device for a heightmap of the surrounding area (your puzzle input). The heightmap shows the local area from above broken into a grid; the elevation of each square of the grid is given by a single lowercase letter, where <code>a</code> is the lowest elevation, <code>b</code> is the next-lowest, and so on up to the highest elevation, <code>z</code>.</p>
|
|
||||||
<p>Also included on the heightmap are marks for your current position (<code>S</code>) and the location that should get the best signal (<code>E</code>). Your current position (<code>S</code>) has elevation <code>a</code>, and the location that should get the best signal (<code>E</code>) has elevation <code>z</code>.</p>
|
|
||||||
<p>You'd like to reach <code>E</code>, but to save energy, you should do it in <em>as few steps as possible</em>. During each step, you can move exactly one square up, down, left, or right. To avoid needing to get out your climbing gear, the elevation of the destination square can be <em>at most one higher</em> than the elevation of your current square; that is, if your current elevation is <code>m</code>, you could step to elevation <code>n</code>, but not to elevation <code>o</code>. (This also means that the elevation of the destination square can be much lower than the elevation of your current square.)</p>
|
|
||||||
<p>For example:</p>
|
|
||||||
<pre><code><em>S</em>abqponm
|
|
||||||
abcryxxl
|
|
||||||
accsz<em>E</em>xk
|
|
||||||
acctuvwj
|
|
||||||
abdefghi
|
|
||||||
</code></pre>
|
|
||||||
<p>Here, you start in the top-left corner; your goal is near the middle. You could start by moving down or right, but eventually you'll need to head toward the <code>e</code> at the bottom. From there, you can spiral around to the goal:</p>
|
|
||||||
<pre><code>v..v<<<<
|
|
||||||
>v.vv<<^
|
|
||||||
.>vv>E^^
|
|
||||||
..v>>>^^
|
|
||||||
..>>>>>^
|
|
||||||
</code></pre>
|
|
||||||
<p>In the above diagram, the symbols indicate whether the path exits each square moving up (<code>^</code>), down (<code>v</code>), left (<code><</code>), or right (<code>></code>). The location that should get the best signal is still <code>E</code>, and <code>.</code> marks unvisited squares.</p>
|
|
||||||
<p>This path reaches the goal in <code><em>31</em></code> steps, the fewest possible.</p>
|
|
||||||
<p><em>What is the fewest steps required to move from your current position to the location that should get the best signal?</em></p>
|
|
||||||
@@ -1,449 +0,0 @@
|
|||||||
[[[1,[1,6,0,10,10],[],5,[]],[3,[5,8],2,[3,6,5,7],8],4,[0,[10]],8],[7,7],[[3,[9,5,10],[3],8,10],2,3,9],[[8,[3,1,4,9,5]]],[[[],0],10,10,3]]
|
|
||||||
[[],[[[2,1,2,9],[]],[[1,5,10],3]]]
|
|
||||||
|
|
||||||
[[],[[1,[0,4,7,10,10],3,[6,2,0],[9,1,4]],[],[5,[0,8,5],0,10,[3,10,10]],2,2],[],[[[],10,[]],[3,3,[0,0,2,10],[7,8,6,4,6],6],[10,[8,2,4,2,0]]],[[[9,2,10],[5],1,5,[2,7,9]],[4,[6]],[[]],[4,[],[6,5]]]]
|
|
||||||
[[6,[]],[[[1],[6,4,1,4],3],[4,4]],[[6,[2,2,9],5,[8,9,7,10]],6],[5,[[10,9,0,5,5],[10,6,6]],[[10,9,6],[0,0,3,1],[],5],7]]
|
|
||||||
|
|
||||||
[[[4,[3,0,5,8,4],[5],7]],[[1,[3,9,10,3],6],7,2]]
|
|
||||||
[[[]],[],[[[5,7,8,8],[3,1,6,3],[6,7],4],10,8,[5,7,[5,0],9,7],6],[7,[4],7,[8,5],5]]
|
|
||||||
|
|
||||||
[[[],4,6],[0,3,2],[[5,[9,0,10,3,7]],[[5,6,7],[6,0]],9,[9]]]
|
|
||||||
[[[[7,8,9,3,5],6,[2,6],[6,1,4,10,8]],3],[10],[[]]]
|
|
||||||
|
|
||||||
[[2,8,[[8,3,1,5]],[[8,3],[1],[3],[],[5,8,8,9,4]]],[10],[],[6]]
|
|
||||||
[[0,[[6],8,4],6,4],[[[10,2],[6,4,4,9],8,[]],[0,5,4,[4,2,0]],1],[[[0,3,8]],8,0],[]]
|
|
||||||
|
|
||||||
[[5],[[],[[9,2,3,5,0],[1,2,7,5],5],0,[[4,8,10],[4,1],[9,1],3,10],3],[]]
|
|
||||||
[[],[2,[8],[],[2,8,7,[]],[[],[9,10,1,10],[],[]]],[6,[1,[],10,[3,1,5,1,7]],[6,[10,1],[0,10,4],4]],[]]
|
|
||||||
|
|
||||||
[[3,[[9,2,7],3,6,[6,9],[3,8,2,5,2]]],[],[[9,[5,8]],6,5,[[10]]]]
|
|
||||||
[[2,[1,2],[[6]],[6,8,6]],[[],[2,4,[7]],[0,2,[],[0,7,10,7,7],[10,2,8]],10,[[3],[7,4,8],[7,6]]]]
|
|
||||||
|
|
||||||
[[[[2,9],0,9,4],0,[[5,10],[0],5,[6,3]]]]
|
|
||||||
[[[9,1,[]],[[7,9,9,5]],[[3,6,0,1]]],[1,3,1],[0,1,[],[[3]]]]
|
|
||||||
|
|
||||||
[[6,6,[[5,8,6],[],[0,7],0]],[8]]
|
|
||||||
[[0,6,[[0,3]]],[9,[0,7,5,5],[[3,8,2,5],1],4,[10,[4,3],2]],[0],[[6],[1],[6,[],[4,8,6,10,0]]],[2,8,[6,[8],[8,4]]]]
|
|
||||||
|
|
||||||
[[7],[[],2,6],[3],[[5,[5,5,5,7],6],[6],1]]
|
|
||||||
[[1,[3,[8,4,1,0,1]],6,5],[1,[[7],[8,7,5]],8,[[],5],8],[],[[8,[]],5,4],[8]]
|
|
||||||
|
|
||||||
[[8]]
|
|
||||||
[[],[],[[[7,3],[9,0,0,2]]],[[9,0,[6,3,2,0,1],5],3],[[],[10,9]]]
|
|
||||||
|
|
||||||
[[[2,[10,10,9,6,7]],[5,1,3,7]],[[10],8,[[1,8,10,8,1],8,[1,2,4,7]]],[]]
|
|
||||||
[[10],[6,[],6,[[10,1],7,[5,1,0]]],[[0,6,[4,5],[9,0],6],[]]]
|
|
||||||
|
|
||||||
[[[],[],[]],[3]]
|
|
||||||
[[[[]],10],[[[0,9,8,9,4],[4,1,5,4],[7,6],3],10,2,0],[[0,6]],[9,3]]
|
|
||||||
|
|
||||||
[[],[[[9,4,8,1],0,8,[10,9]],[]],[[1,7,[5,9,3],8,5],3,[[8,9,10,2],7,[0,10,7],[8]],[5,[8,7,0,3,5],0],[9]]]
|
|
||||||
[[3,7,10,[[9,1,8],[4,5,0],8,[2,7]],10]]
|
|
||||||
|
|
||||||
[[[9,[5,10,3,5,1]],7,9]]
|
|
||||||
[[9]]
|
|
||||||
|
|
||||||
[[[[7,3,4,9,5],6,[4],4],[9,[9,9,3,4,6],5,8],[[1,6,8],[8,9,0,2],10]],[[],[4,[4,7]],3,[7,[],5,7]]]
|
|
||||||
[[[[0,7,7]],[[4,6,4],[7],4]],[0],[[],[[4,3,1,10,4],[2,0,9]],0],[[[7,1,5,8,9]],5,7,8]]
|
|
||||||
|
|
||||||
[[7,10,[5,[5,6,7],2,7],5,[[10,9],2]],[],[[8,[2,9,10],[10],[],[]],[]],[0,[9,0],[[],[4,2,10,6,5]],10]]
|
|
||||||
[[[[3,0,10,3]]],[[6],10,[1,3,[],0],4,7],[4,[],9,[[3,5,4,9,10],[0,8,3,4],[3,9,8,9],[1]],1]]
|
|
||||||
|
|
||||||
[[],[6,[7,5]],[6,6,3]]
|
|
||||||
[[],[[2,3],5,6],[7,[]]]
|
|
||||||
|
|
||||||
[[[],[1,[2]],4,10,[[],[],0,[3,6,10,4]]],[[1]]]
|
|
||||||
[[7,[5,3,9,[10]]]]
|
|
||||||
|
|
||||||
[[],[]]
|
|
||||||
[[[10],8,9,[4,10,[9,6],[1,0,6,7,8]]],[2,0,[1,2,2,2,6],[5,[3,0,9]]]]
|
|
||||||
|
|
||||||
[[4,0,4,2,[]],[0],[8,[8,[1,10],4,1],1,[5,6,2],2],[[5,2],0,3,[[8,4,6,9]]],[[[],9,[],9],[],[[2,5],[5,5,8,4],[4]],7,0]]
|
|
||||||
[[],[10,[4,5,[3,2,10,0,0],[5,3,6]],1,[2]],[[7,[8,7,3,2]],[5,10,10],[4,[10,7,0,6,10]],8]]
|
|
||||||
|
|
||||||
[[[[8]],3,[[2,1],1,4,8,[8]],8],[]]
|
|
||||||
[[10,9,[[6,3],[9,7,3],[6,8]],2,[[]]],[[[],9,[1,6,3,10]],3,[1,10],0],[[[0,8,5,2],1,2,[7,4]],5,[0,[8,7,1,1],5,2,[6,1,8]],1,[1,[8],[3]]],[[10,[0,7,8],10,8],7,[[]],0,[]],[5,8,1,[[],9,[],[0]],[]]]
|
|
||||||
|
|
||||||
[[[3,6,[7,10,0,2]]]]
|
|
||||||
[[9,[[4,6,10]],1,6,[5,[8,5],5,10,10]],[[],9,1,[2,[5,3],2,[6]]],[4],[],[[0]]]
|
|
||||||
|
|
||||||
[[[[7,3,5],[1]],2,[],4],[0],[9,[[4,2,5,9,6],2],[],[5,6]],[2]]
|
|
||||||
[[3,5,6,[[5],10]],[[2,[8,0,2,5,9],[]],5]]
|
|
||||||
|
|
||||||
[[[3],4],[[[2,1],[2,9,6]],[],0,4],[[[7],[7,3],0,8,9],[[10,9,10,6],[2,0,10,1]],9],[10]]
|
|
||||||
[[[]],[[],8,[[],[5,0],0,2,[3,7,8]]],[3,0,1,2],[],[10,10]]
|
|
||||||
|
|
||||||
[[[1,8,6,[9,5,6,6,3]],5,[[9,3,3,10],[8,0,1,9],9,[2]],8],[[[4,0,5],[4,10,7,4,0],9],4],[2],[3,[9,[],4],3,[[],0,7,6]],[]]
|
|
||||||
[[[0,[]],4],[[4,[5,7,10,5,1],5],[[10]]]]
|
|
||||||
|
|
||||||
[[[],[[10,8],[],[8,4]],1,0,[]],[[],[[2,0,8],4,9,7],[10,[0,8,4,9,5]],5]]
|
|
||||||
[[[10,5,[2,7,8],2],[2],7,[]],[6,2],[3,7,7,[[9,3,5,8,4],[3,0,4],[10,9,4,8,8],[2,4,7],7]],[[]],[1,5,[[10,3,4,1,5],6,[],10]]]
|
|
||||||
|
|
||||||
[[],[[[],[3,3,0],[4,0,5],[5]],[10,8,[2],[10,1,10,3],[10,7]],[[1,5,7,0],[8,5],10,8,[10,4,5,10]]],[7,[2,3,9,9]],[[8,[3,9,6]],[[8,8]],0]]
|
|
||||||
[[8,[9,8,[6]],[[8,7]],[4,6]],[],[],[[0,3,[7,9,6,9,1]],[[],[7,6,2,2,0]]],[[],[[0,2,2,3,7],8,[3,10]],1,[8,0,[6]],6]]
|
|
||||||
|
|
||||||
[[4,[1,9],0],[8,[2,[],[10,9,6,5],9,7],[[6,2,7,8],10,2,2,[0,10,2]],7]]
|
|
||||||
[[],[0],[2,[],[6,2,[4,4],[10,10,3,2,10]],10],[8,[],[8,8],9,10],[[[4,9],[8],0,10]]]
|
|
||||||
|
|
||||||
[[[[7],5,[4,2,5,6,6],[3,8,10,10,10],[10,10,9,7,9]],[6,9]],[2,[],[[2,2,9,2,10],[10,9],0,[5,7]]],[[7,2],7],[0,[7],[3,[]],6,3]]
|
|
||||||
[[5]]
|
|
||||||
|
|
||||||
[[[4,10],5]]
|
|
||||||
[[],[[[],[1,7,10,1,9],2,0,2],2,0],[[],[[8,2,5,4,9],7,8,3,[2,7]],5,0]]
|
|
||||||
|
|
||||||
[[10],[],[4,7,7,[[8],[1,8,8,6,10],[10,6,6],2],[4,[3,3,2,7,4],8,8,3]],[[9,[7,9,8,4],7],[[9,1,5,9,5]]]]
|
|
||||||
[[[7],6,[3,6,9]],[10,5]]
|
|
||||||
|
|
||||||
[[[2,[],9,6],4,4],[[[8,2,4],8,[8],[8,4,10]],[[7,6,4,10,9],6,6,3],10,[6,[10,2,3,8,7],4],6],[[],[],[3],[10],5]]
|
|
||||||
[[4],[[],[[10,9],[0,8,3,5]]],[[[],[2,2,1,10,6]],0,[[1,8]],6],[2,[[10],[6,3],7,[1,3,10]]]]
|
|
||||||
|
|
||||||
[[[],[[7,4,7,7]]],[7],[0,[]],[3]]
|
|
||||||
[[0,[[6,5],[2],0,[],[5]]],[[1]],[]]
|
|
||||||
|
|
||||||
[[[10,[7,7],[8,1,0,4,5],7],2,[[],[2,2,8,2],[5,0,9],5,[]],6,[[0,8,10],9,[5,5,6,8,0],[9]]]]
|
|
||||||
[[3,[[],[4,9,4],6,[5,2,8]]]]
|
|
||||||
|
|
||||||
[[[[3,2],2],6,[5,1,6,0],[],4],[[7],4,0,0,[[9,1],6,[8]]],[[6],1],[0,[[4,0]],2],[]]
|
|
||||||
[[[5,9,5,[],3],[2,6,[0,2,4,4]],0,0,[]],[[[],8]]]
|
|
||||||
|
|
||||||
[[[4,0,1,9],5,5]]
|
|
||||||
[[2,3],[]]
|
|
||||||
|
|
||||||
[[5,2,[[],[4,2,9,3]],[1,0,5],[7]],[[10,[3],[5],4],0,6,8,3],[9,[8,5],[4],3],[6,[],[8,9,5,[1,9,4,3,4],9],[2,10],8],[[[3,3,8,0]],8,4,[6,[1,5],[],[7,7]],5]]
|
|
||||||
[[],[8,5,[9,[5,5,7]],[[9,0,3,1],5,8]],[[]]]
|
|
||||||
|
|
||||||
[[],[[[6,2,9]],6],[[],[[]],8],[[[5,1],[0,8],10],[[],0,[4,8],[5],7]],[5,3,[9,[0],[],[3,10,3,6]],[7,3,0],[[1,10,8],7,[0]]]]
|
|
||||||
[[[],[3,6,4,[10,7,1],9],7,[],[0,[9,2,3],[9]]],[0,[4,4,4,9,2],[[8,5,8,3,10],8,7,5],1,[[6,0],6,0,4]]]
|
|
||||||
|
|
||||||
[]
|
|
||||||
[[],[1,5,8,10,8]]
|
|
||||||
|
|
||||||
[[8,7],[[9,4],10,5,2],[7,[[]],10,0,[10,4,[],[4,6,8],0]],[[[],[1,10,4,3],[1],10,[7,9,3,9]],[6,[9,8,7,0],6,[5,9,3,5,7],[8,3,4,1]],[10,7,9],9],[6,[[9,8],8,[2,6,4,9]]]]
|
|
||||||
[[[[1],[6,9,6,4,0]],[5,[4]],9]]
|
|
||||||
|
|
||||||
[[[[10,3,2,9,1],[1],7,2,2]]]
|
|
||||||
[[5,[[],9,[6,0,9,7,2],1],[]],[[1,2,[6,6],[1,7,1]],7],[[7,[2,5,3]],[0],2],[5,9]]
|
|
||||||
|
|
||||||
[[[7],[6],[3,2],[[3,5,2]],1],[[7],[[5,1,0,2],2,[5,7,2,4]],[[10],8]]]
|
|
||||||
[[[[],[8,2,7,4,4],[10,8]],[3,[3],[4]]],[[0,[10,5,10,4]],[[],[7,8,10,10,3],6],3],[[[10,4],7,[4,0],[7,8,0,10]],[1],[2,2,3,[5,6,8]]],[8,10,[[3,1,8,8],5,9,1,[10,6]],[[4,7],5,[1,9,10,0,4],2]]]
|
|
||||||
|
|
||||||
[[2,[4],9,[],[4,10]],[],[[[9],[0,0],[1,4,9,7],0],0,[[1,0,2],7,1],4,2]]
|
|
||||||
[[[6,10],[3,2,[1,1,7],[1],7]],[2],[1],[]]
|
|
||||||
|
|
||||||
[[],[4,[10],[[0,5,8,2,10],[],9,[0,3],[9,1]]],[9,1,8,[[1,10,8,3,4],[6,0,5,7,9],[2,10,3],3],6],[0,[10,[],2],5]]
|
|
||||||
[[[[10,3,9,2,5],2,[],3],10],[[[7,3,8,9,10],5,6,6,[1]],10,3,4,[[1],10,7]],[[[1,8,4,2,10],6,9,0,[]]],[[5,9]]]
|
|
||||||
|
|
||||||
[[[3,10,3,10]],[[6,7,[2,8,9,6,5]],6],[10],[6,[],[7,[8,9,4,2]]]]
|
|
||||||
[[[[9,7],[2]],[5],[]],[[[4,7,7],7,0],7,[[8,0],[],[4,5,6,2],[]]]]
|
|
||||||
|
|
||||||
[[]]
|
|
||||||
[[10,[]],[1],[],[[[8]]]]
|
|
||||||
|
|
||||||
[[[[5,0,4,10,0],5,[],[1]],[],[2],[[2,2,7,1,2],7,1,0,4],[10,[],5]],[[6,[5,9,6,3],3,9,[8,4,1,8]],[[3,3,8,3,0]],[6,[],0,[4,2],[]]]]
|
|
||||||
[[3],[[4,[8,4,10],7],[6,[5,9,9,2,4],[9,1,7,0],[5,9,5,0]],[4,10,[],[8,8,7]],1,10]]
|
|
||||||
|
|
||||||
[[[1,[8],[2,7,1],9],[],[9,1],[2,10,[8,10,7]],5]]
|
|
||||||
[[3,[]],[[],[9,9],0,8,[[8,8,1,5,6],[3,8,4,5,4]]],[[4,7,10,[7,2,0,0]],[[9]]]]
|
|
||||||
|
|
||||||
[[3],[4,7],[],[[1],[[4,9,10]],[[]],[],4],[[4,1],0,2,2,[2,[],[8,2,10],[9,0,10,4]]]]
|
|
||||||
[[5,9,[1,[0,9,10]],[1,9],7],[7,6,[[6,9],0],8],[1],[[6,7,3]],[]]
|
|
||||||
|
|
||||||
[[[8,4,[5,2]],0,[],8],[],[9],[[],[6,1,[3,0,7],1],[[9],7,[7],10]],[]]
|
|
||||||
[[2,[[1,2,8,8],[]],2,4,6],[[7]],[9,[10,[10,1,3,3,3],[3,10,10],5,7],7],[],[]]
|
|
||||||
|
|
||||||
[[10,1],[10,[[9],[9,1,5,9,5],[7,7,9,0],6]]]
|
|
||||||
[[[4,[10],1,[0,1]]],[[[7],9],6,9,6,6]]
|
|
||||||
|
|
||||||
[[6,[[],6,[7,8,8]]],[[1,3,[4,8,0,6],[1,10,3,9],10],[6,3],[9]],[],[[],[0,[10,3],[5],[7,5,10,5,2],[]],[4,8,3,[],[0]],[[5],[5,9]],[3,[5,2],[1,4,2]]]]
|
|
||||||
[[[[1,7],3,0,[]]],[1,6,[5,[10,8,8],[]],[[6,10,2,5,7],6,[7,7,9],[6,4,8,8]],1],[5,[[10,10],3],[[],[2,10]],[1,1,[6,5,7],[10,5,2]],0]]
|
|
||||||
|
|
||||||
[[7,[[7],9,[4,1,3,8],0,4],[1,4,[0,7,6,1,1]]],[0,[2,[3,9,7],10,5],[0,[9,4,2,5,3]]],[0,7],[[7,9,9,3,1],10,[],0]]
|
|
||||||
[[2,[]],[4,0,5,7]]
|
|
||||||
|
|
||||||
[[[8,7],[4,[7,2,2,8],[8,3,9,9],1,0]],[[[7,4,7,3,10],[1,4,1],[0,10],10,[0]]]]
|
|
||||||
[[],[],[7]]
|
|
||||||
|
|
||||||
[[1,[[5,7,2],[10],0,[8],[10,9,0,10,8]]]]
|
|
||||||
[[],[2]]
|
|
||||||
|
|
||||||
[[[10,[9,9,6,3],1,9]],[10,[4,[1,9]],[],[8]],[[3,7,[10,2]],[[],[1,3],2]]]
|
|
||||||
[[8,6],[[5,0,10,[9]],[[1,5,8,4]],[[1,8,4,6],[4,7,6,2,0],[6,0],[6,3],[6,9,9,10]]]]
|
|
||||||
|
|
||||||
[[10],[8,3,2],[2,[1],[],6,[[6,8],[6,7,5],[9,2,9],7,7]]]
|
|
||||||
[[[3,[],[10,3,9],4,[5,9,10,3,8]],[2],0,[3],[[3,0],3]],[[7]],[4,[],[],[[9,3,5]],[[]]],[[10],[[6],7],[[1,4],1,[1,1,3],[5,0,4,5,6]],[[4],[7,0,4]],3],[[[],3,[]],8,[9],4]]
|
|
||||||
|
|
||||||
[[[7,[1],[8,4,3,7],3]],[[],[[5,5,3,8,7],[7,5,10,1,1]],8,8],[[2,[7,7,9],10],[4,[4,0,4,2],10,[1,10,9,6]],[[0],0,7],[0,8,[5,0,10,2,3],[7,3,6,5,5]]]]
|
|
||||||
[[9,[[8,5]],3,7,5],[[1,[],0,1]],[[[10,8],10,[1],[9,9,3,4]]],[8,[[5],2,3,[],[4,0,5]],0,5],[[4,[5,5,0,10],6,10],2,7,[],9]]
|
|
||||||
|
|
||||||
[[[[]],6,[[5,1],8,[4,10],4,[10,5,0,6,5]],1],[[4,[4],6],5,7,[[2],[10,1,4,5,4],2,6,[8]],4],[[],7,[[10],[1,5,9,3,9]]],[[1,[],2],[],0,7,[[7],[7]]],[[],[[9,0]],[0]]]
|
|
||||||
[[1,9,[],6],[[[9,0,4,3],[8,1,4]],0,[]],[1,[3,[2,4],[]],6,1,3]]
|
|
||||||
|
|
||||||
[[4,8,[1,[7,9,5,8,3]]],[[[6,5],[6,1,5,6,0],7,3],[]]]
|
|
||||||
[[7,0,7,[],[1,[7,1],10,[7,5,8,6]]],[],[[],4,[1,8],[[7],[5,8,0,4],1,[],9],[[],9,1,7]],[[[7],3,[10,2,2],9]]]
|
|
||||||
|
|
||||||
[[7,[[9,7,9,4,3],6,7],9],[1,0,[[1,2,0,7],[9],8,[10],[5,7]],[7]]]
|
|
||||||
[[[6,4,9],0,[],6]]
|
|
||||||
|
|
||||||
[[1,[[2,0,2,2],8,5],[],[[4,3],[10],[6],10]],[6,[7,1,[0,2,6,1],9,[0,5]],[[1,5,10,10],[7,8,3,10,3],[],2],7,[9,8,9]],[5,6,[[10,3,2,6,3]]]]
|
|
||||||
[[5],[[[4],[6,0,4,8]]],[[3,2],[10,[4],[1,8],8],5,1],[]]
|
|
||||||
|
|
||||||
[[10,[[],[4,3,6,2,10]],9],[[2,[5],2,[8,8],[8]],1,[5,4,10,0,[6,2,5]]],[[[3,7,9],[7,5,2,4]]],[10,[7],[3],8,8],[]]
|
|
||||||
[[4,5]]
|
|
||||||
|
|
||||||
[[1,[[6,5,2,7,0],4],[2,1],9],[],[[[4,3,1,0,1],9,1,6]],[[[6,7,0],1,5],5,7],[4,3]]
|
|
||||||
[[[1,[3],0],[[5],[10],2,[2,1,3,6]],6,[1,[7],1,[],7]],[[],[[10,4,7,7,5],4,[4,5],[3,6,10,9]],[[2,8,5,7],[8,1,0,9]],[[0,6,8],0,7,5,[4,1]],[3]]]
|
|
||||||
|
|
||||||
[[],[9,4,5,[]],[[],5]]
|
|
||||||
[[[9,0],10],[],[[10,10,[8,2,7],[4,7,3,10,2]],2,1],[[],7],[9,1,[],[[4,7,2],[4,0],0,2,7]]]
|
|
||||||
|
|
||||||
[[[10,[1],[0,3,5,7,9],1,[1,9,5,9]],[2,[10,4,6]],1],[2]]
|
|
||||||
[[[7,[9,6,6,7],1],6,10],[5,[7,[9,9,9],8]],[7],[9,8,[[0,5,1],[0,3,2,9]],6],[3,3]]
|
|
||||||
|
|
||||||
[[[[4,2]],[[9,10,9]]],[2,[8,[],7,[10],[]],3,2,6],[[0,8,[6,1,6]],1]]
|
|
||||||
[[[1,[5,9]],9,5],[[[],6,7,[],1],4,[[5,3],[10,2,7,3,10],[6,1,1],4,[]],2],[],[[7,[0,3,5]],[0]]]
|
|
||||||
|
|
||||||
[[3],[4],[[4,[10],7,[2],9],[1,[5,2,10,3],[9,6,1]]]]
|
|
||||||
[[],[[[6,9,7,10,8],4,6],[[5,5,9,8,3]],8,10],[6,9],[9]]
|
|
||||||
|
|
||||||
[[6,8,[10,9,8]]]
|
|
||||||
[[[0,3,[],[4,9,5,5],3]],[],[],[9],[[4,[5,3],[3,5,8]],6,[7,9]]]
|
|
||||||
|
|
||||||
[[3,[[]],[[3,4,2,10,0],10],[3],[[],9]],[1,2,4,9]]
|
|
||||||
[[[9,[0],8],0,3,10],[[4]],[9,7],[1],[[[0,3,0,0,7],1,[0,7],[4,3]]]]
|
|
||||||
|
|
||||||
[[[[8,6],2,6,4,[8,8]],[[]],[[],4,1],[10,[8,4,1,6,6],[4,9,7,6],9]],[6,10,8],[1,9,[]]]
|
|
||||||
[[10],[5,4,10,[[],3,4,5]],[[],3],[2,[4,[7,2]],6,10]]
|
|
||||||
|
|
||||||
[[6,9,10,[7]],[[3]]]
|
|
||||||
[[[[7,7,1]],0,1]]
|
|
||||||
|
|
||||||
[[[1,6,8],7,[[4,6],[8,9,5],[7,7,9],10],1,[7,[7,0,5],5,0,[3,7]]]]
|
|
||||||
[[[[8,1,7],[8,1],0,[0,6,8],[5]]],[5,[4,10],[1,[5,2,8,4,0]],[[7,10,6],3]],[],[8,[5,[5,4],[3]]]]
|
|
||||||
|
|
||||||
[[9],[[],[[5,4,6]],0],[6,6,6],[[[6],[4,6,5,5],1,0,[5,5,3]],4,4,[[6,8,7,5],[10,8,1,8,6]],[6,[10,0,2,8,9],[10,4],2,[10,5]]],[9,[],1,9]]
|
|
||||||
[[10,[3,[3,0,8],[10],[5,5,8,1]],[[3,0,5],[8],8,7]],[8],[[[],[7,6]],4],[10],[6,[]]]
|
|
||||||
|
|
||||||
[[[[5,0,2,9],5,[8,8,0]],[8,10,[8,9,4],[8,3,10,9],[6]],5],[[0,10,[10,8,3],8,6],6,[[9,9]],[3,[3,7,10],[8,2]],[[],9,3,[9,0,8]]],[[0],4,[7,9],[[2,10,5,7,5],[8,0,1,5],[6]]]]
|
|
||||||
[[],[10,[[7],8],4],[0],[[10,5,[0,9,9,4]],[]],[5]]
|
|
||||||
|
|
||||||
[[[0],3,7,7,[1,[0,4,8,9,7]]],[[3]],[7,[7],2,[3,[7,7,0],[6,10,4,7,9],[8,10,2,8,2],[9]]]]
|
|
||||||
[[5],[9,[6,[]]],[[5,2,[],9]],[[]]]
|
|
||||||
|
|
||||||
[[],[[[0,0,6,9],[6,3,2],5],[5,[2]],7],[[[5,2,4],[2,8],[4]],[5,[]]],[],[]]
|
|
||||||
[[[5,1,[6]],[[3,7],6,[6,6,8,3],[],10]],[],[[],1,[9,[7,2,10,2,9],7]],[6,[1,[0,10,10,1],2,7,[]],[[],1,5],[[7,3,1],[2,8,10,9],[9,5],4]],[[],9]]
|
|
||||||
|
|
||||||
[[[3,6,10],[[10,4,4],[9,0],10,[]],[9,[],[5,4,3,6,6]],6],[],[],[4,3,4,10],[[[10]],0]]
|
|
||||||
[[[[3,0],[6,2,8]],[[3],5,[],[10,8,7,6]],[9,6]],[]]
|
|
||||||
|
|
||||||
[[[],[6,7,6]],[1,[[],[8,1],[],[6]],9,[[5,0]],[2,9,8,5]],[5,[[10,4,4]],10,8]]
|
|
||||||
[[[[7,10,8],[8,6],6],2,[7,[2,8],1]],[[7,3,9,9,[6,4,8]]],[[4,1,[0]],4,7,[[10,2]]]]
|
|
||||||
|
|
||||||
[[[9,[10]],5,[[0,9,3,0,6],6,1,[0,10,2],4],4],[4,[[1,5,8,5]],3,6,[6,[8],[6,1,3],[2,2,0]]],[]]
|
|
||||||
[[],[4,1,[8,2,6],7]]
|
|
||||||
|
|
||||||
[[[9,[5,0,2,9],[5,9,3,7]],4]]
|
|
||||||
[[],[[3],2,3]]
|
|
||||||
|
|
||||||
[[5,5]]
|
|
||||||
[[],[7,0,10],[[]],[]]
|
|
||||||
|
|
||||||
[[],[],[[8,9,8,3,[4,5,2]],[[3,3,1],[],[6,9,1]],[4,9,[8,10,10,1],7],0,1],[]]
|
|
||||||
[[[9,6,5,10,1],8,9,[[7,10,3,9,5],10],2],[4,[],8]]
|
|
||||||
|
|
||||||
[[[[6,0,7,9,5]]],[[[4,4,3]],7],[[[7,0,2,9],[]],[5,[],9],4,[[8,8,9],[],2,[8,4,2,9,0],[4]],1],[8,6,6,[]],[[1,0],[],3,[6,[1,9],[6],[5,6]]]]
|
|
||||||
[[],[[[10,10],[]]],[]]
|
|
||||||
|
|
||||||
[[[2,[6,4,8],10,[6,6,3,9],4],[0,9,1,[]],[[],[3],9,5]],[[[6,7,8],[4,0],[9,5],[0],[3,10,3]],9],[],[],[[[4]],3,[[1,4,2,8],[5],5,[5,7,7,6],3]]]
|
|
||||||
[[10,7],[]]
|
|
||||||
|
|
||||||
[[7,2,2],[],[[],1,5,[5,9,[1],1,4]]]
|
|
||||||
[[4,5,[[9,10,0],6,7],3,6]]
|
|
||||||
|
|
||||||
[[],[5,[[4,10,4,5,2],[3,7,7,1,5],[7,4,1,5]],[[3,3],10,1,10]],[[],[[4,10]],9,10,10]]
|
|
||||||
[[],[5,[[1,4],[5,4,6,5,0],[10,10],0,[3]],[6,3,3,[0,3,5,0]],[[3,8,10,2],[4,4,2,2],4,[6],8]],[[[6,2],9],7,3],[10],[[],0,1]]
|
|
||||||
|
|
||||||
[[3,10,[],6],[[[]],6],[]]
|
|
||||||
[[[],6],[[],0],[[8],[[5,5],[],[8,4,7,6],[7]],[],1,[9,5]]]
|
|
||||||
|
|
||||||
[[],[7],[6,[3,2],0],[[[7,1,7],[6,5,1,8,8],[9,3,6,4,2]],[2,4]]]
|
|
||||||
[[9,[[7],0,[]],[9,[10]]],[10,0,[9,[1,1,5],[6,7]]],[1,9,2,[[5,3,1],9,0,5]]]
|
|
||||||
|
|
||||||
[[4]]
|
|
||||||
[[[[7,6],[10,7,5,2,0]],8,2,7],[3,[0],[7,0,[2,9],4]],[[3,8,2,4,[]],[[],[8,4,7],[2,9,8]],[[9,2]]],[5,[10],[[],[4,2,3],3,[1,7,5],[1]]]]
|
|
||||||
|
|
||||||
[[[[4,2,6],6,[9,6]]],[9,7,[[4,9,5],[10,1,8,7],6,3,1],[2,[4,6],1,8],1]]
|
|
||||||
[[[[8,1,1,6,7],[7,6,5],[6,8],[],[1,5,0,2]]]]
|
|
||||||
|
|
||||||
[[[[1,2,5,7],[],[7,2,3],10,8],4,10,4,10],[3,[6,[6,1],[3,7,0,7,0],10],[7],7]]
|
|
||||||
[[1],[[[1,9,4,8],[0],[10,5,8],[10,8]]],[3,7,5,[[1,2,9,1,7],[7,10,5,8,6],[0,3]],3]]
|
|
||||||
|
|
||||||
[[10,0]]
|
|
||||||
[[],[0,[1,[]],4],[8]]
|
|
||||||
|
|
||||||
[[],[[[10,3,2]],2,[[10,5,2,1]],[2,[]],[[1,9,4]]]]
|
|
||||||
[[[[4,9,2]],1,0,9,5],[[[0,5,10,1],[6,7],4,[1,6,4],[3,7]],[[0,10],2,5,9]]]
|
|
||||||
|
|
||||||
[[2,[10],7],[10,[[3,2],[7]],[7,[6,9,9,4],3,[7,1,2]]]]
|
|
||||||
[[[[9,6,4],8,[6,0,6,10],[7,1,0]]],[],[8,[9,[6,0,4,8],8,3],[],[1,[4,7,2,4]],0],[[[6,1,5],5],5,1],[4]]
|
|
||||||
|
|
||||||
[[[],[[],[]],[8,[5,2,7,7,8],[1,6,4,3,1],[0,10]]],[[[6,7,4]],3,[[],[6],[2,7,4,9]]]]
|
|
||||||
[[[[7,4,7]]]]
|
|
||||||
|
|
||||||
[[[[3,9,1,3,8],10,[2,6,8,2]],[],1],[1,2],[8,2],[]]
|
|
||||||
[[0,[6],[[6,9,8],5,4]],[[0],[],6,[6,[6,3,2]],3],[7,[[]]]]
|
|
||||||
|
|
||||||
[[9,10],[1,6],[]]
|
|
||||||
[[3],[6,1],[[[3,8]],2,[[],[3,9,8,0,2]],[]],[[1,3],4,[6]],[6]]
|
|
||||||
|
|
||||||
[[2,[3,5,1,5,[1,8,2]]],[5,5,[[8,4,8],10,[10,4],6]],[[[10,9],[3,9,8,2,8],[]],8]]
|
|
||||||
[[[5],6,[2],9],[10]]
|
|
||||||
|
|
||||||
[[2,[0,[6],6,3,[8,4,10]],[[9],7,[3,10,1],[10,5],9],4]]
|
|
||||||
[[[[9,10,5,6]]],[[2,9],[10,8]]]
|
|
||||||
|
|
||||||
[[3,[[6,1,0,2],[9],2,3],[5,[6,3,0,10],1]],[]]
|
|
||||||
[[10,9,[],[]],[[6]],[0],[10,[10,6,5,[1]],[[3,10,0,8,1]]]]
|
|
||||||
|
|
||||||
[[7,[[4],2,5],2],[[1,3,[7,4,4,9,5]]],[3,2,[[],1,2,[4],[6,4]],[]]]
|
|
||||||
[[],[[[]],3,[7,2,[]]]]
|
|
||||||
|
|
||||||
[[1,[[6,9]],5,[[9,5,5,5],9,8,8],[3,2,5,[4,0,4],3]],[4,7],[[[4,2,7,3],[5,1],[10,4]],[[2,9,2],[7,8,1],[10,4,2,3,6],[],5],[10,9,[]]],[9]]
|
|
||||||
[[[5,10,[6,5,9,3,3],8]],[],[[7,[4],1,0,[9,4,8]],[[10,1],2,3,6],8,3]]
|
|
||||||
|
|
||||||
[[8,4,3,8,[1,0]],[5,[7,[],7]],[10,[[6,2,4],[7,3,7,5],[],[],1],6,2],[[],[[0,9,6],[],8]],[9,[],10]]
|
|
||||||
[[[[10,8,5,0]],[]],[7],[[1,[2],[8,0,0]],[[2],[],[2,1,1,0,8]],3,[[10,4]],7],[10,[1,[4,5,7],10,5,[8,5,2,10]],1,9]]
|
|
||||||
|
|
||||||
[[1],[0,1,[2,7],[[10],1,[]],[[3,3,4,2,5],4,[],[6,3,1,10],3]],[[3,[9,9,9,1],[8,9,0],0],3,3],[10],[[9,[9,1,6,7],7]]]
|
|
||||||
[[1,4,[],5],[4,[2,8,6,[3,5,6,4]],3,4,[[],2,[]]],[[[7,1,0,1],[6,10,9,8,3]],[[10,10],6,[]],0],[]]
|
|
||||||
|
|
||||||
[[2,10]]
|
|
||||||
[[[0],0,[[1,0],[5,5,9]]]]
|
|
||||||
|
|
||||||
[[5,[[3],10,[9,9],[6,4],[]],[5,3,9,[5,0,10,4],9]],[[[0,1,1,8,5]]],[[],[[2,9,7,2],3,1,[6,3]],8,[]],[],[9,9,[[4,0,4],[],3,1]]]
|
|
||||||
[[],[8,9],[[],9,3,5],[[9,1,[1,4]],[[2],[6,8],[4]],[[],4,[]],8,4]]
|
|
||||||
|
|
||||||
[[0],[4]]
|
|
||||||
[[[4,7,1,6]],[[10,3,3,3]]]
|
|
||||||
|
|
||||||
[[[[2,9,9,7],1],[1,3,[1,9,8,9,8],10],3,3,5]]
|
|
||||||
[[[1,6,[3,7,3,0,4],10,[5,2,7]],[[6,5,10,8,6],[8,3,10,5,10],[9,3,5],2,4],10,[7,6]],[1],[[[4,9,3],6,2,[5,4,4,1],2],[[0,3]],9]]
|
|
||||||
|
|
||||||
[[8,[],2]]
|
|
||||||
[[3,[5,2,[5,1],[8,4,4],10],6,[[1,4],[]],8],[6,10],[[1,4,[5],2,0],4,[[],3],[5,6],2]]
|
|
||||||
|
|
||||||
[[1,9],[]]
|
|
||||||
[[2,[0,3,8,2]]]
|
|
||||||
|
|
||||||
[[[6,5,7],[2,6]],[10,7,[6,9,6,[3,8,2],[]],1,10],[[[5,2,6,5],4,[]],[6,0,6],1,[]],[5],[[6,3,[7,7,3,2,0]],[[],[7,1,3,5]],[]]]
|
|
||||||
[[4,[[3,6,9,8,4],0,8,[10,0]],6,0],[3,1,[[7]],[6,8,8,1,4],2],[8,[6,[1],4,0,[8,3,8]],[3]],[[[7,5,3,10]],6,2],[2,[0,[]],5,[4,7]]]
|
|
||||||
|
|
||||||
[[5,0,1,[9,[],[1,10,6,6],[]]],[],[[1],8],[[2,[1,9,1,3]]],[[[],[],7,9,[]]]]
|
|
||||||
[[],[],[4,2,[[],[3],[3,2,8],0],[[10],[0,7,5,0],[10,8],0,[]],[[],6,2]],[[[5,8,1],[2]],[8],6,[1]]]
|
|
||||||
|
|
||||||
[6,0,1,5,5]
|
|
||||||
[6,0,1,5]
|
|
||||||
|
|
||||||
[[[4],[],4],[2,[[],[0,5],7,[4,4]],[[9,6],5]],[],[[],2,[],7]]
|
|
||||||
[[[7,[9,8,8,3]],[],[],6],[9,[[2,0],[7,0],2],5,[[]],[[3,3,6],6,[1,6,1],[10,4]]],[8,[9],4],[[[],[10,0,5],8]]]
|
|
||||||
|
|
||||||
[[[[9,10,2],3,5,[9,8,8,9],4]],[6,[]],[[],[4,10,2,6,[2]],6],[4,6,5,[[],[],3,9,[4,0,2]],5]]
|
|
||||||
[[5,[[],[1,4,2,4],1]],[2],[7,[8,4,4]]]
|
|
||||||
|
|
||||||
[1,9,4,8]
|
|
||||||
[1,9,4,8,5]
|
|
||||||
|
|
||||||
[[[[],8,[7,9],4],10,[4,[10,8,4,0]],[3,[10,7],1,[]],[[8,6,8,7,8],2,9]],[]]
|
|
||||||
[[6,0],[10,10,6,[2,[],[8,1,6,4]]]]
|
|
||||||
|
|
||||||
[[8,6],[[[]]]]
|
|
||||||
[[5,6]]
|
|
||||||
|
|
||||||
[[],[],[[7],[8],[0,8,0,5],9,2],[1,3,3,[7,8],[4,0,[6,3,9,1],[3,8,4,2,5],[9,5]]],[10,[[0,9,0],[7,9]],9,3]]
|
|
||||||
[[],[[7,7,[2]],[[6,5,10,7],[8,4,9,0,4],6],[2,9,[4,8],10,5],[2,[7,10,0,1],[3,7]]],[[[5,4,0],[6,5],7,0,[2,6,5]],4,1,[4,10,1,2]],[[3]]]
|
|
||||||
|
|
||||||
[[9,[],3],[10,[4,9,10,0]],[[],5,[[8,0,7,9],6,3],[[10,4],[8,6,0,7],3,2]],[2],[[5]]]
|
|
||||||
[[[[4],9,[0,7,4,10]],8,[5,8,6,0]],[6],[5,[[],[7,0,5,5],0,[]]],[1,[1,[7,1,10,0,8],2],[2,[9,2,2,8],1,10,[6,9,3]]]]
|
|
||||||
|
|
||||||
[[[],4,[10],[5,[1,0,9],2]],[[6,[4],2,4,10],6,[5],[2,7,[7,6,3,4]]],[[7,1,[5]],10,[1,[0],[],[8,9,9,7],7]],[6,[8],1,3,10],[10,[9]]]
|
|
||||||
[[1,1,0,0],[1,[[3,10,6,9,10]],[[3,0,6,4,9],0,2]]]
|
|
||||||
|
|
||||||
[[10,[7],5,[],6],[[7,[3,10,9,1],[8],[],[1,0]],[5,8]],[7,[[4,4,0]],10,[3,[9,3,5,2,0],9]]]
|
|
||||||
[[5,[[4,8]],9,[0,[7,7,8,0,3],4,10],[10,[5,1,7,7,10]]],[],[6,5],[[],7,1,[[],[0,8,1],10],[]],[[],[],[3,10,[2,9,10,4,10],4],10,[10,[10,10,6,8,5],[5],6]]]
|
|
||||||
|
|
||||||
[[[],2,[10,[6,3,10,7],[]],[]],[],[[4,7,[],7,[]],[[1],10,[8,0],10,2],[[8,0,3,3,4],[7,2,3],[3,8,6,9],9],[],[6,8,0,[7]]],[10],[[[8,0,4,6],3,[]],0,6,[[6],5,7,9],[[4,0,7,5]]]]
|
|
||||||
[[1,[[0],[],[],5],8,6],[0,[2,6,2,[9],6],2],[[[0,4,5,5,4]],[4,5,1,6],3]]
|
|
||||||
|
|
||||||
[[[[5,4,0,9,10],[0,0,7,8,5],[4,6,7],8,5],[[5,2,0,7,3],5,[],[0,0]],[1,3,1,[2],[]],8]]
|
|
||||||
[[[1,[9,4,4],[8,1,5]],[[5,2],4,10,3,10]],[[[9,6,8]]],[[4,[6,0,2,9,8],[],[10,10,9,2,2],0]],[10,0,[]]]
|
|
||||||
|
|
||||||
[[],[[7,[10,9,10],4],[2,2,[1,0]]],[[2,[3,8,5,9,3]],[[3,2,9],[],5,8],[],[[10,2],0,[]],[[10,6,0],5]],[3,[],[],[2,5,[4,8,1,7],4],[]],[8,1,[[3,4,6,7,1],7]]]
|
|
||||||
[[1],[[[4,7,9,10],3,[5,9,7,9,10]]]]
|
|
||||||
|
|
||||||
[[1,10,[7,[],[7,6,3],10,9],[[0,10,0]],[4,6,[3]]],[[[6,2,6,3],10,[3,0,7,4]],5,10,6,[[5],6,[],9,[8,2,10,0]]],[],[[[0,8],10],8,[[1,8,1,3,6],2,[6],[7,0]],1]]
|
|
||||||
[[[3],3,[8,7,[10,8,4,3,6],2],[6,2],5]]
|
|
||||||
|
|
||||||
[[[[1,0,4,3],[9],[1],2]],[[8,9,0],[],10,8,[[5,5,6,5],6]],[[[9],0,10],1,[2,8]],[9]]
|
|
||||||
[[[2],7,0,1,5],[[[1,6,4,3,4],6,1],[],5,[],[[7,4],[4,1,8,7,0],[],6]],[0,[0,[9],[9]],[10,1,7,[]],2,[[6,5,9,1],[3],5,[5],4]],[8,10,[[10,5,4],0],[5,[10],10,[1]]],[]]
|
|
||||||
|
|
||||||
[[],[2],[1],[9,[[1,2,7]]],[[[1,1],[2],10,[7,1,0]],6]]
|
|
||||||
[[4,[[9,8]],[[9,3],1,[6]]],[[[4,2,5],[],[],2,6],3],[[[1,0,5,6],[2,6,10,5,9],[1,4,3,0,2],[10,2,9]],[5,2,7,[10,10,9,4,3]],[[3,5,8,9],[10,1,3,10],[],[2,8,1,8]],3,[]],[0,[],[[2,4],[8],[],[5,7,1,1]]],[[[],9,1,7],7]]
|
|
||||||
|
|
||||||
[[4,0,[1,10,[],0,[]],8,0],[],[],[4]]
|
|
||||||
[[4,[9],2],[9],[3]]
|
|
||||||
|
|
||||||
[[[[6,0,4,2,0],9,[7,8],8]],[],[[2,7],1,4]]
|
|
||||||
[[],[[]],[],[[[9,7],4,[0],[3,10,10,8,4]],6,5]]
|
|
||||||
|
|
||||||
[[[7]],[],[],[[],[7]],[7,[3,6,3],1]]
|
|
||||||
[[[8],[7],[3],[[3,2,4,9]],4],[[5,0,[3],[6]]],[[[9,9],[10,1,0,6,3],2]],[0,[2,8,[4,4],2],2]]
|
|
||||||
|
|
||||||
[[],[[[4,3,0,2],[2,4,10,5,3],[]],[[5,9],7,[4,6]],[[6,6],[6,9,2,4],[9,8,9],8]],[[],2,8,8]]
|
|
||||||
[[[5,9,10],[4,[10]],[[],[9],[]],[4,2,6],2],[[4,[7,3,1,9,3],[3,1,6,5],8]]]
|
|
||||||
|
|
||||||
[[[[4,0],10,3],[[6],[],10],10,6],[8,7]]
|
|
||||||
[[],[],[10,2,0],[[[3,8,7],[2,0]]],[3,5,5,1]]
|
|
||||||
|
|
||||||
[[[[8,7],4,6,[10,7,9],[1,2]],3,[[5,5,5],4,[0],0]],[6,[[2,0,2,10,2],9],[8,0,[5,5,1,7,6],[2,5,2],[]]],[[[4,5,5],2,5,[4,8]]],[10,4],[[3,[],1,3],[],[3,[9,7,0,1]]]]
|
|
||||||
[[[[9,9],9,6,8],3,[[],[],[10,8,6,7,6]],2],[[[0,5],4,7,[8,7,10],2],[[9,1],9,[4,9],6],2,5,[4,[7,6,6,4],3,8]],[[],[3,[7,7],1],10]]
|
|
||||||
|
|
||||||
[[9,[0,3,[0,6,9]],[[7,1],[4,4,3,1,9],10],1,3]]
|
|
||||||
[[8,7,8],[8,4,[]],[[[1],[4,9],[3]],6,8,[4,[6,3],[7],[1,0,10,7],10]],[2,2,0]]
|
|
||||||
|
|
||||||
[[2,10,2],[],[[[2,6,8,7],2],[7,[]]],[7,[[4]],9],[1,[3,[10,2]]]]
|
|
||||||
[[[],[]],[[3,5],[],10],[]]
|
|
||||||
|
|
||||||
[[2,6,6]]
|
|
||||||
[[8],[[4],[0,3,[]],[[8,6,0]],[10,10,8,1]],[[0,7],2,[0,10,[7,7,0,7,5],2],7],[[[2,5,7],6,4,10,2],7],[9]]
|
|
||||||
|
|
||||||
[[[9,[7,3],[9,7],1]],[[7,[6,4],1],[0],7,[]],[5,7,[[9,10,10],[10,2]]]]
|
|
||||||
[[8,[]],[[],[7,10,5,3,[5,8]],[],[[],4,2,8,[2,7,5,7,0]],[1,[9]]],[4,1,2,4,5]]
|
|
||||||
|
|
||||||
[[3,4,[]],[],[3,8,5,[4]]]
|
|
||||||
[[[5]],[],[],[[[3]],[[3,3,2,9,10],[0,6,5,7],9,2]]]
|
|
||||||
|
|
||||||
[[],[6,[10]],[[5,8,[5,7,4]],5,5],[1,[4,4,[],3,[4,1]],[[5,1,2,7],[10,6],2],[[7],0,0,[7],[1,4]],[8]]]
|
|
||||||
[[[[6,10,2],[],6,[5,1,1,1,1]],[8,2,[6,7],10,5],3],[6,[5,[9,4,3]]],[[[2,6,10],[0],9,9,[3]],9,5],[9,[9],[[4,4,10],10,6,[],[0,7]],[4,[8,1,9,5],[4]],[[0,3,7,7],[0,9,10,10]]]]
|
|
||||||
|
|
||||||
[[[],5,[3,[],9,[8,10]],2,6],[1,[6,[],6,[10,7,7,6],[3,7]],5],[7,10,[[8],[9,6],[],3,5],[[],4,2,8]],[[8,[]]],[8]]
|
|
||||||
[[9,4],[10,5],[[6,10,[0,1,1],0],7,4],[2,3,[7,8,1,1],6]]
|
|
||||||
|
|
||||||
[[],[[1,[2,1],5,[],9],6,[9,4,8],[[5,1,7],[10,1,8],0]],[8,1,[[],2,[2,8]]],[[3,[2,3,0],8,6,[]],[8,4,[8],[10,7,2,2,0]],9,1,[1,[0,8,7,1],2]],[[9,5],[[1,2],[],10,7],2]]
|
|
||||||
[[[10],6,7,4],[],[7,[0,9],[1,10,[0,10]],[[3,10],5,[9,9,8]]]]
|
|
||||||
|
|
||||||
[[[5,[0,8,0]],[[6,3,2,3,5],[8,4]],1],[[[6,6,6,2],1,[2,2],2],9,6,2],[]]
|
|
||||||
[[[],[],[[4,5],0],[10,6,7]],[[8,[9,8]]],[[[],[],3,7],[],0]]
|
|
||||||
|
|
||||||
[[],[7,4],[[5],5],[[],1,10,[0,[5,0,1,10,6],[8],1,[4]],0],[0]]
|
|
||||||
[[],[1,0,10],[]]
|
|
||||||
|
|
||||||
[[3,2,[[7,9,4,8,2],2,[1,0,9,6],10,[3,0]]],[[9,6],[[]],1,[[],5,[5,4]],[2]],[],[8,[[6],2]],[[]]]
|
|
||||||
[[0,[1],[],[[2]]],[[5,[1,0]],[[],2]],[4,[10,2,5],[[6,7,2,10,1],1,0,1]],[]]
|
|
||||||
|
|
||||||
[[0,[],[[5,3,5,3,0],[],[3,8,0,0,1],[2]]],[]]
|
|
||||||
[[[7,2],6,[8],[],[]]]
|
|
||||||
|
|
||||||
[[[10],0,0,[[0,9]]],[[0,4],[[2,9,1,3]],9],[2,[[]],[7,[0,8],8]],[6,[[6,9],10,[],[4,2],[0]]]]
|
|
||||||
[[8,[0,9]],[[2,6,8,[5],[8,1,1,9,4]],1,4],[[1,5],2]]
|
|
||||||
|
|
||||||
[[[10,[],9,7,6]],[1],[],[[8],10,[9],[]]]
|
|
||||||
[[[[9,7,7,7,0],[0,3,9,9,2],5],8,0,0],[],[[3,2,2,[2]],[2,[]],7],[[9,[7,8,9,9,10],[8,10]],6,10,[[]]],[]]
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 13: Distress Signal ---</h2><p>You climb the hill and again try contacting the Elves. However, you instead receive a signal you weren't expecting: a <em>distress signal</em>.</p>
|
|
||||||
<p>Your handheld device must still not be working properly; the packets from the distress signal got decoded <em>out of order</em>. You'll need to re-order the list of received packets (your puzzle input) to decode the message.</p>
|
|
||||||
<p>Your list consists of pairs of packets; pairs are separated by a blank line. You need to identify <em>how many pairs of packets are in the right order</em>.</p>
|
|
||||||
<p>For example:</p>
|
|
||||||
<pre><code>[1,1,3,1,1]
|
|
||||||
[1,1,5,1,1]
|
|
||||||
|
|
||||||
[[1],[2,3,4]]
|
|
||||||
[[1],4]
|
|
||||||
|
|
||||||
[9]
|
|
||||||
[[8,7,6]]
|
|
||||||
|
|
||||||
[[4,4],4,4]
|
|
||||||
[[4,4],4,4,4]
|
|
||||||
|
|
||||||
[7,7,7,7]
|
|
||||||
[7,7,7]
|
|
||||||
|
|
||||||
[]
|
|
||||||
[3]
|
|
||||||
|
|
||||||
[[[]]]
|
|
||||||
[[]]
|
|
||||||
|
|
||||||
[1,[2,[3,[4,[5,6,7]]]],8,9]
|
|
||||||
[1,[2,[3,[4,[5,6,0]]]],8,9]
|
|
||||||
</code></pre>
|
|
||||||
<p><span title="The snailfish called. They want their distress signal back.">Packet data consists of lists and integers.</span> Each list starts with <code>[</code>, ends with <code>]</code>, and contains zero or more comma-separated values (either integers or other lists). Each packet is always a list and appears on its own line.</p>
|
|
||||||
<p>When comparing two values, the first value is called <em>left</em> and the second value is called <em>right</em>. Then:</p>
|
|
||||||
<ul>
|
|
||||||
<li>If <em>both values are integers</em>, the <em>lower integer</em> should come first. If the left integer is lower than the right integer, the inputs are in the right order. If the left integer is higher than the right integer, the inputs are not in the right order. Otherwise, the inputs are the same integer; continue checking the next part of the input.</li>
|
|
||||||
<li>If <em>both values are lists</em>, compare the first value of each list, then the second value, and so on. If the left list runs out of items first, the inputs are in the right order. If the right list runs out of items first, the inputs are not in the right order. If the lists are the same length and no comparison makes a decision about the order, continue checking the next part of the input.</li>
|
|
||||||
<li>If <em>exactly one value is an integer</em>, convert the integer to a list which contains that integer as its only value, then retry the comparison. For example, if comparing <code>[0,0,0]</code> and <code>2</code>, convert the right value to <code>[2]</code> (a list containing <code>2</code>); the result is then found by instead comparing <code>[0,0,0]</code> and <code>[2]</code>.</li>
|
|
||||||
</ul>
|
|
||||||
<p>Using these rules, you can determine which of the pairs in the example are in the right order:</p>
|
|
||||||
<pre><code>== Pair 1 ==
|
|
||||||
- Compare [1,1,3,1,1] vs [1,1,5,1,1]
|
|
||||||
- Compare 1 vs 1
|
|
||||||
- Compare 1 vs 1
|
|
||||||
- Compare 3 vs 5
|
|
||||||
- Left side is smaller, so inputs are <em>in the right order</em>
|
|
||||||
|
|
||||||
== Pair 2 ==
|
|
||||||
- Compare [[1],[2,3,4]] vs [[1],4]
|
|
||||||
- Compare [1] vs [1]
|
|
||||||
- Compare 1 vs 1
|
|
||||||
- Compare [2,3,4] vs 4
|
|
||||||
- Mixed types; convert right to [4] and retry comparison
|
|
||||||
- Compare [2,3,4] vs [4]
|
|
||||||
- Compare 2 vs 4
|
|
||||||
- Left side is smaller, so inputs are <em>in the right order</em>
|
|
||||||
|
|
||||||
== Pair 3 ==
|
|
||||||
- Compare [9] vs [[8,7,6]]
|
|
||||||
- Compare 9 vs [8,7,6]
|
|
||||||
- Mixed types; convert left to [9] and retry comparison
|
|
||||||
- Compare [9] vs [8,7,6]
|
|
||||||
- Compare 9 vs 8
|
|
||||||
- Right side is smaller, so inputs are <em>not</em> in the right order
|
|
||||||
|
|
||||||
== Pair 4 ==
|
|
||||||
- Compare [[4,4],4,4] vs [[4,4],4,4,4]
|
|
||||||
- Compare [4,4] vs [4,4]
|
|
||||||
- Compare 4 vs 4
|
|
||||||
- Compare 4 vs 4
|
|
||||||
- Compare 4 vs 4
|
|
||||||
- Compare 4 vs 4
|
|
||||||
- Left side ran out of items, so inputs are <em>in the right order</em>
|
|
||||||
|
|
||||||
== Pair 5 ==
|
|
||||||
- Compare [7,7,7,7] vs [7,7,7]
|
|
||||||
- Compare 7 vs 7
|
|
||||||
- Compare 7 vs 7
|
|
||||||
- Compare 7 vs 7
|
|
||||||
- Right side ran out of items, so inputs are <em>not</em> in the right order
|
|
||||||
|
|
||||||
== Pair 6 ==
|
|
||||||
- Compare [] vs [3]
|
|
||||||
- Left side ran out of items, so inputs are <em>in the right order</em>
|
|
||||||
|
|
||||||
== Pair 7 ==
|
|
||||||
- Compare [[[]]] vs [[]]
|
|
||||||
- Compare [[]] vs []
|
|
||||||
- Right side ran out of items, so inputs are <em>not</em> in the right order
|
|
||||||
|
|
||||||
== Pair 8 ==
|
|
||||||
- Compare [1,[2,[3,[4,[5,6,7]]]],8,9] vs [1,[2,[3,[4,[5,6,0]]]],8,9]
|
|
||||||
- Compare 1 vs 1
|
|
||||||
- Compare [2,[3,[4,[5,6,7]]]] vs [2,[3,[4,[5,6,0]]]]
|
|
||||||
- Compare 2 vs 2
|
|
||||||
- Compare [3,[4,[5,6,7]]] vs [3,[4,[5,6,0]]]
|
|
||||||
- Compare 3 vs 3
|
|
||||||
- Compare [4,[5,6,7]] vs [4,[5,6,0]]
|
|
||||||
- Compare 4 vs 4
|
|
||||||
- Compare [5,6,7] vs [5,6,0]
|
|
||||||
- Compare 5 vs 5
|
|
||||||
- Compare 6 vs 6
|
|
||||||
- Compare 7 vs 0
|
|
||||||
- Right side is smaller, so inputs are <em>not</em> in the right order
|
|
||||||
</code></pre>
|
|
||||||
<p>What are the indices of the pairs that are already <em>in the right order</em>? (The first pair has index 1, the second pair has index 2, and so on.) In the above example, the pairs in the right order are 1, 2, 4, and 6; the sum of these indices is <code><em>13</em></code>.</p>
|
|
||||||
<p>Determine which pairs of packets are already in the right order. <em>What is the sum of the indices of those pairs?</em></p>
|
|
||||||
@@ -1,168 +0,0 @@
|
|||||||
519,81 -> 524,81
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
499,53 -> 499,57 -> 491,57 -> 491,63 -> 513,63 -> 513,57 -> 505,57 -> 505,53
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
540,132 -> 540,133 -> 552,133 -> 552,132
|
|
||||||
495,50 -> 495,40 -> 495,50 -> 497,50 -> 497,43 -> 497,50 -> 499,50 -> 499,43 -> 499,50 -> 501,50 -> 501,41 -> 501,50
|
|
||||||
547,139 -> 552,139
|
|
||||||
558,142 -> 563,142
|
|
||||||
501,24 -> 505,24
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
551,142 -> 556,142
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
495,50 -> 495,40 -> 495,50 -> 497,50 -> 497,43 -> 497,50 -> 499,50 -> 499,43 -> 499,50 -> 501,50 -> 501,41 -> 501,50
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
512,66 -> 512,70 -> 505,70 -> 505,78 -> 521,78 -> 521,70 -> 516,70 -> 516,66
|
|
||||||
551,164 -> 551,168 -> 546,168 -> 546,171 -> 556,171 -> 556,168 -> 555,168 -> 555,164
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
507,20 -> 511,20
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
545,148 -> 550,148
|
|
||||||
522,104 -> 526,104
|
|
||||||
499,53 -> 499,57 -> 491,57 -> 491,63 -> 513,63 -> 513,57 -> 505,57 -> 505,53
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
517,90 -> 522,90
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
538,148 -> 543,148
|
|
||||||
495,50 -> 495,40 -> 495,50 -> 497,50 -> 497,43 -> 497,50 -> 499,50 -> 499,43 -> 499,50 -> 501,50 -> 501,41 -> 501,50
|
|
||||||
548,145 -> 553,145
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
514,93 -> 514,97 -> 506,97 -> 506,101 -> 523,101 -> 523,97 -> 518,97 -> 518,93
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
528,108 -> 532,108
|
|
||||||
562,145 -> 567,145
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
514,93 -> 514,97 -> 506,97 -> 506,101 -> 523,101 -> 523,97 -> 518,97 -> 518,93
|
|
||||||
495,24 -> 499,24
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
541,116 -> 541,117 -> 549,117 -> 549,116
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
501,20 -> 505,20
|
|
||||||
512,66 -> 512,70 -> 505,70 -> 505,78 -> 521,78 -> 521,70 -> 516,70 -> 516,66
|
|
||||||
495,50 -> 495,40 -> 495,50 -> 497,50 -> 497,43 -> 497,50 -> 499,50 -> 499,43 -> 499,50 -> 501,50 -> 501,41 -> 501,50
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
554,139 -> 559,139
|
|
||||||
495,50 -> 495,40 -> 495,50 -> 497,50 -> 497,43 -> 497,50 -> 499,50 -> 499,43 -> 499,50 -> 501,50 -> 501,41 -> 501,50
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
541,116 -> 541,117 -> 549,117 -> 549,116
|
|
||||||
514,93 -> 514,97 -> 506,97 -> 506,101 -> 523,101 -> 523,97 -> 518,97 -> 518,93
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
552,148 -> 557,148
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
495,50 -> 495,40 -> 495,50 -> 497,50 -> 497,43 -> 497,50 -> 499,50 -> 499,43 -> 499,50 -> 501,50 -> 501,41 -> 501,50
|
|
||||||
495,50 -> 495,40 -> 495,50 -> 497,50 -> 497,43 -> 497,50 -> 499,50 -> 499,43 -> 499,50 -> 501,50 -> 501,41 -> 501,50
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
523,84 -> 528,84
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
495,50 -> 495,40 -> 495,50 -> 497,50 -> 497,43 -> 497,50 -> 499,50 -> 499,43 -> 499,50 -> 501,50 -> 501,41 -> 501,50
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
540,132 -> 540,133 -> 552,133 -> 552,132
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
514,93 -> 514,97 -> 506,97 -> 506,101 -> 523,101 -> 523,97 -> 518,97 -> 518,93
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
499,53 -> 499,57 -> 491,57 -> 491,63 -> 513,63 -> 513,57 -> 505,57 -> 505,53
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
540,132 -> 540,133 -> 552,133 -> 552,132
|
|
||||||
524,90 -> 529,90
|
|
||||||
544,142 -> 549,142
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
559,148 -> 564,148
|
|
||||||
499,53 -> 499,57 -> 491,57 -> 491,63 -> 513,63 -> 513,57 -> 505,57 -> 505,53
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
507,24 -> 511,24
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
499,53 -> 499,57 -> 491,57 -> 491,63 -> 513,63 -> 513,57 -> 505,57 -> 505,53
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
499,53 -> 499,57 -> 491,57 -> 491,63 -> 513,63 -> 513,57 -> 505,57 -> 505,53
|
|
||||||
512,66 -> 512,70 -> 505,70 -> 505,78 -> 521,78 -> 521,70 -> 516,70 -> 516,66
|
|
||||||
498,22 -> 502,22
|
|
||||||
525,106 -> 529,106
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
495,50 -> 495,40 -> 495,50 -> 497,50 -> 497,43 -> 497,50 -> 499,50 -> 499,43 -> 499,50 -> 501,50 -> 501,41 -> 501,50
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
551,164 -> 551,168 -> 546,168 -> 546,171 -> 556,171 -> 556,168 -> 555,168 -> 555,164
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
512,66 -> 512,70 -> 505,70 -> 505,78 -> 521,78 -> 521,70 -> 516,70 -> 516,66
|
|
||||||
510,90 -> 515,90
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
514,93 -> 514,97 -> 506,97 -> 506,101 -> 523,101 -> 523,97 -> 518,97 -> 518,93
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
494,14 -> 494,15 -> 505,15 -> 505,14
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
551,164 -> 551,168 -> 546,168 -> 546,171 -> 556,171 -> 556,168 -> 555,168 -> 555,164
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
551,164 -> 551,168 -> 546,168 -> 546,171 -> 556,171 -> 556,168 -> 555,168 -> 555,164
|
|
||||||
495,50 -> 495,40 -> 495,50 -> 497,50 -> 497,43 -> 497,50 -> 499,50 -> 499,43 -> 499,50 -> 501,50 -> 501,41 -> 501,50
|
|
||||||
555,145 -> 560,145
|
|
||||||
551,164 -> 551,168 -> 546,168 -> 546,171 -> 556,171 -> 556,168 -> 555,168 -> 555,164
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
494,14 -> 494,15 -> 505,15 -> 505,14
|
|
||||||
522,108 -> 526,108
|
|
||||||
494,14 -> 494,15 -> 505,15 -> 505,14
|
|
||||||
514,93 -> 514,97 -> 506,97 -> 506,101 -> 523,101 -> 523,97 -> 518,97 -> 518,93
|
|
||||||
504,18 -> 508,18
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
551,164 -> 551,168 -> 546,168 -> 546,171 -> 556,171 -> 556,168 -> 555,168 -> 555,164
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
512,66 -> 512,70 -> 505,70 -> 505,78 -> 521,78 -> 521,70 -> 516,70 -> 516,66
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
519,106 -> 523,106
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
510,22 -> 514,22
|
|
||||||
513,24 -> 517,24
|
|
||||||
495,50 -> 495,40 -> 495,50 -> 497,50 -> 497,43 -> 497,50 -> 499,50 -> 499,43 -> 499,50 -> 501,50 -> 501,41 -> 501,50
|
|
||||||
499,53 -> 499,57 -> 491,57 -> 491,63 -> 513,63 -> 513,57 -> 505,57 -> 505,53
|
|
||||||
527,87 -> 532,87
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
514,93 -> 514,97 -> 506,97 -> 506,101 -> 523,101 -> 523,97 -> 518,97 -> 518,93
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
531,90 -> 536,90
|
|
||||||
504,22 -> 508,22
|
|
||||||
520,87 -> 525,87
|
|
||||||
530,130 -> 530,123 -> 530,130 -> 532,130 -> 532,126 -> 532,130 -> 534,130 -> 534,128 -> 534,130 -> 536,130 -> 536,123 -> 536,130 -> 538,130 -> 538,124 -> 538,130 -> 540,130 -> 540,126 -> 540,130 -> 542,130 -> 542,122 -> 542,130 -> 544,130 -> 544,127 -> 544,130 -> 546,130 -> 546,125 -> 546,130 -> 548,130 -> 548,125 -> 548,130
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
550,136 -> 555,136
|
|
||||||
528,112 -> 542,112
|
|
||||||
516,84 -> 521,84
|
|
||||||
516,108 -> 520,108
|
|
||||||
541,145 -> 546,145
|
|
||||||
541,116 -> 541,117 -> 549,117 -> 549,116
|
|
||||||
534,161 -> 534,157 -> 534,161 -> 536,161 -> 536,154 -> 536,161 -> 538,161 -> 538,156 -> 538,161 -> 540,161 -> 540,153 -> 540,161 -> 542,161 -> 542,151 -> 542,161 -> 544,161 -> 544,160 -> 544,161 -> 546,161 -> 546,156 -> 546,161 -> 548,161 -> 548,159 -> 548,161 -> 550,161 -> 550,159 -> 550,161 -> 552,161 -> 552,159 -> 552,161
|
|
||||||
551,164 -> 551,168 -> 546,168 -> 546,171 -> 556,171 -> 556,168 -> 555,168 -> 555,164
|
|
||||||
512,66 -> 512,70 -> 505,70 -> 505,78 -> 521,78 -> 521,70 -> 516,70 -> 516,66
|
|
||||||
513,87 -> 518,87
|
|
||||||
512,66 -> 512,70 -> 505,70 -> 505,78 -> 521,78 -> 521,70 -> 516,70 -> 516,66
|
|
||||||
486,37 -> 486,34 -> 486,37 -> 488,37 -> 488,34 -> 488,37 -> 490,37 -> 490,28 -> 490,37 -> 492,37 -> 492,28 -> 492,37 -> 494,37 -> 494,30 -> 494,37 -> 496,37 -> 496,36 -> 496,37 -> 498,37 -> 498,36 -> 498,37
|
|
||||||
566,148 -> 571,148
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 14: Regolith Reservoir ---</h2><p>The distress signal leads you to a giant waterfall! Actually, hang on - the signal seems like it's coming from the waterfall itself, and that doesn't make any sense. However, you do notice a little path that leads <em>behind</em> the waterfall.</p>
|
|
||||||
<p>Correction: the distress signal leads you behind a giant waterfall! There seems to be a large cave system here, and the signal definitely leads further inside.</p>
|
|
||||||
<p>As you begin to make your way deeper underground, you feel the ground rumble for a moment. Sand begins pouring into the cave! If you don't quickly figure out where the sand is going, you could quickly become trapped!</p>
|
|
||||||
<p>Fortunately, your <a href="/2018/day/17">familiarity</a> with analyzing the path of falling material will come in handy here. You scan a two-dimensional vertical slice of the cave above you (your puzzle input) and discover that it is mostly <em>air</em> with structures made of <em>rock</em>.</p>
|
|
||||||
<p>Your scan traces the path of each solid rock structure and reports the <code>x,y</code> coordinates that form the shape of the path, where <code>x</code> represents distance to the right and <code>y</code> represents distance down. Each path appears as a single line of text in your scan. After the first point of each path, each point indicates the end of a straight horizontal or vertical line to be drawn from the previous point. For example:</p>
|
|
||||||
<pre><code>498,4 -> 498,6 -> 496,6
|
|
||||||
503,4 -> 502,4 -> 502,9 -> 494,9
|
|
||||||
</code></pre>
|
|
||||||
<p>This scan means that there are two paths of rock; the first path consists of two straight lines, and the second path consists of three straight lines. (Specifically, the first path consists of a line of rock from <code>498,4</code> through <code>498,6</code> and another line of rock from <code>498,6</code> through <code>496,6</code>.)</p>
|
|
||||||
<p>The sand is pouring into the cave from point <code>500,0</code>.</p>
|
|
||||||
<p>Drawing rock as <code>#</code>, air as <code>.</code>, and the source of the sand as <code>+</code>, this becomes:</p>
|
|
||||||
<pre><code>
|
|
||||||
4 5 5
|
|
||||||
9 0 0
|
|
||||||
4 0 3
|
|
||||||
0 ......+...
|
|
||||||
1 ..........
|
|
||||||
2 ..........
|
|
||||||
3 ..........
|
|
||||||
4 ....#...##
|
|
||||||
5 ....#...#.
|
|
||||||
6 ..###...#.
|
|
||||||
7 ........#.
|
|
||||||
8 ........#.
|
|
||||||
9 #########.
|
|
||||||
</code></pre>
|
|
||||||
<p>Sand is produced <em>one unit at a time</em>, and the next unit of sand is not produced until the previous unit of sand <em>comes to rest</em>. A unit of sand is large enough to fill one tile of air in your scan.</p>
|
|
||||||
<p>A unit of sand always falls <em>down one step</em> if possible. If the tile immediately below is blocked (by rock or sand), the unit of sand attempts to instead move diagonally <em>one step down and to the left</em>. If that tile is blocked, the unit of sand attempts to instead move diagonally <em>one step down and to the right</em>. Sand keeps moving as long as it is able to do so, at each step trying to move down, then down-left, then down-right. If all three possible destinations are blocked, the unit of sand <em>comes to rest</em> and no longer moves, at which point the next unit of sand is created back at the source.</p>
|
|
||||||
<p>So, drawing sand that has come to rest as <code>o</code>, the first unit of sand simply falls straight down and then stops:</p>
|
|
||||||
<pre><code>......+...
|
|
||||||
..........
|
|
||||||
..........
|
|
||||||
..........
|
|
||||||
....#...##
|
|
||||||
....#...#.
|
|
||||||
..###...#.
|
|
||||||
........#.
|
|
||||||
......<em>o</em>.#.
|
|
||||||
#########.
|
|
||||||
</code></pre>
|
|
||||||
<p>The second unit of sand then falls straight down, lands on the first one, and then comes to rest to its left:</p>
|
|
||||||
<pre><code>......+...
|
|
||||||
..........
|
|
||||||
..........
|
|
||||||
..........
|
|
||||||
....#...##
|
|
||||||
....#...#.
|
|
||||||
..###...#.
|
|
||||||
........#.
|
|
||||||
.....oo.#.
|
|
||||||
#########.
|
|
||||||
</code></pre>
|
|
||||||
<p>After a total of five units of sand have come to rest, they form this pattern:</p>
|
|
||||||
<pre><code>......+...
|
|
||||||
..........
|
|
||||||
..........
|
|
||||||
..........
|
|
||||||
....#...##
|
|
||||||
....#...#.
|
|
||||||
..###...#.
|
|
||||||
......o.#.
|
|
||||||
....oooo#.
|
|
||||||
#########.
|
|
||||||
</code></pre>
|
|
||||||
<p>After a total of 22 units of sand:</p>
|
|
||||||
<pre><code>......+...
|
|
||||||
..........
|
|
||||||
......o...
|
|
||||||
.....ooo..
|
|
||||||
....#ooo##
|
|
||||||
....#ooo#.
|
|
||||||
..###ooo#.
|
|
||||||
....oooo#.
|
|
||||||
...ooooo#.
|
|
||||||
#########.
|
|
||||||
</code></pre>
|
|
||||||
<p>Finally, only two more units of sand can possibly come to rest:</p>
|
|
||||||
<pre><code>......+...
|
|
||||||
..........
|
|
||||||
......o...
|
|
||||||
.....ooo..
|
|
||||||
....#ooo##
|
|
||||||
...<em>o</em>#ooo#.
|
|
||||||
..###ooo#.
|
|
||||||
....oooo#.
|
|
||||||
.<em>o</em>.ooooo#.
|
|
||||||
#########.
|
|
||||||
</code></pre>
|
|
||||||
<p>Once all <code><em>24</em></code> units of sand shown above have come to rest, all further sand flows out the bottom, falling into the endless void. Just for fun, the path any new sand takes before falling forever is shown here with <code>~</code>:</p>
|
|
||||||
<pre><code>.......+...
|
|
||||||
.......~...
|
|
||||||
......~o...
|
|
||||||
.....~ooo..
|
|
||||||
....~#ooo##
|
|
||||||
...~o#ooo#.
|
|
||||||
..~###ooo#.
|
|
||||||
..~..oooo#.
|
|
||||||
.~o.ooooo#.
|
|
||||||
~#########.
|
|
||||||
~..........
|
|
||||||
~..........
|
|
||||||
~..........
|
|
||||||
</code></pre>
|
|
||||||
<p>Using your scan, simulate the falling sand. <em>How many units of sand come to rest before sand starts flowing into the abyss below?</em></p>
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
Sensor at x=2885528, y=2847539: closest beacon is at x=2966570, y=2470834
|
|
||||||
Sensor at x=2224704, y=1992385: closest beacon is at x=2018927, y=2000000
|
|
||||||
Sensor at x=3829144, y=1633329: closest beacon is at x=2966570, y=2470834
|
|
||||||
Sensor at x=43913, y=426799: closest beacon is at x=152363, y=369618
|
|
||||||
Sensor at x=2257417, y=2118161: closest beacon is at x=2386559, y=2090397
|
|
||||||
Sensor at x=8318, y=3994839: closest beacon is at x=-266803, y=2440278
|
|
||||||
Sensor at x=69961, y=586273: closest beacon is at x=152363, y=369618
|
|
||||||
Sensor at x=3931562, y=3361721: closest beacon is at x=3580400, y=3200980
|
|
||||||
Sensor at x=476279, y=3079924: closest beacon is at x=-266803, y=2440278
|
|
||||||
Sensor at x=2719185, y=2361091: closest beacon is at x=2966570, y=2470834
|
|
||||||
Sensor at x=2533382, y=3320911: closest beacon is at x=2260632, y=3415930
|
|
||||||
Sensor at x=3112735, y=3334946: closest beacon is at x=3580400, y=3200980
|
|
||||||
Sensor at x=1842258, y=3998928: closest beacon is at x=2260632, y=3415930
|
|
||||||
Sensor at x=3712771, y=3760832: closest beacon is at x=3580400, y=3200980
|
|
||||||
Sensor at x=1500246, y=2684955: closest beacon is at x=2018927, y=2000000
|
|
||||||
Sensor at x=3589321, y=142859: closest beacon is at x=4547643, y=-589891
|
|
||||||
Sensor at x=1754684, y=2330721: closest beacon is at x=2018927, y=2000000
|
|
||||||
Sensor at x=2476631, y=3679883: closest beacon is at x=2260632, y=3415930
|
|
||||||
Sensor at x=27333, y=274008: closest beacon is at x=152363, y=369618
|
|
||||||
Sensor at x=158732, y=2405833: closest beacon is at x=-266803, y=2440278
|
|
||||||
Sensor at x=2955669, y=3976939: closest beacon is at x=3035522, y=4959118
|
|
||||||
Sensor at x=1744196, y=13645: closest beacon is at x=152363, y=369618
|
|
||||||
Sensor at x=981165, y=1363480: closest beacon is at x=2018927, y=2000000
|
|
||||||
Sensor at x=2612279, y=2151377: closest beacon is at x=2386559, y=2090397
|
|
||||||
Sensor at x=3897, y=2076376: closest beacon is at x=-266803, y=2440278
|
|
||||||
Sensor at x=2108479, y=1928318: closest beacon is at x=2018927, y=2000000
|
|
||||||
Sensor at x=1913043, y=3017841: closest beacon is at x=2260632, y=3415930
|
|
||||||
Sensor at x=2446778, y=785075: closest beacon is at x=2386559, y=2090397
|
|
||||||
Sensor at x=2385258, y=2774943: closest beacon is at x=2386559, y=2090397
|
|
||||||
Sensor at x=3337656, y=2916144: closest beacon is at x=3580400, y=3200980
|
|
||||||
Sensor at x=380595, y=66906: closest beacon is at x=152363, y=369618
|
|
||||||
Sensor at x=1593628, y=3408455: closest beacon is at x=2260632, y=3415930
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 15: Beacon Exclusion Zone ---</h2><p>You feel the ground rumble again as the distress signal leads you to a large network of subterranean tunnels. You don't have time to search them all, but you don't need to: your pack contains a set of deployable <em>sensors</em> that you imagine were originally built to locate lost Elves.</p>
|
|
||||||
<p>The sensors aren't very powerful, but that's okay; your handheld device indicates that you're close enough to the source of the distress signal to use them. You pull the emergency sensor system out of your pack, hit the big button on top, and the sensors zoom off down the tunnels.</p>
|
|
||||||
<p>Once a sensor finds a spot it thinks will give it a good reading, it attaches itself to a hard surface and begins monitoring for the nearest signal source <em>beacon</em>. Sensors and beacons always exist at integer coordinates. Each sensor knows its own position and can <em>determine the position of a beacon precisely</em>; however, sensors can only lock on to the one beacon <em>closest to the sensor</em> as measured by the <a href="https://en.wikipedia.org/wiki/Taxicab_geometry" target="_blank">Manhattan distance</a>. (There is never a tie where two beacons are the same distance to a sensor.)</p>
|
|
||||||
<p>It doesn't take long for the sensors to report back their positions and closest beacons (your puzzle input). For example:</p>
|
|
||||||
<pre><code>Sensor at x=2, y=18: closest beacon is at x=-2, y=15
|
|
||||||
Sensor at x=9, y=16: closest beacon is at x=10, y=16
|
|
||||||
Sensor at x=13, y=2: closest beacon is at x=15, y=3
|
|
||||||
Sensor at x=12, y=14: closest beacon is at x=10, y=16
|
|
||||||
Sensor at x=10, y=20: closest beacon is at x=10, y=16
|
|
||||||
Sensor at x=14, y=17: closest beacon is at x=10, y=16
|
|
||||||
Sensor at x=8, y=7: closest beacon is at x=2, y=10
|
|
||||||
Sensor at x=2, y=0: closest beacon is at x=2, y=10
|
|
||||||
Sensor at x=0, y=11: closest beacon is at x=2, y=10
|
|
||||||
Sensor at x=20, y=14: closest beacon is at x=25, y=17
|
|
||||||
Sensor at x=17, y=20: closest beacon is at x=21, y=22
|
|
||||||
Sensor at x=16, y=7: closest beacon is at x=15, y=3
|
|
||||||
Sensor at x=14, y=3: closest beacon is at x=15, y=3
|
|
||||||
Sensor at x=20, y=1: closest beacon is at x=15, y=3
|
|
||||||
</code></pre>
|
|
||||||
<p>So, consider the sensor at <code>2,18</code>; the closest beacon to it is at <code>-2,15</code>. For the sensor at <code>9,16</code>, the closest beacon to it is at <code>10,16</code>.</p>
|
|
||||||
<p>Drawing sensors as <code>S</code> and beacons as <code>B</code>, the above arrangement of sensors and beacons looks like this:</p>
|
|
||||||
<pre><code> 1 1 2 2
|
|
||||||
0 5 0 5 0 5
|
|
||||||
0 ....S.......................
|
|
||||||
1 ......................S.....
|
|
||||||
2 ...............S............
|
|
||||||
3 ................SB..........
|
|
||||||
4 ............................
|
|
||||||
5 ............................
|
|
||||||
6 ............................
|
|
||||||
7 ..........S.......S.........
|
|
||||||
8 ............................
|
|
||||||
9 ............................
|
|
||||||
10 ....B.......................
|
|
||||||
11 ..S.........................
|
|
||||||
12 ............................
|
|
||||||
13 ............................
|
|
||||||
14 ..............S.......S.....
|
|
||||||
15 B...........................
|
|
||||||
16 ...........SB...............
|
|
||||||
17 ................S..........B
|
|
||||||
18 ....S.......................
|
|
||||||
19 ............................
|
|
||||||
20 ............S......S........
|
|
||||||
21 ............................
|
|
||||||
22 .......................B....
|
|
||||||
</code></pre>
|
|
||||||
<p>This isn't necessarily a comprehensive map of all beacons in the area, though. Because each sensor only identifies its closest beacon, if a sensor detects a beacon, you know there are no other beacons that close or closer to that sensor. There could still be beacons that just happen to not be the closest beacon to any sensor. Consider the sensor at <code>8,7</code>:</p>
|
|
||||||
<pre><code> 1 1 2 2
|
|
||||||
0 5 0 5 0 5
|
|
||||||
-2 ..........#.................
|
|
||||||
-1 .........###................
|
|
||||||
0 ....S...#####...............
|
|
||||||
1 .......#######........S.....
|
|
||||||
2 ......#########S............
|
|
||||||
3 .....###########SB..........
|
|
||||||
4 ....#############...........
|
|
||||||
5 ...###############..........
|
|
||||||
6 ..#################.........
|
|
||||||
7 .#########<em>S</em>#######S#........
|
|
||||||
8 ..#################.........
|
|
||||||
9 ...###############..........
|
|
||||||
10 ....<em>B</em>############...........
|
|
||||||
11 ..S..###########............
|
|
||||||
12 ......#########.............
|
|
||||||
13 .......#######..............
|
|
||||||
14 ........#####.S.......S.....
|
|
||||||
15 B........###................
|
|
||||||
16 ..........#SB...............
|
|
||||||
17 ................S..........B
|
|
||||||
18 ....S.......................
|
|
||||||
19 ............................
|
|
||||||
20 ............S......S........
|
|
||||||
21 ............................
|
|
||||||
22 .......................B....
|
|
||||||
</code></pre>
|
|
||||||
<p>This sensor's closest beacon is at <code>2,10</code>, and so you know there are no beacons that close or closer (in any positions marked <code>#</code>).</p>
|
|
||||||
<p>None of the detected beacons seem to be producing the distress signal, so you'll need to <span title=""When you have eliminated all which is impossible, then whatever remains, however improbable, must be where the missing beacon is." - Sherlock Holmes">work out</span> where the distress beacon is by working out where it <em>isn't</em>. For now, keep things simple by counting the positions where a beacon cannot possibly be along just a single row.</p>
|
|
||||||
<p>So, suppose you have an arrangement of beacons and sensors like in the example above and, just in the row where <code>y=10</code>, you'd like to count the number of positions a beacon cannot possibly exist. The coverage from all sensors near that row looks like this:</p>
|
|
||||||
<pre><code> 1 1 2 2
|
|
||||||
0 5 0 5 0 5
|
|
||||||
9 ...#########################...
|
|
||||||
<em>10 ..####B######################..</em>
|
|
||||||
11 .###S#############.###########.
|
|
||||||
</code></pre>
|
|
||||||
<p>In this example, in the row where <code>y=10</code>, there are <code><em>26</em></code> positions where a beacon cannot be present.</p>
|
|
||||||
<p>Consult the report from the sensors you just deployed. <em>In the row where <code>y=2000000</code>, how many positions cannot contain a beacon?</em></p>
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
Valve RU has flow rate=0; tunnels lead to valves YH, ID
|
|
||||||
Valve QK has flow rate=24; tunnels lead to valves PQ, PP
|
|
||||||
Valve RP has flow rate=11; tunnels lead to valves RM, BA, RI, EM
|
|
||||||
Valve BX has flow rate=0; tunnels lead to valves ZX, VK
|
|
||||||
Valve JL has flow rate=0; tunnels lead to valves ID, LC
|
|
||||||
Valve DC has flow rate=25; tunnel leads to valve ST
|
|
||||||
Valve HX has flow rate=0; tunnels lead to valves DH, FE
|
|
||||||
Valve KJ has flow rate=0; tunnels lead to valves ZK, XN
|
|
||||||
Valve EM has flow rate=0; tunnels lead to valves AW, RP
|
|
||||||
Valve XN has flow rate=7; tunnels lead to valves LH, KJ, KU, AO
|
|
||||||
Valve DH has flow rate=9; tunnels lead to valves SY, CC, QL, LH, HX
|
|
||||||
Valve LH has flow rate=0; tunnels lead to valves XN, DH
|
|
||||||
Valve PP has flow rate=0; tunnels lead to valves QK, TA
|
|
||||||
Valve AO has flow rate=0; tunnels lead to valves AA, XN
|
|
||||||
Valve SY has flow rate=0; tunnels lead to valves DH, AA
|
|
||||||
Valve MZ has flow rate=0; tunnels lead to valves JT, PF
|
|
||||||
Valve AA has flow rate=0; tunnels lead to valves JN, UN, WG, SY, AO
|
|
||||||
Valve RM has flow rate=0; tunnels lead to valves XL, RP
|
|
||||||
Valve BA has flow rate=0; tunnels lead to valves RP, YP
|
|
||||||
Valve AD has flow rate=12; tunnels lead to valves LK, ZX, AW
|
|
||||||
Valve ZN has flow rate=0; tunnels lead to valves EQ, HL
|
|
||||||
Valve EX has flow rate=18; tunnel leads to valve RB
|
|
||||||
Valve CR has flow rate=0; tunnels lead to valves TA, ST
|
|
||||||
Valve WG has flow rate=0; tunnels lead to valves AA, TA
|
|
||||||
Valve UN has flow rate=0; tunnels lead to valves WK, AA
|
|
||||||
Valve VE has flow rate=0; tunnels lead to valves JA, KW
|
|
||||||
Valve JA has flow rate=19; tunnels lead to valves PQ, VE
|
|
||||||
Valve AW has flow rate=0; tunnels lead to valves AD, EM
|
|
||||||
Valve XL has flow rate=0; tunnels lead to valves RM, PF
|
|
||||||
Valve OD has flow rate=0; tunnels lead to valves VK, RI
|
|
||||||
Valve FE has flow rate=0; tunnels lead to valves JT, HX
|
|
||||||
Valve PQ has flow rate=0; tunnels lead to valves JA, QK
|
|
||||||
Valve RB has flow rate=0; tunnels lead to valves CC, EX
|
|
||||||
Valve JT has flow rate=3; tunnels lead to valves RF, MZ, ZK, FE, DD
|
|
||||||
Valve YP has flow rate=0; tunnels lead to valves ID, BA
|
|
||||||
Valve ID has flow rate=14; tunnels lead to valves JL, RU, YP
|
|
||||||
Valve YH has flow rate=0; tunnels lead to valves RU, VK
|
|
||||||
Valve TA has flow rate=21; tunnels lead to valves WG, KU, PP, RF, CR
|
|
||||||
Valve LK has flow rate=0; tunnels lead to valves PF, AD
|
|
||||||
Valve DD has flow rate=0; tunnels lead to valves JN, JT
|
|
||||||
Valve HL has flow rate=0; tunnels lead to valves ZN, DW
|
|
||||||
Valve VK has flow rate=22; tunnels lead to valves OD, KW, BX, YH
|
|
||||||
Valve RF has flow rate=0; tunnels lead to valves JT, TA
|
|
||||||
Valve CC has flow rate=0; tunnels lead to valves RB, DH
|
|
||||||
Valve KW has flow rate=0; tunnels lead to valves VE, VK
|
|
||||||
Valve PF has flow rate=10; tunnels lead to valves WK, MZ, QL, XL, LK
|
|
||||||
Valve ZX has flow rate=0; tunnels lead to valves AD, BX
|
|
||||||
Valve JN has flow rate=0; tunnels lead to valves DD, AA
|
|
||||||
Valve ST has flow rate=0; tunnels lead to valves CR, DC
|
|
||||||
Valve WK has flow rate=0; tunnels lead to valves PF, UN
|
|
||||||
Valve DW has flow rate=13; tunnels lead to valves LC, HL
|
|
||||||
Valve ZK has flow rate=0; tunnels lead to valves KJ, JT
|
|
||||||
Valve QL has flow rate=0; tunnels lead to valves DH, PF
|
|
||||||
Valve RI has flow rate=0; tunnels lead to valves OD, RP
|
|
||||||
Valve EQ has flow rate=23; tunnel leads to valve ZN
|
|
||||||
Valve LC has flow rate=0; tunnels lead to valves JL, DW
|
|
||||||
Valve KU has flow rate=0; tunnels lead to valves XN, TA
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 16: Proboscidea Volcanium ---</h2><p>The sensors have led you to the origin of the distress signal: yet another handheld device, just like the one the Elves gave you. However, you don't see any Elves around; instead, the device is surrounded by elephants! They must have gotten lost in these tunnels, and one of the elephants apparently figured out how to turn on the distress signal.</p>
|
|
||||||
<p>The ground rumbles again, much stronger this time. What kind of cave is this, exactly? You scan the cave with your handheld device; it reports mostly igneous rock, some ash, pockets of pressurized gas, magma... this isn't just a cave, it's a volcano!</p>
|
|
||||||
<p>You need to get the elephants out of here, quickly. Your device estimates that you have <em>30 minutes</em> before the volcano erupts, so you don't have time to go back out the way you came in.</p>
|
|
||||||
<p>You scan the cave for other options and discover a network of pipes and pressure-release <em>valves</em>. You aren't sure how such a system got into a volcano, but you don't have time to complain; your device produces a report (your puzzle input) of each valve's <em>flow rate</em> if it were opened (in pressure per minute) and the tunnels you could use to move between the valves.</p>
|
|
||||||
<p>There's even a valve in the room you and the elephants are currently standing in labeled <code>AA</code>. You estimate it will take you one minute to open a single valve and one minute to follow any tunnel from one valve to another. What is the most pressure you could release?</p>
|
|
||||||
<p>For example, suppose you had the following scan output:</p>
|
|
||||||
<pre><code>Valve AA has flow rate=0; tunnels lead to valves DD, II, BB
|
|
||||||
Valve BB has flow rate=13; tunnels lead to valves CC, AA
|
|
||||||
Valve CC has flow rate=2; tunnels lead to valves DD, BB
|
|
||||||
Valve DD has flow rate=20; tunnels lead to valves CC, AA, EE
|
|
||||||
Valve EE has flow rate=3; tunnels lead to valves FF, DD
|
|
||||||
Valve FF has flow rate=0; tunnels lead to valves EE, GG
|
|
||||||
Valve GG has flow rate=0; tunnels lead to valves FF, HH
|
|
||||||
Valve HH has flow rate=22; tunnel leads to valve GG
|
|
||||||
Valve II has flow rate=0; tunnels lead to valves AA, JJ
|
|
||||||
Valve JJ has flow rate=21; tunnel leads to valve II
|
|
||||||
</code></pre>
|
|
||||||
<p>All of the valves begin <em>closed</em>. You start at valve <code>AA</code>, but it must be damaged or <span title="Wait, sir! The valve, sir! it appears to be... jammed!">jammed</span> or something: its flow rate is <code>0</code>, so there's no point in opening it. However, you could spend one minute moving to valve <code>BB</code> and another minute opening it; doing so would release pressure during the remaining <em>28 minutes</em> at a flow rate of <code>13</code>, a total eventual pressure release of <code>28 * 13 = <em>364</em></code>. Then, you could spend your third minute moving to valve <code>CC</code> and your fourth minute opening it, providing an additional <em>26 minutes</em> of eventual pressure release at a flow rate of <code>2</code>, or <code><em>52</em></code> total pressure released by valve <code>CC</code>.</p>
|
|
||||||
<p>Making your way through the tunnels like this, you could probably open many or all of the valves by the time 30 minutes have elapsed. However, you need to release as much pressure as possible, so you'll need to be methodical. Instead, consider this approach:</p>
|
|
||||||
<pre><code>== Minute 1 ==
|
|
||||||
No valves are open.
|
|
||||||
You move to valve DD.
|
|
||||||
|
|
||||||
== Minute 2 ==
|
|
||||||
No valves are open.
|
|
||||||
You open valve DD.
|
|
||||||
|
|
||||||
== Minute 3 ==
|
|
||||||
Valve DD is open, releasing <em>20</em> pressure.
|
|
||||||
You move to valve CC.
|
|
||||||
|
|
||||||
== Minute 4 ==
|
|
||||||
Valve DD is open, releasing <em>20</em> pressure.
|
|
||||||
You move to valve BB.
|
|
||||||
|
|
||||||
== Minute 5 ==
|
|
||||||
Valve DD is open, releasing <em>20</em> pressure.
|
|
||||||
You open valve BB.
|
|
||||||
|
|
||||||
== Minute 6 ==
|
|
||||||
Valves BB and DD are open, releasing <em>33</em> pressure.
|
|
||||||
You move to valve AA.
|
|
||||||
|
|
||||||
== Minute 7 ==
|
|
||||||
Valves BB and DD are open, releasing <em>33</em> pressure.
|
|
||||||
You move to valve II.
|
|
||||||
|
|
||||||
== Minute 8 ==
|
|
||||||
Valves BB and DD are open, releasing <em>33</em> pressure.
|
|
||||||
You move to valve JJ.
|
|
||||||
|
|
||||||
== Minute 9 ==
|
|
||||||
Valves BB and DD are open, releasing <em>33</em> pressure.
|
|
||||||
You open valve JJ.
|
|
||||||
|
|
||||||
== Minute 10 ==
|
|
||||||
Valves BB, DD, and JJ are open, releasing <em>54</em> pressure.
|
|
||||||
You move to valve II.
|
|
||||||
|
|
||||||
== Minute 11 ==
|
|
||||||
Valves BB, DD, and JJ are open, releasing <em>54</em> pressure.
|
|
||||||
You move to valve AA.
|
|
||||||
|
|
||||||
== Minute 12 ==
|
|
||||||
Valves BB, DD, and JJ are open, releasing <em>54</em> pressure.
|
|
||||||
You move to valve DD.
|
|
||||||
|
|
||||||
== Minute 13 ==
|
|
||||||
Valves BB, DD, and JJ are open, releasing <em>54</em> pressure.
|
|
||||||
You move to valve EE.
|
|
||||||
|
|
||||||
== Minute 14 ==
|
|
||||||
Valves BB, DD, and JJ are open, releasing <em>54</em> pressure.
|
|
||||||
You move to valve FF.
|
|
||||||
|
|
||||||
== Minute 15 ==
|
|
||||||
Valves BB, DD, and JJ are open, releasing <em>54</em> pressure.
|
|
||||||
You move to valve GG.
|
|
||||||
|
|
||||||
== Minute 16 ==
|
|
||||||
Valves BB, DD, and JJ are open, releasing <em>54</em> pressure.
|
|
||||||
You move to valve HH.
|
|
||||||
|
|
||||||
== Minute 17 ==
|
|
||||||
Valves BB, DD, and JJ are open, releasing <em>54</em> pressure.
|
|
||||||
You open valve HH.
|
|
||||||
|
|
||||||
== Minute 18 ==
|
|
||||||
Valves BB, DD, HH, and JJ are open, releasing <em>76</em> pressure.
|
|
||||||
You move to valve GG.
|
|
||||||
|
|
||||||
== Minute 19 ==
|
|
||||||
Valves BB, DD, HH, and JJ are open, releasing <em>76</em> pressure.
|
|
||||||
You move to valve FF.
|
|
||||||
|
|
||||||
== Minute 20 ==
|
|
||||||
Valves BB, DD, HH, and JJ are open, releasing <em>76</em> pressure.
|
|
||||||
You move to valve EE.
|
|
||||||
|
|
||||||
== Minute 21 ==
|
|
||||||
Valves BB, DD, HH, and JJ are open, releasing <em>76</em> pressure.
|
|
||||||
You open valve EE.
|
|
||||||
|
|
||||||
== Minute 22 ==
|
|
||||||
Valves BB, DD, EE, HH, and JJ are open, releasing <em>79</em> pressure.
|
|
||||||
You move to valve DD.
|
|
||||||
|
|
||||||
== Minute 23 ==
|
|
||||||
Valves BB, DD, EE, HH, and JJ are open, releasing <em>79</em> pressure.
|
|
||||||
You move to valve CC.
|
|
||||||
|
|
||||||
== Minute 24 ==
|
|
||||||
Valves BB, DD, EE, HH, and JJ are open, releasing <em>79</em> pressure.
|
|
||||||
You open valve CC.
|
|
||||||
|
|
||||||
== Minute 25 ==
|
|
||||||
Valves BB, CC, DD, EE, HH, and JJ are open, releasing <em>81</em> pressure.
|
|
||||||
|
|
||||||
== Minute 26 ==
|
|
||||||
Valves BB, CC, DD, EE, HH, and JJ are open, releasing <em>81</em> pressure.
|
|
||||||
|
|
||||||
== Minute 27 ==
|
|
||||||
Valves BB, CC, DD, EE, HH, and JJ are open, releasing <em>81</em> pressure.
|
|
||||||
|
|
||||||
== Minute 28 ==
|
|
||||||
Valves BB, CC, DD, EE, HH, and JJ are open, releasing <em>81</em> pressure.
|
|
||||||
|
|
||||||
== Minute 29 ==
|
|
||||||
Valves BB, CC, DD, EE, HH, and JJ are open, releasing <em>81</em> pressure.
|
|
||||||
|
|
||||||
== Minute 30 ==
|
|
||||||
Valves BB, CC, DD, EE, HH, and JJ are open, releasing <em>81</em> pressure.
|
|
||||||
</code></pre>
|
|
||||||
<p>This approach lets you release the most pressure possible in 30 minutes with this valve layout, <code><em>1651</em></code>.</p>
|
|
||||||
<p>Work out the steps to release the most pressure in 30 minutes. <em>What is the most pressure you can release?</em></p>
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,324 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 17: Pyroclastic Flow ---</h2><p>Your handheld device has located an alternative exit from the cave for you and the elephants. The ground is rumbling almost continuously now, but the strange valves bought you some time. It's definitely getting warmer in here, though.</p>
|
|
||||||
<p>The tunnels eventually open into a very tall, narrow chamber. Large, oddly-shaped rocks are falling into the chamber from above, presumably due to all the rumbling. If you can't work out where the rocks will fall next, you might be <span title="I am the man who arranges the blocks / that descend upon me from up above!">crushed</span>!</p>
|
|
||||||
<p>The five types of rocks have the following peculiar shapes, where <code>#</code> is rock and <code>.</code> is empty space:</p>
|
|
||||||
<pre><code>####
|
|
||||||
|
|
||||||
.#.
|
|
||||||
###
|
|
||||||
.#.
|
|
||||||
|
|
||||||
..#
|
|
||||||
..#
|
|
||||||
###
|
|
||||||
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
##
|
|
||||||
##
|
|
||||||
</code></pre>
|
|
||||||
<p>The rocks fall in the order shown above: first the <code>-</code> shape, then the <code>+</code> shape, and so on. Once the end of the list is reached, the same order repeats: the <code>-</code> shape falls first, sixth, 11th, 16th, etc.</p>
|
|
||||||
<p>The rocks don't spin, but they do get pushed around by jets of hot gas coming out of the walls themselves. A quick scan reveals the effect the jets of hot gas will have on the rocks as they fall (your puzzle input).</p>
|
|
||||||
<p>For example, suppose this was the jet pattern in your cave:</p>
|
|
||||||
<pre><code>>>><<><>><<<>><>>><<<>>><<<><<<>><>><<>>
|
|
||||||
</code></pre>
|
|
||||||
<p>In jet patterns, <code><</code> means a push to the left, while <code>></code> means a push to the right. The pattern above means that the jets will push a falling rock right, then right, then right, then left, then left, then right, and so on. If the end of the list is reached, it repeats.</p>
|
|
||||||
<p>The tall, vertical chamber is exactly <em>seven units wide</em>. Each rock appears so that its left edge is two units away from the left wall and its bottom edge is three units above the highest rock in the room (or the floor, if there isn't one).</p>
|
|
||||||
<p>After a rock appears, it alternates between <em>being pushed by a jet of hot gas</em> one unit (in the direction indicated by the next symbol in the jet pattern) and then <em>falling one unit down</em>. If any movement would cause any part of the rock to move into the walls, floor, or a stopped rock, the movement instead does not occur. If a <em>downward</em> movement would have caused a falling rock to move into the floor or an already-fallen rock, the falling rock stops where it is (having landed on something) and a new rock immediately begins falling.</p>
|
|
||||||
<p>Drawing falling rocks with <code>@</code> and stopped rocks with <code>#</code>, the jet pattern in the example above manifests as follows:</p>
|
|
||||||
<pre><code>The first rock begins falling:
|
|
||||||
|..@@@@.|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Jet of gas pushes rock right:
|
|
||||||
|...@@@@|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Rock falls 1 unit:
|
|
||||||
|...@@@@|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Jet of gas pushes rock right, but nothing happens:
|
|
||||||
|...@@@@|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Rock falls 1 unit:
|
|
||||||
|...@@@@|
|
|
||||||
|.......|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Jet of gas pushes rock right, but nothing happens:
|
|
||||||
|...@@@@|
|
|
||||||
|.......|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Rock falls 1 unit:
|
|
||||||
|...@@@@|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Jet of gas pushes rock left:
|
|
||||||
|..@@@@.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Rock falls 1 unit, causing it to come to rest:
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
A new rock begins falling:
|
|
||||||
|...@...|
|
|
||||||
|..@@@..|
|
|
||||||
|...@...|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Jet of gas pushes rock left:
|
|
||||||
|..@....|
|
|
||||||
|.@@@...|
|
|
||||||
|..@....|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Rock falls 1 unit:
|
|
||||||
|..@....|
|
|
||||||
|.@@@...|
|
|
||||||
|..@....|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Jet of gas pushes rock right:
|
|
||||||
|...@...|
|
|
||||||
|..@@@..|
|
|
||||||
|...@...|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Rock falls 1 unit:
|
|
||||||
|...@...|
|
|
||||||
|..@@@..|
|
|
||||||
|...@...|
|
|
||||||
|.......|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Jet of gas pushes rock left:
|
|
||||||
|..@....|
|
|
||||||
|.@@@...|
|
|
||||||
|..@....|
|
|
||||||
|.......|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Rock falls 1 unit:
|
|
||||||
|..@....|
|
|
||||||
|.@@@...|
|
|
||||||
|..@....|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Jet of gas pushes rock right:
|
|
||||||
|...@...|
|
|
||||||
|..@@@..|
|
|
||||||
|...@...|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
Rock falls 1 unit, causing it to come to rest:
|
|
||||||
|...#...|
|
|
||||||
|..###..|
|
|
||||||
|...#...|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
A new rock begins falling:
|
|
||||||
|....@..|
|
|
||||||
|....@..|
|
|
||||||
|..@@@..|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|...#...|
|
|
||||||
|..###..|
|
|
||||||
|...#...|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
</code></pre>
|
|
||||||
<p>The moment each of the next few rocks begins falling, you would see this:</p>
|
|
||||||
<pre><code>|..@....|
|
|
||||||
|..@....|
|
|
||||||
|..@....|
|
|
||||||
|..@....|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|..#....|
|
|
||||||
|..#....|
|
|
||||||
|####...|
|
|
||||||
|..###..|
|
|
||||||
|...#...|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
|..@@...|
|
|
||||||
|..@@...|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|....#..|
|
|
||||||
|..#.#..|
|
|
||||||
|..#.#..|
|
|
||||||
|#####..|
|
|
||||||
|..###..|
|
|
||||||
|...#...|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
|..@@@@.|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|....##.|
|
|
||||||
|....##.|
|
|
||||||
|....#..|
|
|
||||||
|..#.#..|
|
|
||||||
|..#.#..|
|
|
||||||
|#####..|
|
|
||||||
|..###..|
|
|
||||||
|...#...|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
|...@...|
|
|
||||||
|..@@@..|
|
|
||||||
|...@...|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.####..|
|
|
||||||
|....##.|
|
|
||||||
|....##.|
|
|
||||||
|....#..|
|
|
||||||
|..#.#..|
|
|
||||||
|..#.#..|
|
|
||||||
|#####..|
|
|
||||||
|..###..|
|
|
||||||
|...#...|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
|....@..|
|
|
||||||
|....@..|
|
|
||||||
|..@@@..|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|..#....|
|
|
||||||
|.###...|
|
|
||||||
|..#....|
|
|
||||||
|.####..|
|
|
||||||
|....##.|
|
|
||||||
|....##.|
|
|
||||||
|....#..|
|
|
||||||
|..#.#..|
|
|
||||||
|..#.#..|
|
|
||||||
|#####..|
|
|
||||||
|..###..|
|
|
||||||
|...#...|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
|..@....|
|
|
||||||
|..@....|
|
|
||||||
|..@....|
|
|
||||||
|..@....|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.....#.|
|
|
||||||
|.....#.|
|
|
||||||
|..####.|
|
|
||||||
|.###...|
|
|
||||||
|..#....|
|
|
||||||
|.####..|
|
|
||||||
|....##.|
|
|
||||||
|....##.|
|
|
||||||
|....#..|
|
|
||||||
|..#.#..|
|
|
||||||
|..#.#..|
|
|
||||||
|#####..|
|
|
||||||
|..###..|
|
|
||||||
|...#...|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
|..@@...|
|
|
||||||
|..@@...|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|....#..|
|
|
||||||
|....#..|
|
|
||||||
|....##.|
|
|
||||||
|....##.|
|
|
||||||
|..####.|
|
|
||||||
|.###...|
|
|
||||||
|..#....|
|
|
||||||
|.####..|
|
|
||||||
|....##.|
|
|
||||||
|....##.|
|
|
||||||
|....#..|
|
|
||||||
|..#.#..|
|
|
||||||
|..#.#..|
|
|
||||||
|#####..|
|
|
||||||
|..###..|
|
|
||||||
|...#...|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
|
|
||||||
|..@@@@.|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|.......|
|
|
||||||
|....#..|
|
|
||||||
|....#..|
|
|
||||||
|....##.|
|
|
||||||
|##..##.|
|
|
||||||
|######.|
|
|
||||||
|.###...|
|
|
||||||
|..#....|
|
|
||||||
|.####..|
|
|
||||||
|....##.|
|
|
||||||
|....##.|
|
|
||||||
|....#..|
|
|
||||||
|..#.#..|
|
|
||||||
|..#.#..|
|
|
||||||
|#####..|
|
|
||||||
|..###..|
|
|
||||||
|...#...|
|
|
||||||
|..####.|
|
|
||||||
+-------+
|
|
||||||
</code></pre>
|
|
||||||
<p>To prove to the elephants your simulation is accurate, they want to know how tall the tower will get after 2022 rocks have stopped (but before the 2023rd rock begins falling). In this example, the tower of rocks will be <code><em>3068</em></code> units tall.</p>
|
|
||||||
<p><em>How many units tall will the tower of rocks be after 2022 rocks have stopped falling?</em></p>
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,23 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 18: Boiling Boulders ---</h2><p>You and the elephants finally reach fresh air. You've emerged near the base of a large volcano that seems to be actively erupting! Fortunately, the lava seems to be flowing away from you and toward the ocean.</p>
|
|
||||||
<p>Bits of lava are still being ejected toward you, so you're sheltering in the cavern exit a little longer. Outside the cave, you can see the lava landing in a pond and hear it loudly hissing as it solidifies.</p>
|
|
||||||
<p>Depending on the specific compounds in the lava and speed at which it cools, it might be forming <a href="https://en.wikipedia.org/wiki/Obsidian" target="_blank">obsidian</a>! The cooling rate should be based on the surface area of the lava droplets, so you take a quick scan of a droplet as it flies past you (your puzzle input).</p>
|
|
||||||
<p>Because of how quickly the lava is moving, the scan isn't very good; its resolution is quite low and, as a result, it approximates the shape of the lava droplet with <em>1x1x1 <span title="Unfortunately, you forgot your flint and steel in another dimension.">cubes</span> on a 3D grid</em>, each given as its <code>x,y,z</code> position.</p>
|
|
||||||
<p>To approximate the surface area, count the number of sides of each cube that are not immediately connected to another cube. So, if your scan were only two adjacent cubes like <code>1,1,1</code> and <code>2,1,1</code>, each cube would have a single side covered and five sides exposed, a total surface area of <code><em>10</em></code> sides.</p>
|
|
||||||
<p>Here's a larger example:</p>
|
|
||||||
<pre><code>2,2,2
|
|
||||||
1,2,2
|
|
||||||
3,2,2
|
|
||||||
2,1,2
|
|
||||||
2,3,2
|
|
||||||
2,2,1
|
|
||||||
2,2,3
|
|
||||||
2,2,4
|
|
||||||
2,2,6
|
|
||||||
1,2,5
|
|
||||||
3,2,5
|
|
||||||
2,1,5
|
|
||||||
2,3,5
|
|
||||||
</code></pre>
|
|
||||||
<p>In the above example, after counting up all the sides that aren't connected to another cube, the total surface area is <code><em>64</em></code>.</p>
|
|
||||||
<p><em>What is the surface area of your scanned lava droplet?</em></p>
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
Blueprint 1: Each ore robot costs 3 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 19 clay. Each geode robot costs 3 ore and 8 obsidian.
|
|
||||||
Blueprint 2: Each ore robot costs 3 ore. Each clay robot costs 3 ore. Each obsidian robot costs 3 ore and 9 clay. Each geode robot costs 2 ore and 10 obsidian.
|
|
||||||
Blueprint 3: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 20 clay. Each geode robot costs 2 ore and 12 obsidian.
|
|
||||||
Blueprint 4: Each ore robot costs 4 ore. Each clay robot costs 3 ore. Each obsidian robot costs 2 ore and 19 clay. Each geode robot costs 3 ore and 13 obsidian.
|
|
||||||
Blueprint 5: Each ore robot costs 3 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 16 clay. Each geode robot costs 3 ore and 14 obsidian.
|
|
||||||
Blueprint 6: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 2 ore and 18 clay. Each geode robot costs 4 ore and 20 obsidian.
|
|
||||||
Blueprint 7: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 11 clay. Each geode robot costs 4 ore and 12 obsidian.
|
|
||||||
Blueprint 8: Each ore robot costs 3 ore. Each clay robot costs 3 ore. Each obsidian robot costs 2 ore and 20 clay. Each geode robot costs 2 ore and 20 obsidian.
|
|
||||||
Blueprint 9: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 2 ore and 11 clay. Each geode robot costs 4 ore and 8 obsidian.
|
|
||||||
Blueprint 10: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 5 clay. Each geode robot costs 3 ore and 15 obsidian.
|
|
||||||
Blueprint 11: Each ore robot costs 2 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 15 clay. Each geode robot costs 2 ore and 15 obsidian.
|
|
||||||
Blueprint 12: Each ore robot costs 4 ore. Each clay robot costs 3 ore. Each obsidian robot costs 2 ore and 19 clay. Each geode robot costs 3 ore and 10 obsidian.
|
|
||||||
Blueprint 13: Each ore robot costs 3 ore. Each clay robot costs 3 ore. Each obsidian robot costs 2 ore and 16 clay. Each geode robot costs 2 ore and 18 obsidian.
|
|
||||||
Blueprint 14: Each ore robot costs 4 ore. Each clay robot costs 3 ore. Each obsidian robot costs 3 ore and 11 clay. Each geode robot costs 4 ore and 7 obsidian.
|
|
||||||
Blueprint 15: Each ore robot costs 4 ore. Each clay robot costs 3 ore. Each obsidian robot costs 4 ore and 18 clay. Each geode robot costs 3 ore and 13 obsidian.
|
|
||||||
Blueprint 16: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 14 clay. Each geode robot costs 3 ore and 16 obsidian.
|
|
||||||
Blueprint 17: Each ore robot costs 3 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 6 clay. Each geode robot costs 3 ore and 16 obsidian.
|
|
||||||
Blueprint 18: Each ore robot costs 2 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 19 clay. Each geode robot costs 4 ore and 12 obsidian.
|
|
||||||
Blueprint 19: Each ore robot costs 2 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 17 clay. Each geode robot costs 4 ore and 20 obsidian.
|
|
||||||
Blueprint 20: Each ore robot costs 3 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 16 clay. Each geode robot costs 3 ore and 15 obsidian.
|
|
||||||
Blueprint 21: Each ore robot costs 3 ore. Each clay robot costs 3 ore. Each obsidian robot costs 3 ore and 19 clay. Each geode robot costs 2 ore and 9 obsidian.
|
|
||||||
Blueprint 22: Each ore robot costs 2 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 20 clay. Each geode robot costs 2 ore and 17 obsidian.
|
|
||||||
Blueprint 23: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 7 clay. Each geode robot costs 4 ore and 11 obsidian.
|
|
||||||
Blueprint 24: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 9 clay. Each geode robot costs 3 ore and 9 obsidian.
|
|
||||||
Blueprint 25: Each ore robot costs 4 ore. Each clay robot costs 3 ore. Each obsidian robot costs 2 ore and 15 clay. Each geode robot costs 2 ore and 8 obsidian.
|
|
||||||
Blueprint 26: Each ore robot costs 2 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 16 clay. Each geode robot costs 3 ore and 13 obsidian.
|
|
||||||
Blueprint 27: Each ore robot costs 4 ore. Each clay robot costs 3 ore. Each obsidian robot costs 4 ore and 18 clay. Each geode robot costs 4 ore and 11 obsidian.
|
|
||||||
Blueprint 28: Each ore robot costs 4 ore. Each clay robot costs 3 ore. Each obsidian robot costs 4 ore and 8 clay. Each geode robot costs 3 ore and 7 obsidian.
|
|
||||||
Blueprint 29: Each ore robot costs 2 ore. Each clay robot costs 4 ore. Each obsidian robot costs 4 ore and 20 clay. Each geode robot costs 3 ore and 14 obsidian.
|
|
||||||
Blueprint 30: Each ore robot costs 4 ore. Each clay robot costs 4 ore. Each obsidian robot costs 3 ore and 11 clay. Each geode robot costs 3 ore and 8 obsidian.
|
|
||||||
@@ -1,155 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 19: Not Enough Minerals ---</h2><p>Your scans show that the lava did indeed form obsidian!</p>
|
|
||||||
<p>The wind has changed direction enough to stop sending lava droplets toward you, so you and the elephants exit the cave. As you do, you notice a collection of <a href="https://en.wikipedia.org/wiki/Geode" target="_blank">geodes</a> around the pond. Perhaps you could use the obsidian to create some <em>geode-cracking robots</em> and break them open?</p>
|
|
||||||
<p>To collect the obsidian from the bottom of the pond, you'll need waterproof <em>obsidian-collecting robots</em>. Fortunately, there is an abundant amount of clay nearby that you can use to make them waterproof.</p>
|
|
||||||
<p>In order to harvest the clay, you'll need special-purpose <em>clay-collecting robots</em>. To make any type of robot, you'll need <em>ore</em>, which is also plentiful but in the opposite direction from the clay.</p>
|
|
||||||
<p>Collecting ore requires <em>ore-collecting robots</em> with big drills. Fortunately, <em>you have exactly one ore-collecting robot</em> in your pack that you can use to <span title="If You Give A Mouse An Ore-Collecting Robot">kickstart</span> the whole operation.</p>
|
|
||||||
<p>Each robot can collect 1 of its resource type per minute. It also takes one minute for the robot factory (also conveniently from your pack) to construct any type of robot, although it consumes the necessary resources available when construction begins.</p>
|
|
||||||
<p>The robot factory has many <em>blueprints</em> (your puzzle input) you can choose from, but once you've configured it with a blueprint, you can't change it. You'll need to work out which blueprint is best.</p>
|
|
||||||
<p>For example:</p>
|
|
||||||
<pre><code>Blueprint 1:
|
|
||||||
Each ore robot costs 4 ore.
|
|
||||||
Each clay robot costs 2 ore.
|
|
||||||
Each obsidian robot costs 3 ore and 14 clay.
|
|
||||||
Each geode robot costs 2 ore and 7 obsidian.
|
|
||||||
|
|
||||||
Blueprint 2:
|
|
||||||
Each ore robot costs 2 ore.
|
|
||||||
Each clay robot costs 3 ore.
|
|
||||||
Each obsidian robot costs 3 ore and 8 clay.
|
|
||||||
Each geode robot costs 3 ore and 12 obsidian.
|
|
||||||
</code></pre>
|
|
||||||
<p>(Blueprints have been line-wrapped here for legibility. The robot factory's actual assortment of blueprints are provided one blueprint per line.)</p>
|
|
||||||
<p>The elephants are starting to look hungry, so you shouldn't take too long; you need to figure out which blueprint would maximize the number of opened geodes after <em>24 minutes</em> by figuring out which robots to build and when to build them.</p>
|
|
||||||
<p>Using blueprint 1 in the example above, the largest number of geodes you could open in 24 minutes is <code><em>9</em></code>. One way to achieve that is:</p>
|
|
||||||
<pre><code>== Minute 1 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 1 ore.
|
|
||||||
|
|
||||||
== Minute 2 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 2 ore.
|
|
||||||
|
|
||||||
== Minute 3 ==
|
|
||||||
Spend 2 ore to start building a clay-collecting robot.
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 1 ore.
|
|
||||||
The new clay-collecting robot is ready; you now have 1 of them.
|
|
||||||
|
|
||||||
== Minute 4 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 2 ore.
|
|
||||||
1 clay-collecting robot collects 1 clay; you now have 1 clay.
|
|
||||||
|
|
||||||
== Minute 5 ==
|
|
||||||
Spend 2 ore to start building a clay-collecting robot.
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 1 ore.
|
|
||||||
1 clay-collecting robot collects 1 clay; you now have 2 clay.
|
|
||||||
The new clay-collecting robot is ready; you now have 2 of them.
|
|
||||||
|
|
||||||
== Minute 6 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 2 ore.
|
|
||||||
2 clay-collecting robots collect 2 clay; you now have 4 clay.
|
|
||||||
|
|
||||||
== Minute 7 ==
|
|
||||||
Spend 2 ore to start building a clay-collecting robot.
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 1 ore.
|
|
||||||
2 clay-collecting robots collect 2 clay; you now have 6 clay.
|
|
||||||
The new clay-collecting robot is ready; you now have 3 of them.
|
|
||||||
|
|
||||||
== Minute 8 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 2 ore.
|
|
||||||
3 clay-collecting robots collect 3 clay; you now have 9 clay.
|
|
||||||
|
|
||||||
== Minute 9 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 3 ore.
|
|
||||||
3 clay-collecting robots collect 3 clay; you now have 12 clay.
|
|
||||||
|
|
||||||
== Minute 10 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 4 ore.
|
|
||||||
3 clay-collecting robots collect 3 clay; you now have 15 clay.
|
|
||||||
|
|
||||||
== Minute 11 ==
|
|
||||||
Spend 3 ore and 14 clay to start building an obsidian-collecting robot.
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 2 ore.
|
|
||||||
3 clay-collecting robots collect 3 clay; you now have 4 clay.
|
|
||||||
The new obsidian-collecting robot is ready; you now have 1 of them.
|
|
||||||
|
|
||||||
== Minute 12 ==
|
|
||||||
Spend 2 ore to start building a clay-collecting robot.
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 1 ore.
|
|
||||||
3 clay-collecting robots collect 3 clay; you now have 7 clay.
|
|
||||||
1 obsidian-collecting robot collects 1 obsidian; you now have 1 obsidian.
|
|
||||||
The new clay-collecting robot is ready; you now have 4 of them.
|
|
||||||
|
|
||||||
== Minute 13 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 2 ore.
|
|
||||||
4 clay-collecting robots collect 4 clay; you now have 11 clay.
|
|
||||||
1 obsidian-collecting robot collects 1 obsidian; you now have 2 obsidian.
|
|
||||||
|
|
||||||
== Minute 14 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 3 ore.
|
|
||||||
4 clay-collecting robots collect 4 clay; you now have 15 clay.
|
|
||||||
1 obsidian-collecting robot collects 1 obsidian; you now have 3 obsidian.
|
|
||||||
|
|
||||||
== Minute 15 ==
|
|
||||||
Spend 3 ore and 14 clay to start building an obsidian-collecting robot.
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 1 ore.
|
|
||||||
4 clay-collecting robots collect 4 clay; you now have 5 clay.
|
|
||||||
1 obsidian-collecting robot collects 1 obsidian; you now have 4 obsidian.
|
|
||||||
The new obsidian-collecting robot is ready; you now have 2 of them.
|
|
||||||
|
|
||||||
== Minute 16 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 2 ore.
|
|
||||||
4 clay-collecting robots collect 4 clay; you now have 9 clay.
|
|
||||||
2 obsidian-collecting robots collect 2 obsidian; you now have 6 obsidian.
|
|
||||||
|
|
||||||
== Minute 17 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 3 ore.
|
|
||||||
4 clay-collecting robots collect 4 clay; you now have 13 clay.
|
|
||||||
2 obsidian-collecting robots collect 2 obsidian; you now have 8 obsidian.
|
|
||||||
|
|
||||||
== Minute 18 ==
|
|
||||||
Spend 2 ore and 7 obsidian to start building a geode-cracking robot.
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 2 ore.
|
|
||||||
4 clay-collecting robots collect 4 clay; you now have 17 clay.
|
|
||||||
2 obsidian-collecting robots collect 2 obsidian; you now have 3 obsidian.
|
|
||||||
The new geode-cracking robot is ready; you now have 1 of them.
|
|
||||||
|
|
||||||
== Minute 19 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 3 ore.
|
|
||||||
4 clay-collecting robots collect 4 clay; you now have 21 clay.
|
|
||||||
2 obsidian-collecting robots collect 2 obsidian; you now have 5 obsidian.
|
|
||||||
1 geode-cracking robot cracks 1 geode; you now have 1 open geode.
|
|
||||||
|
|
||||||
== Minute 20 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 4 ore.
|
|
||||||
4 clay-collecting robots collect 4 clay; you now have 25 clay.
|
|
||||||
2 obsidian-collecting robots collect 2 obsidian; you now have 7 obsidian.
|
|
||||||
1 geode-cracking robot cracks 1 geode; you now have 2 open geodes.
|
|
||||||
|
|
||||||
== Minute 21 ==
|
|
||||||
Spend 2 ore and 7 obsidian to start building a geode-cracking robot.
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 3 ore.
|
|
||||||
4 clay-collecting robots collect 4 clay; you now have 29 clay.
|
|
||||||
2 obsidian-collecting robots collect 2 obsidian; you now have 2 obsidian.
|
|
||||||
1 geode-cracking robot cracks 1 geode; you now have 3 open geodes.
|
|
||||||
The new geode-cracking robot is ready; you now have 2 of them.
|
|
||||||
|
|
||||||
== Minute 22 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 4 ore.
|
|
||||||
4 clay-collecting robots collect 4 clay; you now have 33 clay.
|
|
||||||
2 obsidian-collecting robots collect 2 obsidian; you now have 4 obsidian.
|
|
||||||
2 geode-cracking robots crack 2 geodes; you now have 5 open geodes.
|
|
||||||
|
|
||||||
== Minute 23 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 5 ore.
|
|
||||||
4 clay-collecting robots collect 4 clay; you now have 37 clay.
|
|
||||||
2 obsidian-collecting robots collect 2 obsidian; you now have 6 obsidian.
|
|
||||||
2 geode-cracking robots crack 2 geodes; you now have 7 open geodes.
|
|
||||||
|
|
||||||
== Minute 24 ==
|
|
||||||
1 ore-collecting robot collects 1 ore; you now have 6 ore.
|
|
||||||
4 clay-collecting robots collect 4 clay; you now have 41 clay.
|
|
||||||
2 obsidian-collecting robots collect 2 obsidian; you now have 8 obsidian.
|
|
||||||
2 geode-cracking robots crack 2 geodes; you now have 9 open geodes.
|
|
||||||
</code></pre>
|
|
||||||
<p>However, by using blueprint 2 in the example above, you could do even better: the largest number of geodes you could open in 24 minutes is <code><em>12</em></code>.</p>
|
|
||||||
<p>Determine the <em>quality level</em> of each blueprint by <em>multiplying that blueprint's ID number</em> with the largest number of geodes that can be opened in 24 minutes using that blueprint. In this example, the first blueprint has ID 1 and can open 9 geodes, so its quality level is <code><em>9</em></code>. The second blueprint has ID 2 and can open 12 geodes, so its quality level is <code><em>24</em></code>. Finally, if you <em>add up the quality levels</em> of all of the blueprints in the list, you get <code><em>33</em></code>.</p>
|
|
||||||
<p>Determine the quality level of each blueprint using the largest number of geodes it could produce in 24 minutes. <em>What do you get if you add up the quality level of all of the blueprints in your list?</em></p>
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,40 +0,0 @@
|
|||||||
# Day 2 Puzzle Text.
|
|
||||||
--- Day 2: Rock Paper Scissors ---
|
|
||||||
The Elves begin to set up camp on the beach. To decide whose tent gets to be closest to the snack storage, a giant Rock Paper Scissors tournament is already in progress.
|
|
||||||
|
|
||||||
Rock Paper Scissors is a game between two players. Each game contains many rounds; in each round, the players each simultaneously choose one of Rock, Paper, or Scissors using a hand shape. Then, a winner for that round is selected: Rock defeats Scissors, Scissors defeats Paper, and Paper defeats Rock. If both players choose the same shape, the round instead ends in a draw.
|
|
||||||
|
|
||||||
Appreciative of your help yesterday, one Elf gives you an encrypted strategy guide (your puzzle input) that they say will be sure to help you win. "The first column is what your opponent is going to play: A for Rock, B for Paper, and C for Scissors. The second column--" Suddenly, the Elf is called away to help with someone's tent.
|
|
||||||
|
|
||||||
The second column, you reason, must be what you should play in response: X for Rock, Y for Paper, and Z for Scissors. Winning every time would be suspicious, so the responses must have been carefully chosen.
|
|
||||||
|
|
||||||
The winner of the whole tournament is the player with the highest score. Your total score is the sum of your scores for each round. The score for a single round is the score for the shape you selected (1 for Rock, 2 for Paper, and 3 for Scissors) plus the score for the outcome of the round (0 if you lost, 3 if the round was a draw, and 6 if you won).
|
|
||||||
|
|
||||||
Since you can't be sure if the Elf is trying to help you or trick you, you should calculate the score you would get if you were to follow the strategy guide.
|
|
||||||
|
|
||||||
For example, suppose you were given the following strategy guide:
|
|
||||||
```
|
|
||||||
A Y
|
|
||||||
B X
|
|
||||||
C Z
|
|
||||||
```
|
|
||||||
This strategy guide predicts and recommends the following:
|
|
||||||
|
|
||||||
In the first round, your opponent will choose Rock (A), and you should choose Paper (Y). This ends in a win for you with a score of 8 (2 because you chose Paper + 6 because you won).
|
|
||||||
In the second round, your opponent will choose Paper (B), and you should choose Rock (X). This ends in a loss for you with a score of 1 (1 + 0).
|
|
||||||
The third round is a draw with both players choosing Scissors, giving you a score of 3 + 3 = 6.
|
|
||||||
In this example, if you were to follow the strategy guide, you would get a total score of 15 (8 + 1 + 6).
|
|
||||||
|
|
||||||
What would your total score be if everything goes exactly according to your strategy guide?
|
|
||||||
|
|
||||||
--- Part Two ---
|
|
||||||
The Elf finishes helping with the tent and sneaks back over to you. "Anyway, the second column says how the round needs to end: X means you need to lose, Y means you need to end the round in a draw, and Z means you need to win. Good luck!"
|
|
||||||
|
|
||||||
The total score is still calculated in the same way, but now you need to figure out what shape to choose so the round ends as indicated. The example above now goes like this:
|
|
||||||
|
|
||||||
In the first round, your opponent will choose Rock (A), and you need the round to end in a draw (Y), so you also choose Rock. This gives you a score of 1 + 3 = 4.
|
|
||||||
In the second round, your opponent will choose Paper (B), and you choose Rock so you lose (X) with a score of 1 + 0 = 1.
|
|
||||||
In the third round, you will defeat your opponent's Scissors with Rock for a score of 1 + 6 = 7.
|
|
||||||
Now that you're correctly decrypting the ultra top secret strategy guide, you would get a total score of 12.
|
|
||||||
|
|
||||||
Following the Elf's instructions for the second column, what would your total score be if everything goes exactly according to your strategy guide?
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,45 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 20: Grove Positioning System ---</h2><p>It's finally time to meet back up with the Elves. When you try to contact them, however, you get no reply. Perhaps you're out of range?</p>
|
|
||||||
<p>You know they're headed to the grove where the <em class="star">star</em> fruit grows, so if you can figure out where that is, you should be able to meet back up with them.</p>
|
|
||||||
<p>Fortunately, your handheld device has a file (your puzzle input) that contains the grove's coordinates! Unfortunately, the file is <em>encrypted</em> - just in case the device were to fall into the wrong hands.</p>
|
|
||||||
<p>Maybe you can <span title="You once again make a mental note to remind the Elves later not to invent their own cryptographic functions.">decrypt</span> it?</p>
|
|
||||||
<p>When you were still back at the camp, you overheard some Elves talking about coordinate file encryption. The main operation involved in decrypting the file is called <em>mixing</em>.</p>
|
|
||||||
<p>The encrypted file is a list of numbers. To <em>mix</em> the file, move each number forward or backward in the file a number of positions equal to the value of the number being moved. The list is <em>circular</em>, so moving a number off one end of the list wraps back around to the other end as if the ends were connected.</p>
|
|
||||||
<p>For example, to move the <code>1</code> in a sequence like <code>4, 5, 6, <em>1</em>, 7, 8, 9</code>, the <code>1</code> moves one position forward: <code>4, 5, 6, 7, <em>1</em>, 8, 9</code>. To move the <code>-2</code> in a sequence like <code>4, <em>-2</em>, 5, 6, 7, 8, 9</code>, the <code>-2</code> moves two positions backward, wrapping around: <code>4, 5, 6, 7, 8, <em>-2</em>, 9</code>.</p>
|
|
||||||
<p>The numbers should be moved <em>in the order they originally appear</em> in the encrypted file. Numbers moving around during the mixing process do not change the order in which the numbers are moved.</p>
|
|
||||||
<p>Consider this encrypted file:</p>
|
|
||||||
<pre><code>1
|
|
||||||
2
|
|
||||||
-3
|
|
||||||
3
|
|
||||||
-2
|
|
||||||
0
|
|
||||||
4
|
|
||||||
</code></pre>
|
|
||||||
<p>Mixing this file proceeds as follows:</p>
|
|
||||||
<pre><code>Initial arrangement:
|
|
||||||
1, 2, -3, 3, -2, 0, 4
|
|
||||||
|
|
||||||
1 moves between 2 and -3:
|
|
||||||
2, 1, -3, 3, -2, 0, 4
|
|
||||||
|
|
||||||
2 moves between -3 and 3:
|
|
||||||
1, -3, 2, 3, -2, 0, 4
|
|
||||||
|
|
||||||
-3 moves between -2 and 0:
|
|
||||||
1, 2, 3, -2, -3, 0, 4
|
|
||||||
|
|
||||||
3 moves between 0 and 4:
|
|
||||||
1, 2, -2, -3, 0, 3, 4
|
|
||||||
|
|
||||||
-2 moves between 4 and 1:
|
|
||||||
1, 2, -3, 0, 3, 4, -2
|
|
||||||
|
|
||||||
0 does not move:
|
|
||||||
1, 2, -3, 0, 3, 4, -2
|
|
||||||
|
|
||||||
4 moves between -3 and 0:
|
|
||||||
1, 2, -3, 4, 0, 3, -2
|
|
||||||
</code></pre>
|
|
||||||
<p>Then, the grove coordinates can be found by looking at the 1000th, 2000th, and 3000th numbers after the value <code>0</code>, wrapping around the list as necessary. In the above example, the 1000th number after <code>0</code> is <code><em>4</em></code>, the 2000th is <code><em>-3</em></code>, and the 3000th is <code><em>2</em></code>; adding these together produces <code><em>3</em></code>.</p>
|
|
||||||
<p>Mix your encrypted file exactly once. <em>What is the sum of the three numbers that form the grove coordinates?</em></p>
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,34 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 21: Monkey Math ---</h2><p>The <a href="11">monkeys</a> are back! You're worried they're going to try to steal your stuff again, but it seems like they're just holding their ground and making various monkey noises at you.</p>
|
|
||||||
<p>Eventually, one of the elephants realizes you don't speak monkey and comes over to interpret. As it turns out, they overheard you talking about trying to find the grove; they can show you a shortcut if you answer their <em>riddle</em>.</p>
|
|
||||||
<p>Each monkey is given a <em>job</em>: either to <em>yell a specific number</em> or to <em>yell the result of a math operation</em>. All of the number-yelling monkeys know their number from the start; however, the math operation monkeys need to wait for two other monkeys to yell a number, and those two other monkeys might <em>also</em> be waiting on other monkeys.</p>
|
|
||||||
<p>Your job is to <em>work out the number the monkey named <code>root</code> will yell</em> before the monkeys figure it out themselves.</p>
|
|
||||||
<p>For example:</p>
|
|
||||||
<pre><code>root: pppw + sjmn
|
|
||||||
dbpl: 5
|
|
||||||
cczh: sllz + lgvd
|
|
||||||
zczc: 2
|
|
||||||
ptdq: humn - dvpt
|
|
||||||
dvpt: 3
|
|
||||||
lfqf: 4
|
|
||||||
humn: 5
|
|
||||||
ljgn: 2
|
|
||||||
sjmn: drzm * dbpl
|
|
||||||
sllz: 4
|
|
||||||
pppw: cczh / lfqf
|
|
||||||
lgvd: ljgn * ptdq
|
|
||||||
drzm: hmdt - zczc
|
|
||||||
hmdt: 32
|
|
||||||
</code></pre>
|
|
||||||
<p>Each line contains the name of a monkey, a colon, and then the job of that monkey:</p>
|
|
||||||
<ul>
|
|
||||||
<li>A lone number means the monkey's job is simply to yell that number.</li>
|
|
||||||
<li>A job like <code>aaaa + bbbb</code> means the monkey waits for monkeys <code>aaaa</code> and <code>bbbb</code> to yell each of their numbers; the monkey then yells the sum of those two numbers.</li>
|
|
||||||
<li><code>aaaa - bbbb</code> means the monkey yells <code>aaaa</code>'s number minus <code>bbbb</code>'s number.</li>
|
|
||||||
<li>Job <code>aaaa * bbbb</code> will yell <code>aaaa</code>'s number multiplied by <code>bbbb</code>'s number.</li>
|
|
||||||
<li>Job <code>aaaa / bbbb</code> will yell <code>aaaa</code>'s number divided by <code>bbbb</code>'s number.</li>
|
|
||||||
</ul>
|
|
||||||
<p>So, in the above example, monkey <code>drzm</code> has to wait for monkeys <code>hmdt</code> and <code>zczc</code> to yell their numbers. Fortunately, both <code>hmdt</code> and <code>zczc</code> have jobs that involve simply yelling a single number, so they do this immediately: <code>32</code> and <code>2</code>. Monkey <code>drzm</code> can then yell its number by finding <code>32</code> minus <code>2</code>: <code><em>30</em></code>.</p>
|
|
||||||
<p>Then, monkey <code>sjmn</code> has one of its numbers (<code>30</code>, from monkey <code>drzm</code>), and already has its other number, <code>5</code>, from <code>dbpl</code>. This allows it to yell its own number by finding <code>30</code> multiplied by <code>5</code>: <code><em>150</em></code>.</p>
|
|
||||||
<p>This process continues until <code>root</code> yells a number: <code><em>152</em></code>.</p>
|
|
||||||
<p>However, your actual situation involves <span title="Advent of Code 2022: Now With Considerably More Monkeys">considerably more monkeys</span>. <em>What number will the monkey named <code>root</code> yell?</em></p>
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,62 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 22: Monkey Map ---</h2><p>The monkeys take you on a surprisingly easy trail through the jungle. They're even going in roughly the right direction according to your handheld device's Grove Positioning System.</p>
|
|
||||||
<p>As you walk, the monkeys explain that the grove is protected by a <em>force field</em>. To pass through the force field, you have to enter a password; doing so involves tracing a specific <em>path</em> on a strangely-shaped board.</p>
|
|
||||||
<p>At least, you're pretty sure that's what you have to do; the elephants aren't exactly fluent in monkey.</p>
|
|
||||||
<p>The monkeys give you notes that they took when they last saw the password entered (your puzzle input).</p>
|
|
||||||
<p>For example:</p>
|
|
||||||
<pre><code> ...#
|
|
||||||
.#..
|
|
||||||
#...
|
|
||||||
....
|
|
||||||
...#.......#
|
|
||||||
........#...
|
|
||||||
..#....#....
|
|
||||||
..........#.
|
|
||||||
...#....
|
|
||||||
.....#..
|
|
||||||
.#......
|
|
||||||
......#.
|
|
||||||
|
|
||||||
10R5L5R10L4R5L5
|
|
||||||
</code></pre>
|
|
||||||
<p>The first half of the monkeys' notes is a <em>map of the board</em>. It is comprised of a set of <em>open tiles</em> (on which you can move, drawn <code>.</code>) and <em>solid walls</em> (tiles which you cannot enter, drawn <code>#</code>).</p>
|
|
||||||
<p>The second half is a description of <em>the path you must follow</em>. It consists of alternating numbers and letters:</p>
|
|
||||||
<ul>
|
|
||||||
<li>A <em>number</em> indicates the <em>number of tiles to move</em> in the direction you are facing. If you run into a wall, you stop moving forward and continue with the next instruction.</li>
|
|
||||||
<li>A <em>letter</em> indicates whether to turn 90 degrees <em>clockwise</em> (<code>R</code>) or <em><span title="Or "anticlockwise", if you're anti-counterclockwise.">counterclockwise</span></em> (<code>L</code>). Turning happens in-place; it does not change your current tile.</li>
|
|
||||||
</ul>
|
|
||||||
<p>So, a path like <code>10R5</code> means "go forward 10 tiles, then turn clockwise 90 degrees, then go forward 5 tiles".</p>
|
|
||||||
<p>You begin the path in the leftmost open tile of the top row of tiles. Initially, you are facing <em>to the right</em> (from the perspective of how the map is drawn).</p>
|
|
||||||
<p>If a movement instruction would take you off of the map, you <em>wrap around</em> to the other side of the board. In other words, if your next tile is off of the board, you should instead look in the direction opposite of your current facing as far as you can until you find the opposite edge of the board, then reappear there.</p>
|
|
||||||
<p>For example, if you are at <code>A</code> and facing to the right, the tile in front of you is marked <code>B</code>; if you are at <code>C</code> and facing down, the tile in front of you is marked <code>D</code>:</p>
|
|
||||||
<pre><code> ...#
|
|
||||||
.#..
|
|
||||||
#...
|
|
||||||
....
|
|
||||||
...#.<em>D</em>.....#
|
|
||||||
........#...
|
|
||||||
<em>B</em>.#....#...<em>A</em>
|
|
||||||
.....<em>C</em>....#.
|
|
||||||
...#....
|
|
||||||
.....#..
|
|
||||||
.#......
|
|
||||||
......#.
|
|
||||||
</code></pre>
|
|
||||||
<p>It is possible for the next tile (after wrapping around) to be a <em>wall</em>; this still counts as there being a wall in front of you, and so movement stops before you actually wrap to the other side of the board.</p>
|
|
||||||
<p>By drawing the <em>last facing you had</em> with an arrow on each tile you visit, the full path taken by the above example looks like this:</p>
|
|
||||||
<pre><code> >>v#
|
|
||||||
.#v.
|
|
||||||
#.v.
|
|
||||||
..v.
|
|
||||||
...#...v..v#
|
|
||||||
>>>v...<em>></em>#.>>
|
|
||||||
..#v...#....
|
|
||||||
...>>>>v..#.
|
|
||||||
...#....
|
|
||||||
.....#..
|
|
||||||
.#......
|
|
||||||
......#.
|
|
||||||
</code></pre>
|
|
||||||
<p>To finish providing the password to this strange input device, you need to determine numbers for your final <em>row</em>, <em>column</em>, and <em>facing</em> as your final position appears from the perspective of the original map. Rows start from <code>1</code> at the top and count downward; columns start from <code>1</code> at the left and count rightward. (In the above example, row 1, column 1 refers to the empty space with no tile on it in the top-left corner.) Facing is <code>0</code> for right (<code>></code>), <code>1</code> for down (<code>v</code>), <code>2</code> for left (<code><</code>), and <code>3</code> for up (<code>^</code>). The <em>final password</em> is the sum of 1000 times the row, 4 times the column, and the facing.</p>
|
|
||||||
<p>In the above example, the final row is <code>6</code>, the final column is <code>8</code>, and the final facing is <code>0</code>. So, the final password is 1000 * 6 + 4 * 8 + 0: <code><em>6032</em></code>.</p>
|
|
||||||
<p>Follow the path given in the monkeys' notes. <em>What is the final password?</em></p>
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
#.#..#...#..##.#..##.##.###.#..#...#.############.###.####.....##.#.......
|
|
||||||
...#..#..##......#.......###.#..##.#.#.#...#..#.#.#.#...###.#..#...#.....#
|
|
||||||
##..###..##.####....##.#...#....##.....#.##..#####..##..###.#.#.#.##......
|
|
||||||
.#.#.##.#..##....#..#...#.#.##.#...##.##.##....#...####..#.###..#.#..##.#.
|
|
||||||
##..##.##..#.#####..#..#####..##.###.##.#..#.#....#.#.##.###..#####.#...##
|
|
||||||
.#..#.#.##.....##.#.####...##.#.......##.#.#.######.#....#####.#####..#..#
|
|
||||||
##....#...##.#.....##..#.#...######.#..#.##.###..###.#.##.##.#..#....#..##
|
|
||||||
.#.###..###.##.#...#.#.##.#.#...#####.##.#.##.######..######.##...###.##..
|
|
||||||
#.#..##....#....#..####.#..###.#...#.#.########.#....#..#...#.#..#..####..
|
|
||||||
....#.#.##..#.#######...##...##.#..#.#.###.###...##...##.#...##...#.#####.
|
|
||||||
....#.####..#......#..#....#..###...#.#....#.##...#.#....#####..#..#.#...#
|
|
||||||
#......#..#######..#...####...#.#.##.#..###.....#.#.####.#.#.#.##.##.##.##
|
|
||||||
.###.....##..###..####.##..###....#..#...###..##..##..#.####.##.#......###
|
|
||||||
###...#.........#.#.....####....##.###.####.###.#....##.#..#.#..##...#..##
|
|
||||||
..#.#.#####.#..#.#.######.#####....#.#...#..#.##..#..#.#..##..#..##.###...
|
|
||||||
##.#####.##.#...#.#.#...#...#..........#.#.#..####.#...##.######..###...##
|
|
||||||
..#.#.####..##..#.#..#####.#.##..#..#.##....###.##.##..#.#...##.##..##.##.
|
|
||||||
###..#.######.##...##.##.####....#.##.#.#.#...#..#....##..####..##.#.#.##.
|
|
||||||
.##.##.###.....####..###....#.#..##..#.#..#..##..#.##.##...##..#.#.#..###.
|
|
||||||
....#.####...######.....########.#.#....##.#..###..#.###..###.#..#.#....##
|
|
||||||
.#..###.#.#.#.#.#..#...####.#.#.##....#..#...#....##.....####...####.#.###
|
|
||||||
#.##...###.#####.##.###.#....##..#.....##..#...#..##.#...#..##...##.#.##.#
|
|
||||||
...#..####..##....###......######.#.#.#..#######...##.#..####.....#.#.####
|
|
||||||
...#.####....###.##.#.#.#..##..#...#.##.#...#.###..#..#....###.##.....#..#
|
|
||||||
#..#.#.##...#......##.##..#..####..##..###.###.#.###.##....#....###.##..#.
|
|
||||||
.#..#..####.#.#.###.###.####.#....#.####....#.##.##....#......#.####.##..#
|
|
||||||
...####.#...#.#....#.#......#.#.#..##.##.##....##...##......##.####.##....
|
|
||||||
.....#..#.##.##..#..##...###..#..#.#...####.#.##...##.#####.#..#..#..#####
|
|
||||||
..##.#...###....#...##.#.#.......#....####..##........#...#..###..#..###..
|
|
||||||
####...###...#....####.##...##.####..##.##...#####.####..###..##.##.#.###.
|
|
||||||
...........###....#....#...#..##..###...#..#.#..#.#.#....####.#.#..####...
|
|
||||||
.#.##.###.#.##..##..######.####....#.####...#..#...#..##..######.#.##.####
|
|
||||||
.###..#.#..##..##...#...#...####.....##..#..##.#..##....#...#..##.#..#.#..
|
|
||||||
.#.###.#...##..#..#..###...#.##.#.#.....#.#.#...#...##.#.##.#...##....#..#
|
|
||||||
.##.##..#.#.#..#.#######.###..###.#.#####..#.###.####..###...#.#.##....#..
|
|
||||||
.....###.####.#####.###....##.##.##.##...###.#.#.#...####...###....#...###
|
|
||||||
##.....#..#....#.###..##...##.#.#..###.#.#..###.#####.##.##.##.#...###.##.
|
|
||||||
.#..#.#####....#.#.#.#..#.####...#...#..###..##.######..#.#..####..##.##..
|
|
||||||
.#....#..#....#.##.#.#.##..#.#..###..##..##..###..#.#######..####..###.#..
|
|
||||||
#.#.##.##.#.##.##..#...#..###..###.#.....#.###.#..####.#..#####...###.#.#.
|
|
||||||
...#.#.##..#.#...#.#..#..####.#...###....#.....#.....#.##.####.#...####.##
|
|
||||||
##.###.##..#..##.###.#..#..#.###.###.##.##...#.#..####....##.#####...#.#.#
|
|
||||||
###.....#.#.##.#...#.#...##.##.#..####.##...#.#.#####....#..#####...#.#.#.
|
|
||||||
##.######.#.#....#....#.#####.....####....###.#.#...##.#..#.##.#.##..##.#.
|
|
||||||
##...##.##.#..#.#......#.####..###..###..#....###..#..#########..#.###.#..
|
|
||||||
#.#..###..#...#.#.#####.#.##..#..#.#.#.#..#.##.####.####..#.#..##.##.####.
|
|
||||||
###########.#..###..#.##.###.#.#.#.#..##.##...#...###..##..###.##...##.#.#
|
|
||||||
..#.##..###....#.#..#.......#.##..##.######..#####.##.##........##....#...
|
|
||||||
.#..#.##.#..#......##.#..##.#.##.###..###.#....##..###.#.#.#...#.##.#...##
|
|
||||||
#####..##..##.#..###...##.#...#.##.#..#....##..#..#...#.#...##.###...#.#.#
|
|
||||||
#.#.#.....###.#.#.##.......#....#.####.########..#.##.##...#.#.#....##....
|
|
||||||
.###.#...###..#####..##..#.#.##.####.###.#....##.#..##..#...#.....#####.#.
|
|
||||||
#####.#..#.###...##.#..##.##...####...####..###...###......#..#.#.......##
|
|
||||||
###....#.##.#.#.#.####.##.###...##.#.#...#..#.....#.##########...########.
|
|
||||||
###...###.#..#....#.#.#...#...#...#.#####...##..#.....##..##...#.#.#.##.#.
|
|
||||||
##.##.#..###....#..#.#.#####...##....#....#...###....#..#..#.#.#...##..###
|
|
||||||
...#..##..###..#.####..#.#.#....##.##.#.#...#....###...#.##......##.#.###.
|
|
||||||
.#.######.#######..#..#.#..##..#..#.##.#...####..##########..#.##..#.#.###
|
|
||||||
.#.#...#..##.#...#..##.#..##......#.###.###.#.##.###...#....#...########.#
|
|
||||||
.##.#....#..#.#.##..#.#####...##.#.##.##..#.#.##.##.#.#...#.#...#....##.##
|
|
||||||
..##.###.###...#...##...#.##..###.....##.#.####.###.......#....##.##.##...
|
|
||||||
.####.#.###.##.#...###.#######..#.....###..#..##.#..##......#..##.##..###.
|
|
||||||
##..#.#####.##...##..###.######..#.#.##...##.#.#.##.#..#....###.##..#..###
|
|
||||||
.###....###...#...#...#.#..###.#.##..###.#...##..#..#...##...##....#.####.
|
|
||||||
.##.#.#.##..#.#.#..#..####...###.##..##.##..###..#####..###...#.#.########
|
|
||||||
.##..##..##....#....#.#.#.##.#....#....#..###.####.##..##...#.##..##.....#
|
|
||||||
..#.###..#.##..#..#.##.######.#.###.#..##.....#####.#########..##...#..#.#
|
|
||||||
#.####...#..#..#.###..##.#.#...#....##.#####.#..#...##..##.#..#..###....#.
|
|
||||||
##...#....#######.###.###..#.##....####.#.#...#.#.#...####..#.#..#.###.#..
|
|
||||||
##.#.####..###.###.###...#..#.#..#..#....##..#..###.#...#.#.#..#.##.##.##.
|
|
||||||
##....#..#..#.#.##.##.#...#...#####....##..#..####.#.#..#...###.###..###..
|
|
||||||
#.#.#.##......#..#..##...#.....##.##..####..###....#.#..#...####..#.##....
|
|
||||||
.#.###.#..#.#..#..###.....##.#.#.##....##...##.#.#.##.#.#..##..##..#......
|
|
||||||
###...##.###..#.##.#.#..#.##..##.#...##..###.#........#.#.#...#.#.#.#.....
|
|
||||||
@@ -1,179 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 23: Unstable Diffusion ---</h2><p>You enter a large crater of gray dirt where the grove is supposed to be. All around you, plants you imagine were expected to be full of fruit are instead withered and broken. A large group of Elves has formed in the middle of the grove.</p>
|
|
||||||
<p>"...but this volcano has been dormant for months. Without ash, the fruit can't grow!"</p>
|
|
||||||
<p>You look up to see a massive, snow-capped mountain towering above you.</p>
|
|
||||||
<p>"It's not like there are other active volcanoes here; we've looked everywhere."</p>
|
|
||||||
<p>"But our scanners show active magma flows; clearly it's going <em>somewhere</em>."</p>
|
|
||||||
<p>They finally notice you at the edge of the grove, your pack almost overflowing from the random <em class="star">star</em> fruit you've been collecting. Behind you, elephants and monkeys explore the grove, looking concerned. Then, the Elves recognize the ash cloud slowly spreading above your recent detour.</p>
|
|
||||||
<p>"Why do you--" "How is--" "Did you just--"</p>
|
|
||||||
<p>Before any of them can form a complete question, another Elf speaks up: "Okay, new plan. We have almost enough fruit already, and ash from the plume should spread here eventually. If we quickly plant new seedlings now, we can still make it to the extraction point. Spread out!"</p>
|
|
||||||
<p>The Elves each reach into their pack and pull out a tiny plant. The plants rely on important nutrients from the ash, so they can't be planted too close together.</p>
|
|
||||||
<p>There isn't enough time to let the Elves figure out where to plant the seedlings themselves; you quickly scan the grove (your puzzle input) and note their positions.</p>
|
|
||||||
<p>For example:</p>
|
|
||||||
<pre><code>....#..
|
|
||||||
..###.#
|
|
||||||
#...#.#
|
|
||||||
.#...##
|
|
||||||
#.###..
|
|
||||||
##.#.##
|
|
||||||
.#..#..
|
|
||||||
</code></pre>
|
|
||||||
<p>The scan shows Elves <code>#</code> and empty ground <code>.</code>; outside your scan, more empty ground extends a long way in every direction. The scan is oriented so that <em>north is up</em>; orthogonal directions are written N (north), S (south), W (west), and E (east), while diagonal directions are written NE, NW, SE, SW.</p>
|
|
||||||
<p>The Elves follow a time-consuming process to figure out where they should each go; you can speed up this process considerably. The process consists of some number of <em>rounds</em> during which Elves alternate between considering where to move and actually moving.</p>
|
|
||||||
<p>During the <em>first half</em> of each round, each Elf considers the eight positions adjacent to themself. If no other Elves are in one of those eight positions, the Elf <em>does not do anything</em> during this round. Otherwise, the Elf looks in each of four directions in the following order and <em>proposes</em> moving one step in the <em>first valid direction</em>:</p>
|
|
||||||
<ul>
|
|
||||||
<li>If there is no Elf in the N, NE, or NW adjacent positions, the Elf proposes moving <em>north</em> one step.</li>
|
|
||||||
<li>If there is no Elf in the S, SE, or SW adjacent positions, the Elf proposes moving <em>south</em> one step.</li>
|
|
||||||
<li>If there is no Elf in the W, NW, or SW adjacent positions, the Elf proposes moving <em>west</em> one step.</li>
|
|
||||||
<li>If there is no Elf in the E, NE, or SE adjacent positions, the Elf proposes moving <em>east</em> one step.</li>
|
|
||||||
</ul>
|
|
||||||
<p>After each Elf has had a chance to propose a move, the <em>second half</em> of the round can begin. Simultaneously, each Elf moves to their proposed destination tile if they were the <em>only</em> Elf to propose moving to that position. If two or more Elves propose moving to the same position, <em>none</em> of those Elves move.</p>
|
|
||||||
<p>Finally, at the end of the round, the <em>first direction</em> the Elves considered is moved to the end of the list of directions. For example, during the second round, the Elves would try proposing a move to the south first, then west, then east, then north. On the third round, the Elves would first consider west, then east, then north, then south.</p>
|
|
||||||
<p>As a smaller example, consider just these five Elves:</p>
|
|
||||||
<pre><code>.....
|
|
||||||
..##.
|
|
||||||
..#..
|
|
||||||
.....
|
|
||||||
..##.
|
|
||||||
.....
|
|
||||||
</code></pre>
|
|
||||||
<p>The northernmost two Elves and southernmost two Elves all propose moving north, while the middle Elf cannot move north and proposes moving south. The middle Elf proposes the same destination as the southwest Elf, so neither of them move, but the other three do:</p>
|
|
||||||
<pre><code>..##.
|
|
||||||
.....
|
|
||||||
..#..
|
|
||||||
...#.
|
|
||||||
..#..
|
|
||||||
.....
|
|
||||||
</code></pre>
|
|
||||||
<p>Next, the northernmost two Elves and the southernmost Elf all propose moving south. Of the remaining middle two Elves, the west one cannot move south and proposes moving west, while the east one cannot move south <em>or</em> west and proposes moving east. All five Elves succeed in moving to their proposed positions:</p>
|
|
||||||
<pre><code>.....
|
|
||||||
..##.
|
|
||||||
.#...
|
|
||||||
....#
|
|
||||||
.....
|
|
||||||
..#..
|
|
||||||
</code></pre>
|
|
||||||
<p>Finally, the southernmost two Elves choose not to move at all. Of the remaining three Elves, the west one proposes moving west, the east one proposes moving east, and the middle one proposes moving north; all three succeed in moving:</p>
|
|
||||||
<pre><code>..#..
|
|
||||||
....#
|
|
||||||
#....
|
|
||||||
....#
|
|
||||||
.....
|
|
||||||
..#..
|
|
||||||
</code></pre>
|
|
||||||
<p>At this point, no Elves need to move, and so the process ends.</p>
|
|
||||||
<p>The larger example above proceeds as follows:</p>
|
|
||||||
<pre><code>== Initial State ==
|
|
||||||
..............
|
|
||||||
..............
|
|
||||||
.......#......
|
|
||||||
.....###.#....
|
|
||||||
...#...#.#....
|
|
||||||
....#...##....
|
|
||||||
...#.###......
|
|
||||||
...##.#.##....
|
|
||||||
....#..#......
|
|
||||||
..............
|
|
||||||
..............
|
|
||||||
..............
|
|
||||||
|
|
||||||
== End of Round 1 ==
|
|
||||||
..............
|
|
||||||
.......#......
|
|
||||||
.....#...#....
|
|
||||||
...#..#.#.....
|
|
||||||
.......#..#...
|
|
||||||
....#.#.##....
|
|
||||||
..#..#.#......
|
|
||||||
..#.#.#.##....
|
|
||||||
..............
|
|
||||||
....#..#......
|
|
||||||
..............
|
|
||||||
..............
|
|
||||||
|
|
||||||
== End of Round 2 ==
|
|
||||||
..............
|
|
||||||
.......#......
|
|
||||||
....#.....#...
|
|
||||||
...#..#.#.....
|
|
||||||
.......#...#..
|
|
||||||
...#..#.#.....
|
|
||||||
.#...#.#.#....
|
|
||||||
..............
|
|
||||||
..#.#.#.##....
|
|
||||||
....#..#......
|
|
||||||
..............
|
|
||||||
..............
|
|
||||||
|
|
||||||
== End of Round 3 ==
|
|
||||||
..............
|
|
||||||
.......#......
|
|
||||||
.....#....#...
|
|
||||||
..#..#...#....
|
|
||||||
.......#...#..
|
|
||||||
...#..#.#.....
|
|
||||||
.#..#.....#...
|
|
||||||
.......##.....
|
|
||||||
..##.#....#...
|
|
||||||
...#..........
|
|
||||||
.......#......
|
|
||||||
..............
|
|
||||||
|
|
||||||
== End of Round 4 ==
|
|
||||||
..............
|
|
||||||
.......#......
|
|
||||||
......#....#..
|
|
||||||
..#...##......
|
|
||||||
...#.....#.#..
|
|
||||||
.........#....
|
|
||||||
.#...###..#...
|
|
||||||
..#......#....
|
|
||||||
....##....#...
|
|
||||||
....#.........
|
|
||||||
.......#......
|
|
||||||
..............
|
|
||||||
|
|
||||||
== End of Round 5 ==
|
|
||||||
.......#......
|
|
||||||
..............
|
|
||||||
..#..#.....#..
|
|
||||||
.........#....
|
|
||||||
......##...#..
|
|
||||||
.#.#.####.....
|
|
||||||
...........#..
|
|
||||||
....##..#.....
|
|
||||||
..#...........
|
|
||||||
..........#...
|
|
||||||
....#..#......
|
|
||||||
..............
|
|
||||||
</code></pre>
|
|
||||||
<p>After a few more rounds...</p>
|
|
||||||
<pre><code>== End of Round 10 ==
|
|
||||||
.......#......
|
|
||||||
...........#..
|
|
||||||
..#.#..#......
|
|
||||||
......#.......
|
|
||||||
...#.....#..#.
|
|
||||||
.#......##....
|
|
||||||
.....##.......
|
|
||||||
..#........#..
|
|
||||||
....#.#..#....
|
|
||||||
..............
|
|
||||||
....#..#..#...
|
|
||||||
..............
|
|
||||||
</code></pre>
|
|
||||||
<p>To make sure they're on the right track, the Elves like to check after round 10 that they're making good progress toward covering enough ground. To do this, count the number of empty ground tiles contained by the smallest rectangle that contains every Elf. (The edges of the rectangle should be aligned to the N/S/E/W directions; the Elves do not have the patience to calculate <span title="Arbitrary Rectangles is my Piet Mondrian cover band.">arbitrary rectangles</span>.) In the above example, that rectangle is:</p>
|
|
||||||
<pre><code>......#.....
|
|
||||||
..........#.
|
|
||||||
.#.#..#.....
|
|
||||||
.....#......
|
|
||||||
..#.....#..#
|
|
||||||
#......##...
|
|
||||||
....##......
|
|
||||||
.#........#.
|
|
||||||
...#.#..#...
|
|
||||||
............
|
|
||||||
...#..#..#..
|
|
||||||
</code></pre>
|
|
||||||
<p>In this region, the number of empty ground tiles is <code><em>110</em></code>.</p>
|
|
||||||
<p>Simulate the Elves' process and find the smallest rectangle that contains the Elves after 10 rounds. <em>How many empty ground tiles does that rectangle contain?</em></p>
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
#.####################################################################################################
|
|
||||||
#<<<..>>><v<><><v^<><^vv^<<v<^<>>.v^vvvv<v.>v^<<v>>.v>><..<v^>v>.v^v>.><>>^><<.vv<^<>>^v<^.<>>>vvv^v<#
|
|
||||||
#>><vv.^v>>v>v.v^^^.><^<>>v.^>v^>v><.^>><>>^^.vvv^^^>^>^<vvv.<^.>.><>v.>vv<v.^>>^<><>><>v<v^.>^^^<.<<#
|
|
||||||
#>>v<v>vv<^^^^^<<v><<^v>^<vv^.v>>.>vv^v<^^..v^>><<>^>v>v<^v.><^<^^v><^^vv<.v..<^<.>^>^<^^^><^<v<^>>v>#
|
|
||||||
#<v<<<v<.^^^<>v^^^v<v^<<>.v<><v.<<<<><v^>>vv>^>v.^v..<><.<><^.<v^>^<^^<^<v.v.^<v><>v>..>>^^>>^^vv>v>>#
|
|
||||||
#>^v<><>vvv>>>v^^<^v<v<<<^<.<v^v^^.vvvvv<>vvvv^>v<v^v><<>...>v<^>^.^^^<><^.v<^v>^<v^^<<v^<^<>vv^>^><>#
|
|
||||||
#<<<<><>^<>><v<^^^>^>v<.^<^<.v<.><><<v<^^><v><>^^.^>>>v^<v^><^^.^<<<.v^>^^<^>^><^^.^v><v^>^<vv^v^<<><#
|
|
||||||
#>^>v><<<>>.v.>v<^^v<.vvv^vv>>v^v^^><^><>>.>^>^v^v><^v.v<^<v<<v<vv^v<^<<><<v><..^^<.v.v><^<.><>^>>>v<#
|
|
||||||
#<^^v<.<.vv>>vv<.<.<>><v^^>vv><v<>v^.v>v<.>v^>>>^.v>^<>v<<^vv>^<v^>^><^<v^^<v><>v.>vv^v<<v.vv^>v^...<#
|
|
||||||
#>^v>>><>^.^<v^<^<^<>>v<>^>>v><^<<v^^>>^.^<<v>.^>>^^><^^v<v.v<^v>>v><>^<>>v^v^<>^<^<^v<vv<v<vv<>^>><.#
|
|
||||||
#<<>^v<^^^<^<<<.vvv><v><^.<>v>^>v^v.v<<<>.<>vv>v>v>..^.^v<<v<>v^>vv<>v<v>^>>^^<>^.<>^v^<>v^^><<<v^<<<#
|
|
||||||
#<.>>>><.>^v<^<>.v>^^<v^v.<.^..v^v>^v.<v^.v.vv.>.<v^....>^>v^v>^^^>v<^<^<^^^>><.^>v<<v^<.<v^<.>>>v^>.#
|
|
||||||
#<.>v<v><>>^^><v^<>^>>v>>^<v>.v^><..^vv^>><><.<^<><^^v^<^^>>v<>^<^>v^<^>v<<^>.<>v^<^v><>v^^vv<<vv<>><#
|
|
||||||
#><^^.^>>^^vv.vv^v<v<.^<.>v^>>v^^<<<>^<<>^v^v>.^<^.><v>>^v>><v<>.<>.>v<^<^v.<v>^^vv^^>>v.>^.<>.^<^.v>#
|
|
||||||
#>v<^^^v^^<^v^>^<^^^.>^^<^.>v<<><>vv<>..^^<^>>>><<>v<<v^^^>v.<>>^<v^>^<<v.^..>^>v^^.<<>><v<.>>v^<^v>.#
|
|
||||||
#<><.^<^^^^.><<^v.^<><vv<v<<v<^v^>^<^v^><>vv>v<<v><<<<><<.>^vv<v.^v<^>^<>>>v<vvvv^^<<<^><^v><<vv><>v.#
|
|
||||||
#>>v>v<>vvv>^>v<^<>><>v<vv.v<^^^vv>v<vv<>>>v..^.<>vv>^v>>^.<>^>v^.<<<v>v^<v><^^v..><^v<^^^v<.^^^v><^<#
|
|
||||||
#.>^.>>^><vvv<^vv^>v^v^<..>>^<^>^^vv>^v<^^..^v^^^<<^<v.<>><<>v<v<^^.>^vv><>v^v^v>v^>v^.v^vv>^><^>>^<>#
|
|
||||||
#><<v^<^>.>vv^v><^^^<v^<<>>.v<.^<.v^^v^^^v<v^>v><><v><<v>>>^<v^.^v^v^>>^v.v>><>^<.><.^vv<vvv.>v.vv^v<#
|
|
||||||
#<<^v><<^>.vv.>v>^>><^>.<<>v><^>v<v>^<>>>^v<<vvvvv^vv^>>.<>>^><>.>>v^>^v.v^^^^.<^.^vvv<>v<<v>^v^v<.>>#
|
|
||||||
#<^^>^>^..v<v^^.^>>v^^>v^.^>vv>vv><.>>><v^<><v>.<^<<<><<<<v>v^.v.^v^>^..^<.vv><<<^v^.>.<<<<v>>^<^vvv>#
|
|
||||||
#>>^^<.^^v>^^>^>>>^v^<v...<>v^<^>^>^v^><>.^><v^.<<v.^<><^<>^>^.<v>.^^>^<>.^<^<><<>><>v.^.<>>>>vv^>>.<#
|
|
||||||
#><v>.>v>vv<>v^^v>^v><^.<^<<<^v.>v^v<>>v><><>^^.><vvv^.^>>^^<^>^>>^vv<<>>^>>>^<>v>.^^^<<.v<<<v>>><v<>#
|
|
||||||
#<^v.v<v>^>v.<<.>vv^<><>>>.<^.><>>^^>v<>..>^<^^v^.<^^.><>v<<^.^vv<>v^^<v>^.v<vv>vv.^v^><<<^<<>v<>^v>>#
|
|
||||||
#><v^<>>^^><^>v.><>.^>v>vv>v>>v^>.^><^^.^<v><.<<.>v.>.<><^^^^>^v>^<><<v>v^<<>v<<^<v>v<.<<v>.><^^>^>v>#
|
|
||||||
#>^<<..^v>.v<>^.<<>v><.^^^><^><>vv>^.<<<^v^^^>^.<.v><v<<.<<^<<^>>v><<vvv.<>.^vv^^>v.>.v>^><>.<^^<vv^<#
|
|
||||||
#>><^^>v><^v^<vvv>^.<.v^>>><<>v<^.v>v><<<>..><.^^.>^^>>vv<<.>^<.^^>v^v>^..v>>>v<><>^.v<.>^>^.>.>^<^<<#
|
|
||||||
#>^^<.>vv<>vv>^>.^^>v^^<^<v^<<vv>v<<^vv<<v<<>.v^><v<.>v^>>^v<<v.<^.>^>v^>v<vv<^>^<^v^<<vv^<v>^>v<^.^<#
|
|
||||||
#><><v<.<^^v<.v<>^^^.>><^.vvv^<>>v>^^<.v>>.>^<v^><^..<..^<><>.v>^v<<>..vv>vvv^.v>v><<v..^^^<>>><^<>><#
|
|
||||||
#<v<>>>v>^v><vv^^>.<><<>>^v>^^><.<<<^.v.<^>>v.^v.<v^^.^.<v^><v<<<>v^><^>v<<^v^^>v><.<^.v<.<>>v<^v^>>>#
|
|
||||||
#<.v^vv<<^^..<^<>^><>>vv^^^<.<^<<^<.^>>^^.<><>^>^v>vv>v.^>v><vvv^<<>v>>^^.>>>vv<>^^v<.<><>>.<<<^^>>><#
|
|
||||||
#<v<^>^vv^><>>v^<^v<v<.^<^^vvvvv>><^><^>v<>v<^v<v..>>^^><v^<^.<v>>^^.>^.>>.v<v>v^^^^<.vvv<v>^<.v..^<.#
|
|
||||||
#>><><^^^^>^^<^^v>>.>><.>><^v^>^^>v>^<v.<^v^<<.<v.>^><^^^^v.>>v<^>>>^>><>^.^<^v><>^<.>>^<v<><vv^v^v>>#
|
|
||||||
#.>.v<^<>>v.v>^><^<v><v<^>><^vv>v^<^v><^v>.^v>v^.>..^<><<<><<vv.^<>vv<^<^v^v.^><>v<^^^^^.<<vvvv<>^^v<#
|
|
||||||
#<>>^>>>v^^vv>><>vv^.v<>^v^^v>^<v^vv<^^vv>^<v<.>>v^v^>v^<>><<<v.^vv<^><>>v<vv^vv^<<^v^^>.>v>v.^^^<<<>#
|
|
||||||
#<<^v^.^v<vv.^>v<v^vvv^<v.<.>>^<^<<<<^<<<.><><v>^><<<<vv^v.vv^>>^>^>v<^<^^>v<>^^>vv>^v..v^v^<<v<<<v<.#
|
|
||||||
####################################################################################################.#
|
|
||||||
@@ -1,224 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 24: Blizzard Basin ---</h2><p>With everything replanted for next year (and with elephants and monkeys to tend the grove), you and the Elves leave for the extraction point.</p>
|
|
||||||
<p>Partway up the mountain that shields the grove is a flat, open area that serves as the extraction point. It's a bit of a climb, but nothing the expedition can't handle.</p>
|
|
||||||
<p>At least, that would normally be true; now that the mountain is covered in snow, things have become more difficult than the Elves are used to.</p>
|
|
||||||
<p>As the expedition reaches a valley that must be traversed to reach the extraction site, you find that strong, turbulent winds are pushing small <em>blizzards</em> of snow and sharp ice around the valley. It's a good thing everyone packed warm clothes! To make it across safely, you'll need to find a way to avoid them.</p>
|
|
||||||
<p>Fortunately, it's easy to see all of this from the entrance to the valley, so you make a map of the valley and the blizzards (your puzzle input). For example:</p>
|
|
||||||
<pre><code>#.#####
|
|
||||||
#.....#
|
|
||||||
#>....#
|
|
||||||
#.....#
|
|
||||||
#...v.#
|
|
||||||
#.....#
|
|
||||||
#####.#
|
|
||||||
</code></pre>
|
|
||||||
<p>The walls of the valley are drawn as <code>#</code>; everything else is ground. Clear ground - where there is currently no blizzard - is drawn as <code>.</code>. Otherwise, blizzards are drawn with an arrow indicating their direction of motion: up (<code>^</code>), down (<code>v</code>), left (<code><</code>), or right (<code>></code>).</p>
|
|
||||||
<p>The above map includes two blizzards, one moving right (<code>></code>) and one moving down (<code>v</code>). In one minute, each blizzard moves one position in the direction it is pointing:</p>
|
|
||||||
<pre><code>#.#####
|
|
||||||
#.....#
|
|
||||||
#.>...#
|
|
||||||
#.....#
|
|
||||||
#.....#
|
|
||||||
#...v.#
|
|
||||||
#####.#
|
|
||||||
</code></pre>
|
|
||||||
<p>Due to <span title="I think, anyway. Do I look like a theoretical blizzacist?">conservation of blizzard energy</span>, as a blizzard reaches the wall of the valley, a new blizzard forms on the opposite side of the valley moving in the same direction. After another minute, the bottom downward-moving blizzard has been replaced with a new downward-moving blizzard at the top of the valley instead:</p>
|
|
||||||
<pre><code>#.#####
|
|
||||||
#...v.#
|
|
||||||
#..>..#
|
|
||||||
#.....#
|
|
||||||
#.....#
|
|
||||||
#.....#
|
|
||||||
#####.#
|
|
||||||
</code></pre>
|
|
||||||
<p>Because blizzards are made of tiny snowflakes, they pass right through each other. After another minute, both blizzards temporarily occupy the same position, marked <code>2</code>:</p>
|
|
||||||
<pre><code>#.#####
|
|
||||||
#.....#
|
|
||||||
#...2.#
|
|
||||||
#.....#
|
|
||||||
#.....#
|
|
||||||
#.....#
|
|
||||||
#####.#
|
|
||||||
</code></pre>
|
|
||||||
<p>After another minute, the situation resolves itself, giving each blizzard back its personal space:</p>
|
|
||||||
<pre><code>#.#####
|
|
||||||
#.....#
|
|
||||||
#....>#
|
|
||||||
#...v.#
|
|
||||||
#.....#
|
|
||||||
#.....#
|
|
||||||
#####.#
|
|
||||||
</code></pre>
|
|
||||||
<p>Finally, after yet another minute, the rightward-facing blizzard on the right is replaced with a new one on the left facing the same direction:</p>
|
|
||||||
<pre><code>#.#####
|
|
||||||
#.....#
|
|
||||||
#>....#
|
|
||||||
#.....#
|
|
||||||
#...v.#
|
|
||||||
#.....#
|
|
||||||
#####.#
|
|
||||||
</code></pre>
|
|
||||||
<p>This process repeats at least as long as you are observing it, but probably forever.</p>
|
|
||||||
<p>Here is a more complex example:</p>
|
|
||||||
<pre><code>#.######
|
|
||||||
#>>.<^<#
|
|
||||||
#.<..<<#
|
|
||||||
#>v.><>#
|
|
||||||
#<^v^^>#
|
|
||||||
######.#
|
|
||||||
</code></pre>
|
|
||||||
<p>Your expedition begins in the only non-wall position in the top row and needs to reach the only non-wall position in the bottom row. On each minute, you can <em>move</em> up, down, left, or right, or you can <em>wait</em> in place. You and the blizzards act <em>simultaneously</em>, and you cannot share a position with a blizzard.</p>
|
|
||||||
<p>In the above example, the fastest way to reach your goal requires <code><em>18</em></code> steps. Drawing the position of the expedition as <code>E</code>, one way to achieve this is:</p>
|
|
||||||
<pre><code>Initial state:
|
|
||||||
#<em>E</em>######
|
|
||||||
#>>.<^<#
|
|
||||||
#.<..<<#
|
|
||||||
#>v.><>#
|
|
||||||
#<^v^^>#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 1, move down:
|
|
||||||
#.######
|
|
||||||
#<em>E</em>>3.<.#
|
|
||||||
#<..<<.#
|
|
||||||
#>2.22.#
|
|
||||||
#>v..^<#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 2, move down:
|
|
||||||
#.######
|
|
||||||
#.2>2..#
|
|
||||||
#<em>E</em>^22^<#
|
|
||||||
#.>2.^>#
|
|
||||||
#.>..<.#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 3, wait:
|
|
||||||
#.######
|
|
||||||
#<^<22.#
|
|
||||||
#<em>E</em>2<.2.#
|
|
||||||
#><2>..#
|
|
||||||
#..><..#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 4, move up:
|
|
||||||
#.######
|
|
||||||
#<em>E</em><..22#
|
|
||||||
#<<.<..#
|
|
||||||
#<2.>>.#
|
|
||||||
#.^22^.#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 5, move right:
|
|
||||||
#.######
|
|
||||||
#2<em>E</em>v.<>#
|
|
||||||
#<.<..<#
|
|
||||||
#.^>^22#
|
|
||||||
#.2..2.#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 6, move right:
|
|
||||||
#.######
|
|
||||||
#>2<em>E</em><.<#
|
|
||||||
#.2v^2<#
|
|
||||||
#>..>2>#
|
|
||||||
#<....>#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 7, move down:
|
|
||||||
#.######
|
|
||||||
#.22^2.#
|
|
||||||
#<v<em>E</em><2.#
|
|
||||||
#>>v<>.#
|
|
||||||
#>....<#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 8, move left:
|
|
||||||
#.######
|
|
||||||
#.<>2^.#
|
|
||||||
#.<em>E</em><<.<#
|
|
||||||
#.22..>#
|
|
||||||
#.2v^2.#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 9, move up:
|
|
||||||
#.######
|
|
||||||
#<<em>E</em>2>>.#
|
|
||||||
#.<<.<.#
|
|
||||||
#>2>2^.#
|
|
||||||
#.v><^.#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 10, move right:
|
|
||||||
#.######
|
|
||||||
#.2<em>E</em>.>2#
|
|
||||||
#<2v2^.#
|
|
||||||
#<>.>2.#
|
|
||||||
#..<>..#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 11, wait:
|
|
||||||
#.######
|
|
||||||
#2^<em>E</em>^2>#
|
|
||||||
#<v<.^<#
|
|
||||||
#..2.>2#
|
|
||||||
#.<..>.#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 12, move down:
|
|
||||||
#.######
|
|
||||||
#>>.<^<#
|
|
||||||
#.<<em>E</em>.<<#
|
|
||||||
#>v.><>#
|
|
||||||
#<^v^^>#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 13, move down:
|
|
||||||
#.######
|
|
||||||
#.>3.<.#
|
|
||||||
#<..<<.#
|
|
||||||
#>2<em>E</em>22.#
|
|
||||||
#>v..^<#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 14, move right:
|
|
||||||
#.######
|
|
||||||
#.2>2..#
|
|
||||||
#.^22^<#
|
|
||||||
#.>2<em>E</em>^>#
|
|
||||||
#.>..<.#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 15, move right:
|
|
||||||
#.######
|
|
||||||
#<^<22.#
|
|
||||||
#.2<.2.#
|
|
||||||
#><2><em>E</em>.#
|
|
||||||
#..><..#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 16, move right:
|
|
||||||
#.######
|
|
||||||
#.<..22#
|
|
||||||
#<<.<..#
|
|
||||||
#<2.>><em>E</em>#
|
|
||||||
#.^22^.#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 17, move down:
|
|
||||||
#.######
|
|
||||||
#2.v.<>#
|
|
||||||
#<.<..<#
|
|
||||||
#.^>^22#
|
|
||||||
#.2..2<em>E</em>#
|
|
||||||
######.#
|
|
||||||
|
|
||||||
Minute 18, move down:
|
|
||||||
#.######
|
|
||||||
#>2.<.<#
|
|
||||||
#.2v^2<#
|
|
||||||
#>..>2>#
|
|
||||||
#<....>#
|
|
||||||
######<em>E</em>#
|
|
||||||
</code></pre>
|
|
||||||
<p><em>What is the fewest number of minutes required to avoid the blizzards and reach the goal?</em></p>
|
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
121=0=-
|
|
||||||
1==02020022=
|
|
||||||
1==2==20--2==
|
|
||||||
1-11-
|
|
||||||
1==02=2=02=-1-00-=0
|
|
||||||
1011=-=--00
|
|
||||||
22-1-1=0--0=
|
|
||||||
1-=121-00=
|
|
||||||
1=1=-=10====10
|
|
||||||
1=-=-21002-2=--
|
|
||||||
211-2=2=-
|
|
||||||
1=-1=10
|
|
||||||
11221
|
|
||||||
2-21-20
|
|
||||||
1-0-
|
|
||||||
12221=0-0-1=
|
|
||||||
101-022121111-
|
|
||||||
11=01-==0211
|
|
||||||
1-2-00-=--11
|
|
||||||
1=-12=-=-2=1==02
|
|
||||||
1=-0111===202
|
|
||||||
20011
|
|
||||||
2=22
|
|
||||||
1=2=12-===-=
|
|
||||||
202=-2201=-2=
|
|
||||||
2=-0221
|
|
||||||
10=20-=2=--
|
|
||||||
1=01202=
|
|
||||||
202
|
|
||||||
12211=222=
|
|
||||||
2=1=1-0211-=0=
|
|
||||||
1-10
|
|
||||||
112=211112
|
|
||||||
11==-100-
|
|
||||||
1=21220=-122--2-2-
|
|
||||||
11-220
|
|
||||||
122=1110220==1
|
|
||||||
1=1-2210-21-=120102
|
|
||||||
1=0202=1=
|
|
||||||
11=2100==2-21121
|
|
||||||
2-21-=
|
|
||||||
2=00210-
|
|
||||||
1==--2
|
|
||||||
1-
|
|
||||||
1==
|
|
||||||
1220-1=22-=
|
|
||||||
1=1-==21021-=10
|
|
||||||
2=02=02000==1-
|
|
||||||
1--210-0-0
|
|
||||||
12-200==1=0-2=-0-
|
|
||||||
12110-020-2-1--
|
|
||||||
1-2
|
|
||||||
20=2=--12=120
|
|
||||||
112=20201
|
|
||||||
1=021-0-=2---
|
|
||||||
21202--1=-1=2--
|
|
||||||
101=
|
|
||||||
22=0---=-
|
|
||||||
21
|
|
||||||
10-1020
|
|
||||||
12=2-==-0-=12=000=
|
|
||||||
1-212-
|
|
||||||
200=1--0120=2==201
|
|
||||||
200-
|
|
||||||
2=0
|
|
||||||
1-1=1110211
|
|
||||||
1---1==2
|
|
||||||
1-2122==10--=0=10
|
|
||||||
1=0-0-2-=01-=220
|
|
||||||
2-0==00001002-=
|
|
||||||
1-0--0001-2=0=0-
|
|
||||||
1-02--01=-1
|
|
||||||
1=101121=0110021-
|
|
||||||
22-22===0-2
|
|
||||||
1=-0-----202=212201
|
|
||||||
120-00--10-=202=
|
|
||||||
1=00==
|
|
||||||
111022--0012=
|
|
||||||
11-2-0=01-=-02
|
|
||||||
1-011=-2
|
|
||||||
2=021-=--1
|
|
||||||
1--212000-2
|
|
||||||
1=-000-
|
|
||||||
1-=-==0
|
|
||||||
20=0012110
|
|
||||||
12=21-1-0
|
|
||||||
1=0021=1010=0=2
|
|
||||||
11-0-==01002
|
|
||||||
1102-20=-
|
|
||||||
102
|
|
||||||
12122
|
|
||||||
1-100121=
|
|
||||||
12=-1==20=20=20222
|
|
||||||
1-=-00--0--1-
|
|
||||||
1===-22-2201=01-=-2
|
|
||||||
1==0-11--==2=21=1-=1
|
|
||||||
20=0=20-110-1201-=2
|
|
||||||
112
|
|
||||||
22=-
|
|
||||||
2=2-2021
|
|
||||||
11100=
|
|
||||||
211-
|
|
||||||
10000==10-000--0
|
|
||||||
12
|
|
||||||
1-1---1=111=
|
|
||||||
11=-=102===-1-1=-
|
|
||||||
20210-2-2-==11
|
|
||||||
1012
|
|
||||||
1-0=-121==-0
|
|
||||||
1===0-0=-0=-=210
|
|
||||||
12--1-2---021=-=
|
|
||||||
1000
|
|
||||||
2-2011-
|
|
||||||
1--201001=002
|
|
||||||
2--
|
|
||||||
1---102=2=10110
|
|
||||||
1=0=2=011-=
|
|
||||||
12=--2-=1-0
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 25: Full of Hot Air ---</h2><p>As the expedition finally reaches the extraction point, several large <a href="https://en.wikipedia.org/wiki/Hot_air_balloon" target="_blank">hot air balloons</a> drift down to meet you. Crews quickly start unloading the equipment the balloons brought: many hot air balloon kits, some fuel tanks, and a <em>fuel heating machine</em>.</p>
|
|
||||||
<p>The fuel heating machine is a new addition to the process. When this mountain was a volcano, the ambient temperature was more reasonable; now, it's so cold that the fuel won't work at all without being warmed up first.</p>
|
|
||||||
<p>The Elves, seemingly in an attempt to make the new machine feel welcome, have already attached a pair of <a href="https://en.wikipedia.org/wiki/Googly_eyes" target="_blank">googly eyes</a> and started calling it "Bob".</p>
|
|
||||||
<p>To heat the fuel, Bob needs to know the total amount of fuel that will be processed ahead of time so it can correctly calibrate heat output and flow rate. This amount is simply the <em>sum</em> of the fuel requirements of all of the hot air balloons, and those fuel requirements are even listed clearly on the side of each hot air balloon's burner.</p>
|
|
||||||
<p>You assume the Elves will have no trouble adding up some numbers and are about to go back to figuring out which balloon is yours when you get a tap on the shoulder. Apparently, the fuel requirements use numbers written in a format the Elves don't recognize; predictably, they'd like your help deciphering them.</p>
|
|
||||||
<p>You make a list of all of the fuel requirements (your puzzle input), but you don't recognize the number format either. For example:</p>
|
|
||||||
<pre><code>1=-0-2
|
|
||||||
12111
|
|
||||||
2=0=
|
|
||||||
21
|
|
||||||
2=01
|
|
||||||
111
|
|
||||||
20012
|
|
||||||
112
|
|
||||||
1=-1=
|
|
||||||
1-12
|
|
||||||
12
|
|
||||||
1=
|
|
||||||
122
|
|
||||||
</code></pre>
|
|
||||||
<p>Fortunately, Bob is labeled with a support phone number. Not to be deterred, you call and ask for help.</p>
|
|
||||||
<p>"That's right, just supply the fuel amount to the-- oh, for more than one burner? No problem, you just need to add together our Special Numeral-Analogue Fuel Units. Patent pending! They're way better than normal numbers for--"</p>
|
|
||||||
<p>You mention that it's quite cold up here and ask if they can skip ahead.</p>
|
|
||||||
<p>"Okay, our Special Numeral-Analogue Fuel Units - SNAFU for short - are sort of like normal numbers. You know how starting on the right, normal numbers have a ones place, a tens place, a hundreds place, and so on, where the digit in each place tells you how many of that value you have?"</p>
|
|
||||||
<p>"SNAFU works the same way, except it uses powers of five instead of ten. Starting from the right, you have a ones place, a fives place, a twenty-fives place, a one-hundred-and-twenty-fives place, and so on. It's that easy!"</p>
|
|
||||||
<p>You ask why some of the digits look like <code>-</code> or <code>=</code> instead of "digits".</p>
|
|
||||||
<p>"You know, I never did ask the engineers why they did that. Instead of using digits four through zero, the digits are <code><em>2</em></code>, <code><em>1</em></code>, <code><em>0</em></code>, <em>minus</em> (written <code>-</code>), and <em>double-minus</em> (written <code>=</code>). Minus is worth -1, and double-minus is worth -2."</p>
|
|
||||||
<p>"So, because ten (in normal numbers) is two fives and no ones, in SNAFU it is written <code>20</code>. Since eight (in normal numbers) is two fives minus two ones, it is written <code>2=</code>."</p>
|
|
||||||
<p>"You can do it the other direction, too. Say you have the SNAFU number <code>2=-01</code>. That's <code>2</code> in the 625s place, <code>=</code> (double-minus) in the 125s place, <code>-</code> (minus) in the 25s place, <code>0</code> in the 5s place, and <code>1</code> in the 1s place. (2 times 625) plus (-2 times 125) plus (-1 times 25) plus (0 times 5) plus (1 times 1). That's 1250 plus -250 plus -25 plus 0 plus 1. <em>976</em>!"</p>
|
|
||||||
<p>"I see here that you're connected via our premium uplink service, so I'll transmit our handy SNAFU brochure to you now. Did you need anything else?"</p>
|
|
||||||
<p>You ask if the fuel will even work in these temperatures.</p>
|
|
||||||
<p>"Wait, it's <em>how</em> cold? There's no <em>way</em> the fuel - or <em>any</em> fuel - would work in those conditions! There are only a few places in the-- where did you say you are again?"</p>
|
|
||||||
<p>Just then, you notice one of the Elves pour a few drops from a snowflake-shaped container into one of the fuel tanks, thank the support representative for their time, and disconnect the call.</p>
|
|
||||||
<p>The SNAFU brochure contains a few more examples of decimal ("normal") numbers and their SNAFU counterparts:</p>
|
|
||||||
<pre><code> Decimal SNAFU
|
|
||||||
1 1
|
|
||||||
2 2
|
|
||||||
3 1=
|
|
||||||
4 1-
|
|
||||||
5 10
|
|
||||||
6 11
|
|
||||||
7 12
|
|
||||||
8 2=
|
|
||||||
9 2-
|
|
||||||
10 20
|
|
||||||
15 1=0
|
|
||||||
20 1-0
|
|
||||||
2022 1=11-2
|
|
||||||
12345 1-0---0
|
|
||||||
314159265 1121-1110-1=0
|
|
||||||
</code></pre>
|
|
||||||
<p>Based on this process, the SNAFU numbers in the example above can be converted to decimal numbers as follows:</p>
|
|
||||||
<pre><code> SNAFU Decimal
|
|
||||||
1=-0-2 1747
|
|
||||||
12111 906
|
|
||||||
2=0= 198
|
|
||||||
21 11
|
|
||||||
2=01 201
|
|
||||||
111 31
|
|
||||||
20012 1257
|
|
||||||
112 32
|
|
||||||
1=-1= 353
|
|
||||||
1-12 107
|
|
||||||
12 7
|
|
||||||
1= 3
|
|
||||||
122 37
|
|
||||||
</code></pre>
|
|
||||||
<p>In decimal, the sum of these numbers is <code>4890</code>.</p>
|
|
||||||
<p>As you go to input this number on Bob's console, you discover that some buttons you expected are missing. Instead, you are met with buttons labeled <code>=</code>, <code>-</code>, <code>0</code>, <code>1</code>, and <code>2</code>. Bob needs the input value expressed as a SNAFU number, not in decimal.</p>
|
|
||||||
<p>Reversing the process, you can determine that for the decimal number <code>4890</code>, the SNAFU number you need to supply to Bob's console is <code><em>2=-1=0</em></code>.</p>
|
|
||||||
<p>The Elves are starting to get cold. <em>What SNAFU number do you supply to Bob's console?</em></p>
|
|
||||||
@@ -1,300 +0,0 @@
|
|||||||
PcPlnShmrLmBnmcwBhrmcmbHNGFGpwdFFwGNjNbGqNHH
|
|
||||||
tzQfRJfWZZztWzVtCTfRzFZjpFjNZjGLHbdHLDdjpb
|
|
||||||
CCQTzRLzvQVVfRzJfMPsnBlglgPmBgPmvSrl
|
|
||||||
RMfvbbszHTsssFPzDQPggpQJPQ
|
|
||||||
NSNcqVtLVGgDlpQBClVB
|
|
||||||
hmStGNNLhjNrpWLGSjWrZssbZTMMvTfMnThbRRTs
|
|
||||||
fTrTPGTbfftWBBmLjrJL
|
|
||||||
DqHwVMqVplDslmlZmpHVwNnShWZFdBBdjWBtWtdtWJSSLS
|
|
||||||
MNslpDvVHlwsmpQRgQgCfTTcvcRQ
|
|
||||||
pBBhRgDsMsswprBhvgRglZtFGFFRqZtZmRtNqtZPPN
|
|
||||||
TdmmzzmdZdqdGFtF
|
|
||||||
nmSccCVmSCpDCswMwl
|
|
||||||
NptqDsQtDTQzCvlzCpRlRp
|
|
||||||
jmZcndmjbZcjrmDvFMFFlwCvzFnF
|
|
||||||
jjgLVLrGcdDBNhWQTgHg
|
|
||||||
mLVhhfSMSTmMwClHGdpjDHjGdV
|
|
||||||
zPrZgJCgbsnrPtZzsCsbpRDjBRHnjGDRldRHppcG
|
|
||||||
JJrbsFrZqrgWbbqbrgWzJPNTwhTNCmmvfWCShhhmwwfm
|
|
||||||
ftgfljvgfgBTNvtggFDDGLGRDnMDzcQzncGt
|
|
||||||
VdbpbVdZwdwrsVVLRrMrDLDBGnBGcM
|
|
||||||
wmpWwWsHWBCCCPPvjvmSqlfTTmSNgN
|
|
||||||
jSqmzmmSSDRjLMLDwqjNcMMLTTflffWCCsRsTHnHVrfHWTsr
|
|
||||||
tdbgZpgBPdgGZGGFTHVpCsCVfVsJpnWl
|
|
||||||
FnPQFvbvhFFFbvBwScjhzcqSLLSzSN
|
|
||||||
bWdgrWwwFWbgzFWzrmNbdPqttChMSRnmqSPSnqtMRM
|
|
||||||
lcPJLDDPPfpMBCRJBtQtMh
|
|
||||||
lGDGjTGLLDHPPGjlPTsswsbHNFsNrFNFsrzr
|
|
||||||
VmtHfVhBLHVtlhphjZMdnQQZZqZmQDdzQQ
|
|
||||||
CPFwPWrvWgrfNgFPCMqZzMDDbznFTqqzDQ
|
|
||||||
NNPsfffPCsBLjpVltV
|
|
||||||
ssdBBJqJhlTJLsjTJqFFmnmmnnrcmpprmmmPcRlf
|
|
||||||
gqtqzSgWQWqmnRPPcNmmQM
|
|
||||||
GqbSVtGzvgvgWbZjjBhTdhBsTZBJBZ
|
|
||||||
jhNBsPDzLjsVhLSNzgvcvbcwbBWFcgtWCc
|
|
||||||
ZQQTTHHnGpMtnpdHpQJfMgrvWWFqbcWWGgrgwCCwwF
|
|
||||||
nHpmMnQQMmHpRnHRmMJnnTShPzljzjSNmSDhLsNSPtSh
|
|
||||||
GdqnBGFdlqzFnwdSCQZjZLLDZjZRvZLDVvgQ
|
|
||||||
PsptsTcftMfcTfhTghVDvvjnRNjVZnvV
|
|
||||||
WtPfJTfftJcMTrMnpccFwlCSCGFGCbCwJSbqBl
|
|
||||||
GjFLGhjRwFjNSjSdJCBBdQJddbBc
|
|
||||||
MVvMMHRzVtHlvlcQBQJHqdpQqCBC
|
|
||||||
vDgVztvvmrgrVRrMmsrsmZzZnWhGnNhGWTLfnLwTLhLTjngL
|
|
||||||
VljjQJSsrjjrCglsCjsgjVVfDLdZGMdvvGdQMzmvzcDQMc
|
|
||||||
HqPBtcpRWwtHbbFwBHZfmfpDfvffDfMfmGvM
|
|
||||||
PwHNbcwtqFqnwtNNqPNPPWBTThjhhVTCSJTThssVnSlJJV
|
|
||||||
GCccNCrrnCrpnzrnCDPcDDrvHHTBqTPhswqhPTBTTwBhTj
|
|
||||||
VfNmRtZgWWHdBdswdjZv
|
|
||||||
SmtQfgNmVFgVLVLVmrnMpcDLGCGLGDMpCp
|
|
||||||
CrdZdZmPPjrQdRPRDqDLBqBLBSWgWgLDzF
|
|
||||||
sQhTNphsVbhhhMJfhNVGqltVSzSllBzStlzFFFWB
|
|
||||||
hsMpwQhNMZmPmrwHRj
|
|
||||||
cNVpSVRpLHRLsVWWfnfsCshW
|
|
||||||
jvqjTgqZPlJZmbPPfbpswsPb
|
|
||||||
vlqdTZdtJvqdZjgqZrtRpQFtLFRQczHGzt
|
|
||||||
JJQndVQnQgTfNvGf
|
|
||||||
ljpbWbmNbDlGTvggGvZf
|
|
||||||
mpmRbMmmNDFDmScpzCsdzrnJrsCzrrnM
|
|
||||||
tNFtNFFzzjjzjBtVNZVbjZGlpSvTllpWwvnBlWGGBGCC
|
|
||||||
fPdcrrgPHrHMMMWlppGJSPwGSnGv
|
|
||||||
fmrqrhhfhdRddHrhQqQrfnLZjLtNttZjjRtzjFtRNj
|
|
||||||
sphRcpQRhfmnmfpptg
|
|
||||||
WVPlGLlSjCjSlGSHJJWZdmbmfvPmmnftbbgDdt
|
|
||||||
LJjjqVNjlnCTRcRhhsNcFF
|
|
||||||
vwwqttFjwgClRNCCvGNmZZMmJsPJjJpTdMpsZd
|
|
||||||
fBLVHHHrFnhHhnrVSTmfdPdPccTTPsMfsJ
|
|
||||||
QzVWzznzFbWNGNlt
|
|
||||||
vjMddVVmnWpdMndjvhhWfNLpfBsfLLZLBBSqqTZq
|
|
||||||
RFlrzQJPSRGzzzzgBZNsgBZTBflfgf
|
|
||||||
cQFDRHFDDGCJShCnvwVnnhCn
|
|
||||||
hgjlpRRLlPJJhTLJMDnwBndSPBNvMqnN
|
|
||||||
FGWVfZsmCbmVzrvtwCSMtMdnDMCw
|
|
||||||
VsVmVZfVQDmVFrrmzmGrHHTJgJjhHJcllglLQJRL
|
|
||||||
rrTVcTBgsjTffmfWHZTv
|
|
||||||
JLdnDlpGlGSLlpwJpHZfFvRZnWzWrHWqFH
|
|
||||||
wQDpDrdSlSCblCdwdSLlwQGBthPMsghNsVNVtCNNhNPjhs
|
|
||||||
CtCMvNhDMHfDDdffqtDtCflpJlBpvmWWJWwlpwFFvjwB
|
|
||||||
rGSbVGZrSsFJjlmBFZWp
|
|
||||||
rbbQgzVGrFVSPPGqfhftfqztNtqHtt
|
|
||||||
lMGZCGphllZDNshNNmHHND
|
|
||||||
PLwjVwJVsHmRrZZw
|
|
||||||
ffSdzjfZSjtjSjLtLLFFFGqFzznCpCnCBblQ
|
|
||||||
CqRnlzHCRWTlHPTZVQrcQtFsQFTcrQ
|
|
||||||
DfJcdBDBcftQjsrsBtjZ
|
|
||||||
JDfdGhSvNGhNfffGSfRznPvcRWcqCqmlvlcn
|
|
||||||
JPhBBBQCnCJCMhnhMZRrRZgbDgrWrNbglDgR
|
|
||||||
jLtSTwtsShwRNpRWrh
|
|
||||||
FLLSHsjGLGczvfPfJdfhddnHPC
|
|
||||||
BjHBNrWmTjFgJngbJhWd
|
|
||||||
vsGttMDtwCMQCJnqqqFJsggqdg
|
|
||||||
GFtDSwwMpTrzSSfcfm
|
|
||||||
rnWDQvpwWpDDcPjFPPHZjVDZ
|
|
||||||
CTJCRmCJcZZZHCCQ
|
|
||||||
LdlmdQJNpnLWbrfL
|
|
||||||
VdTdcVTZwCRGVGGMVmttlF
|
|
||||||
gnrsbngfgQSpBfpMBBBpSgMNNJbmGmlqGDqDNlFFJlGNFz
|
|
||||||
gprgQhgpMMMPsrRTCdPZwCwZZCRH
|
|
||||||
cHlCVGbbWHWqRNThhcNcmh
|
|
||||||
MwQDzpwdJwpBpPDQvrhShfLTTRLfLdjfNRqS
|
|
||||||
JwMBBrPsPDwQMDPPBPQJwMrvWHFbHHlgbsGnnWHnFnRGlblF
|
|
||||||
PQPjPDjRRQSFLSlgSmLlfh
|
|
||||||
zpLdBddbNCdqGbWJGWpJWWlsFsmmFpwfflFgfHwFhgmh
|
|
||||||
nJLdLVnzqqbjRctcPDQVTP
|
|
||||||
JdztScztPdSWLJLtgMbCjhvlbPRbjbMvCh
|
|
||||||
VZrqfQcFQwGVVFqfrTFTNqhljRHDMvMMGhRDRRHGbDhG
|
|
||||||
NZQNVQQpQmrZFQQFwQQVVZgBszJJgznstnmtcztdBSgs
|
|
||||||
nFHLNJzFbLJGGLMlTTRZbZRhWRTr
|
|
||||||
wVmgBBmtmwlqlWTwTM
|
|
||||||
sdvmgcPsCPPQQSMz
|
|
||||||
SccCqmQmgBmppLQmpSMjjlJzzsNPMDRbPNPlJM
|
|
||||||
VHZvwtZwhZHtdTwrVbNsljlRDlJPDhzsbN
|
|
||||||
dZwftVRftmcgpBCmBf
|
|
||||||
NTTlVlgNSflqbphFFhNbFp
|
|
||||||
wmmLmjwzwbWGLjRmtZZdhZLFtQQLQBFh
|
|
||||||
RvjbMjjvMzMWbDWwvzPjvmWSfVfsTlVVPVgTgPfVsnnnsJ
|
|
||||||
BsBsZHZNdWwsNdrzgCrMMqsjzzMC
|
|
||||||
flfhVWFmLrhQzCCh
|
|
||||||
fVbmFSpnSSmtnPZvdWbwvdvdHZ
|
|
||||||
NsZWWWWLsBZPhfsLmPhcFCCHCMMrqfqcvHMfHH
|
|
||||||
nThSllnplGlMpvFRcCqrrr
|
|
||||||
DnTwSztgzlDnVGTwztmdZhmLdJdNDshBdsWs
|
|
||||||
RBBGTFZGglMHvrtcgSdnNgjg
|
|
||||||
DmVcbmbJmwJDJzVVwzJfmfstnztvjnNjvNSpdptvzCnpjj
|
|
||||||
DsLcfLmbhVQssQJQscWRPBZZMMRLHFHZBGMG
|
|
||||||
FVvhVnhFnFhmvFhVcMBHLgcPClrqqrtqCppldrRRTppldg
|
|
||||||
QLWfDNwsQLtlrrCtDdpq
|
|
||||||
sJwZwLsGJWGGwzzWZNbWNLjQHSVhvHSnhcMFcbVmnvcchSBS
|
|
||||||
jTMNMrHBJWWDffRqfDBqfD
|
|
||||||
QmSFphtQqQmVmqVnPnPlpwgfnRnDPl
|
|
||||||
VqFmLFbLhmZhGFGmCmGtZLtJWzWHcJrNrHMccjMscMHzMZ
|
|
||||||
hGPGmbfPzbPfgdMdWGqBGQcqpp
|
|
||||||
nvFTvDrTdNZZlrjnMHHHpBBcppqq
|
|
||||||
rNlZZNLvRdRCRFFwZwhgbmSJPSmPfhfwhS
|
|
||||||
vjdbFWTtFRRvtvZZvdWJWbGjLhCcnrrrNqLNCPqchShNqc
|
|
||||||
QHQVlDsMfmmDMHDBdLdCSLnhNLNNfqCd
|
|
||||||
VQHsMDpHlzMBBwlsmMzmmlVwptvTWdvJdbvJtRTWgGFJJGtR
|
|
||||||
nSScBcnbbFSQVdBFBtWpwtvtPbTZthtTvT
|
|
||||||
pRzHpGjCDGzHGCGsThqqwZwPhCtvhTqZ
|
|
||||||
NzlzjDDpNldBFrlfFQ
|
|
||||||
qJlDlPPWppgppqPlplpfdvgnbMfGbdgCghMdCM
|
|
||||||
QWTWZcSsWbvVvTnhfC
|
|
||||||
tRFLwZrcrWzzlJmtBqlm
|
|
||||||
HMNMvvzzNcmfNmfbhs
|
|
||||||
qVcwCgjCLtWRSLsTPbmPfmTh
|
|
||||||
RtWCJgddWRtCJdWWgdBjwWWwpzMFpHGprcBGFFnGHQZHQGpF
|
|
||||||
gZgBDgDVGDGjmDZRtgjvVvtQdnLrcRcrdfdfCcnlscsJsn
|
|
||||||
WTqzqHqNzpHpwzNhMHNwWPbQCQcCLsnCrLLfcrffNflcNn
|
|
||||||
zHTwwpTPzTTwlFTFzwqzPbwZGgGZZBtmGGvGmBGZVFStFZ
|
|
||||||
znlSSzfzTcmmfcCt
|
|
||||||
PHWWGpqgPShPMwGwqJFTVtwtCVTCmTJcFc
|
|
||||||
qHqqSggLrRLBbvDDdndzRQ
|
|
||||||
WBddBQWZWWQqqQFMWfmrWsJnmVJJNDDVJGsLmHmLDN
|
|
||||||
PTgCjvCCPPPzSZGJVLsVZCHHnH
|
|
||||||
pzwtPTvzTjRTPtwSjPSzRgBbWMBfMwwZfbWrMrZFqFFM
|
|
||||||
BqDwVqdqlDlblQMf
|
|
||||||
ZcCWWcWzvJZjcPjZZZfTHfQJQHThqpMbQQJf
|
|
||||||
LPCcZcczZLgCjvPWgvstjsjmRRBdmGrdGdmSFGnFrtGmqr
|
|
||||||
CBvgQssVzfCBQSgvvvfmrlGrCtMGwthJlJtbrh
|
|
||||||
TpLqLRFpqdRpRTfNPtRmrMMtMlMMmlMJlt
|
|
||||||
PZTjqFFTHZZNZpqcVWzVvgzcWnSWfBDD
|
|
||||||
SVSTpgpVpdNbpcVdfjcNfbcJnqsltcJPvRJqRwQqlQsJls
|
|
||||||
zhWzDLmFHhmrWZmmzHJJQlnswqsvttrstQqs
|
|
||||||
zGtZFGGCmZmGGFhLBWBGGFdgVjgppMTSTgMfCNfVVSdj
|
|
||||||
CzjNJGcnzQJltPHttcPHTP
|
|
||||||
bLVsqLbLmSSVrqmdhVSmsVFFprfrFWrwTTWWWZpFPtlP
|
|
||||||
ssDsMqLqhvmvhdmdvzRCnQgRzzBjgnlNCM
|
|
||||||
TzTLzzSGRlRSjWzlWRzHGTpNhPhJPmdnNPPbhlbPbdhfPh
|
|
||||||
mBCDBVrCqVQvQMBcVcqBrBDsbtJfnZNbJndNNhthZNJfPZPs
|
|
||||||
wMCrqVvBzmzHTGLw
|
|
||||||
NbfwfZPPdVNPdBdQBcmQzrQz
|
|
||||||
nnWqHLWGFMDFDLDjsqnHLsrQGzmJczmQrgJmJGZmQrgJ
|
|
||||||
FFWRsHMHCZCWFwRwphpvlfTTpp
|
|
||||||
PclPlVZvLDNvVZSLSMvvDttmtfzFtzHqtqtzzccCFc
|
|
||||||
jrggQGhjQsTDbrbJjJQqzzCsdtzzFCdHqmBBHz
|
|
||||||
WGDgngwrQggZMNvMWPMRRV
|
|
||||||
wNgpMdMMcdSscccNcLLTbtQJtQJQltJwFtlBlzBt
|
|
||||||
HHGhrLrCvHWHCPhrWDtnBllnQbfQftGnfnBF
|
|
||||||
HvLjWCLHPZvHHHZjjrqVTTZVcppMgNNNNSpS
|
|
||||||
QQrwQmvWQjgTfvBjfffrSDcrqSqDDVLctqqcVd
|
|
||||||
GnHFnGhGplGMlHMNhzBzlLPLVcVNCPDqVNdcqLdqtV
|
|
||||||
GnMGpslMhGsRzzHzGsZFZQJTTmWfBbvfgfgJRfbwbW
|
|
||||||
MRCtSwMhvjCGtvMZDVWpVZJlVccNDlpb
|
|
||||||
gdLQFFwwLfHJWnQlcJJbWc
|
|
||||||
rdqdmqHLTLmsswsFHLFtMPRMCSSRtSjTPMPSCR
|
|
||||||
jmCCnLCLZjZjRjQTLZQhGPGhhzHhDRGRDzwzwh
|
|
||||||
stlJlrlJJcSSfSMMzPfhhGhzpwhpNwhD
|
|
||||||
rbrbBcSlWmdZWjDnTm
|
|
||||||
PNBRNnnqQRNfVfRtVVzgFLLttpSwgzzzmFFF
|
|
||||||
fcWlcbvvCFzLbwLw
|
|
||||||
rlrMrhTJhDcTTfhRNqHRQPQRQNQB
|
|
||||||
TrprpprRVVfpRpVqTVpzDdvmvbbCchhcttqcthSMdd
|
|
||||||
JlnZnFlsMBZnJHlsLsCLbSNtbNhdbbShCScm
|
|
||||||
FlZjjsHHsnQFQwTDzMRRpGRR
|
|
||||||
wHWzwCTTqJhzzvJhWHWhqJWrFsFQrrrFCfFfgjjgjprfsp
|
|
||||||
DBRmZRtZLbnRBGSBmtGSLpjBrrsfrgsTQVrVrrPrgr
|
|
||||||
DLnbcbtLtmNNmbRcGbcGmHzlThNNhqJTHdvqvWlHJh
|
|
||||||
GSNqjRcqflNLnCTTWrWn
|
|
||||||
BmwQtmtJwPwmzMwQtHtVssvrnpWTTnsTTgpVCLCs
|
|
||||||
DBBQHJJrzhzQDDfSljRfhccfcdZf
|
|
||||||
wtgtChCwzqgLzjggqtHtjFHHFcnPfdRDfZZVcPfVZZfGnfdm
|
|
||||||
vBTrRTTWGGmcTDVD
|
|
||||||
SJMbbpWslJblSSNzNsztRChzqRCj
|
|
||||||
gBHHCtVCSHMQlfFTQqCfmq
|
|
||||||
WrpdwjbwbwQGlPqSqblP
|
|
||||||
wWDncWrDDNdWNRjScScjpzvHZtBMZtJsvLVgvzssBsvs
|
|
||||||
VppWpVfmZPBlnmrGBzhttMzMpctLLcChSh
|
|
||||||
FwgLJvRdHcwMzSzjzc
|
|
||||||
QvbgdQLQgDvsqvqRHRDdDQDBWmBGBflnVbZmZmmnBBWrmW
|
|
||||||
SqShwLFCQGpDHCtZCWpW
|
|
||||||
bdHPHjTbJdsMnPHPbdjgtnBlVlBnVgtZpDBpWV
|
|
||||||
bdmPcjbjMNMvvHbTcQRNfRwRwLffwwqwNF
|
|
||||||
zdRHTpQTQHQnpnnQRHTsNNlJSJWmzJmJllNmSG
|
|
||||||
FBbRvLbFRwLqbbVgBVqqLFqJtJNcltsSGmgmGtNtgWmstm
|
|
||||||
FLhhfvvVwvjqfLRBqLVqbwqZQrTTpHMHjdrpnnDPDQCdCrpC
|
|
||||||
JgjzvbJCWgbjgGbJWjRhgNPGHHBMtqBStZZsHMSsBqtD
|
|
||||||
cfQdwQFdQQppnVVnlFLLBsBZMhqPlPMMqBSHDtHM
|
|
||||||
wnQhcnVddmdWgjvjmvRjjJ
|
|
||||||
QpcRtndvsLcVJtRSzWSlWjzSbjjWBv
|
|
||||||
qGZPqCTmGPqgGTCqHgCqZCPFWbbBNBMNBbdBMlWWrbjlMbFl
|
|
||||||
qhHDGhCmPhZHgDmDVQthttRchLwLdwcc
|
|
||||||
srpPMwlMmsrGFGswvDRhRWRDJJJchJ
|
|
||||||
fSgBbCBNnBTTgCNLTCRJhRJVWhTcVVVFFJdR
|
|
||||||
SbBnnLNZCLFQCZjnCnZFjPrzqmlMmmsrpzrlsmtt
|
|
||||||
BBsfDfsBDSWRwlLqmWCpWcllrl
|
|
||||||
nQMgMnnnhdntgMBrCdpNNLNlNqLqLl
|
|
||||||
FnQFHzPQJjJGRBGvfR
|
|
||||||
lRnVRFFlgMCRVwLgFZRnZQHWdcftHdmcJHmmMdzzfz
|
|
||||||
DGBqGQbhhBDbSBpGDBzqdNHJdtmcWdqdmtcm
|
|
||||||
bjbsBvjhSlVsPRgLQl
|
|
||||||
dDLbRdTMRJMbFRzZBfzNSjtNBzBD
|
|
||||||
PmgspqqVrppTVrvrsPhhfQwZBwNjNtNffzqqfwwN
|
|
||||||
mCcmsngrPvpVTssCVsvsPLRRJllGFlnRGbMJMWWlJJ
|
|
||||||
fGlGZHRRbwgPbZRRNCdcSWpncnQtQWlWcWpW
|
|
||||||
JrTLJgVvVLQQvtSvQncQ
|
|
||||||
JrrrmMTBVTmjBMrVjrshmJzgCfzRPCRZPGHfbwNPzbZHNH
|
|
||||||
qqqlDDZzVVnNqHDDFFFNlQpzjrTvsvzTbgJQQggjJp
|
|
||||||
cWPWcCmMfCMWdtPMhMbQQQjGGjpdvjTbjgjr
|
|
||||||
WtMSBCtCwchChMfBWtcPnNVNqZZLDRNqTRnnlwHn
|
|
||||||
mvQQnhBvhmvBmncmZBclTZTQccRFNFFdqFFgVqSRrgFrppNR
|
|
||||||
MjzJPzGPfffMCjVVjfPHLCFRNFStqrdRSdqdNGRqNptq
|
|
||||||
HDJHPjDJLfjbzfwPjCzCWWTwlmQhBnsWBvVsvBvZ
|
|
||||||
RVjcshhscQhrVjhvzjVfDNnzGtftmDHFttFGGf
|
|
||||||
qLcBCCMBJJbTdBDnNtdfnmDG
|
|
||||||
WpZgLLclTclRwgjgsrwsvj
|
|
||||||
shhhltNPcDtlNcNMcsctNtppLZvWWFLTFFZpTZDQgFLT
|
|
||||||
dRgJVzRHbqnLpTWQvLLJfp
|
|
||||||
mCVCdzqHndbqHCrVqRrmbwtNBsmPwNmScPgtPhBclw
|
|
||||||
bDDZMDrFPsrsMcsrbJZJdMMGpSzpSbwRSSRGpCHCGzlhCC
|
|
||||||
BWWNQjBLQVHhlGpSCmwj
|
|
||||||
ffwnNwfgtnNgVVwfNWBWnFsMJTJTcPFJcTFDsrJstJ
|
|
||||||
vQbQLQBpBvbvpHplHNTHWGZDngntZCQGgZhGhtjG
|
|
||||||
rqccPPmcrffRmsmCjVgnrGChChDjgW
|
|
||||||
fqRJsJMSlSzSWTbT
|
|
||||||
brsjjJPJwrJJsrRRlllNQGWQpwppCtfGGtWzGGMQ
|
|
||||||
ncBqqLTDnmLgVDZVnBDmdtVVtMzWWdMCQdpQWdVz
|
|
||||||
hDZgTSSnTzNPNFSFPF
|
|
||||||
VZVJJtWTsfTVVWsJhPWrCjzSBJlHSmjJCRlNSSlz
|
|
||||||
CqMpwccgvvgLnvLbMMRRjBNHzjmGmwNHlmlN
|
|
||||||
gLqqvpCDfVDrTfVW
|
|
||||||
CNMDGNPPNJCGbLnTffsTLT
|
|
||||||
tcBBRlrBdQrtmtWFjjbnrTjjFbjr
|
|
||||||
cTQQhcmvcBRcwDMVDZZPPCJh
|
|
||||||
mBCdgPLgZmLfGmfvGhtRQJWjtjQGQhtN
|
|
||||||
pMwrVwbwHMsqcTWQhQWzggTTWp
|
|
||||||
nnSMwrlrsmSZgvvmDd
|
|
||||||
WNSzpCzNzqzNdmqrRHrrLHFrJH
|
|
||||||
MtPfvnGMPnMcbnRtDHTRFFDrmJRQ
|
|
||||||
PcBsfPPHPGGfcSzZjNjpNZZdCs
|
|
||||||
mDCZVLDhWVSDCRvGtsGgGRHl
|
|
||||||
JjPwPNdcPnjPdcwNltHzzGmgGJzQJJRQ
|
|
||||||
dqfjnNmwmbmWrZMbMrThhB
|
|
||||||
qtBpNZFpBGFNfZNPmZPmQmHrmPPPTz
|
|
||||||
LLwJLvDvlWWLHdwDrVcCRcDVzzVVcV
|
|
||||||
sMMwvgjnMvjvnlsvNFBqfGHFqHGjtSpS
|
|
||||||
MmZZsFgwJTdTMdgmZdZRgFhDHhPQPPnRPhCrHhnnrPDD
|
|
||||||
fBcLlNNpQCDLDJJC
|
|
||||||
jSbWWlWpBpclWlWpNWlVBbWVdgwswFJmFJsGtdMggZFGbZwd
|
|
||||||
CMVQVMLLMFGRCMWQttnqqwQwhqsm
|
|
||||||
pJzlczSpPpPgmsqNhmPGDstq
|
|
||||||
gZgTccZGGpzdpjclGRVMVRFRMFvHRLRdLf
|
|
||||||
FMWMSBtStZqZWQtFtScWWSZmHPVJJVHwwlTgmgbzQwbwTJ
|
|
||||||
jhGLhdjNjsLvLsshzHJPVdVmmbzHzdHJ
|
|
||||||
jvDRNjnDNGRCzjLzZZpqnrFBSccWrMcB
|
|
||||||
zggmthDDghHvtrdgrVWfSBRwTHLWHwsBWw
|
|
||||||
PGGjpCjQnJQGJcJnnQpjFWVSsZWVLRZLBcsWSZBRWS
|
|
||||||
FGQlpnJCbqqGGRCjjnlCqGMtdNmmmvdNmmmzvhbrmgMz
|
|
||||||
TstvBTdgBhqTsdTcPlfCSrNMrNnrCNNSNNgp
|
|
||||||
HwLQwQDZzDjnDbmMhNSnmm
|
|
||||||
FZLVzLLQHRRzwWHjdPlJctlJtlsllhRs
|
|
||||||
fBtPsMDDswHvBmmVdBlSBRcGGnhVhg
|
|
||||||
LWJbrpFqpTLTTjqqNWlhnRGGSnhrcSdlRlsh
|
|
||||||
JWNbbpjJzTbNNNJNJMvmvfZHvzDsHDCsZw
|
|
||||||
LPGnPNLtwGhFFnJPfsqpVVszzpsP
|
|
||||||
TcWdvlrcWddggrDBDDdDMmWzRJqfVQZqmsfZsRQzZfZzQJ
|
|
||||||
TldWrMrDdlDCDdMTcwSLVCSShLNSwHjhGF
|
|
||||||
JGsWWWQsJmPwQWbBPmccbcbqFfMMpFDVCDFVFVCDqqfFwD
|
|
||||||
ZtLnlvLnNtvLndnCmfMVSmVCClfpVp
|
|
||||||
zTzZtjnZNLNmZvdtznntHHZJbBRGBRQWcJGbGsbsJRPQWT
|
|
||||||
MLmlMTPtQtMNlhbqbbqhflBB
|
|
||||||
rcrvjpSvScbRbBvbDBPG
|
|
||||||
ZZJzSHpzPrJzHFmMVMFmHCLNtV
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
# Day 3 Puzzle Text.
|
|
||||||
|
|
||||||
--- Day 3: Rucksack Reorganization ---
|
|
||||||
One Elf has the important job of loading all of the rucksacks with supplies for the jungle journey. Unfortunately, that Elf didn't quite follow the packing instructions, and so a few items now need to be rearranged.
|
|
||||||
|
|
||||||
Each rucksack has two large compartments. All items of a given type are meant to go into exactly one of the two compartments. The Elf that did the packing failed to follow this rule for exactly one item type per rucksack.
|
|
||||||
|
|
||||||
The Elves have made a list of all of the items currently in each rucksack (your puzzle input), but they need your help finding the errors. Every item type is identified by a single lowercase or uppercase letter (that is, a and A refer to different types of items).
|
|
||||||
|
|
||||||
The list of items for each rucksack is given as characters all on a single line. A given rucksack always has the same number of items in each of its two compartments, so the first half of the characters represent items in the first compartment, while the second half of the characters represent items in the second compartment.
|
|
||||||
|
|
||||||
For example, suppose you have the following list of contents from six rucksacks:
|
|
||||||
```
|
|
||||||
vJrwpWtwJgWrhcsFMMfFFhFp
|
|
||||||
jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL
|
|
||||||
PmmdzqPrVvPwwTWBwg
|
|
||||||
wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn
|
|
||||||
ttgJtRGJQctTZtZT
|
|
||||||
CrZsJsPPZsGzwwsLwLmpwMDw
|
|
||||||
```
|
|
||||||
The first rucksack contains the items vJrwpWtwJgWrhcsFMMfFFhFp, which means its first compartment contains the items vJrwpWtwJgWr, while the second compartment contains the items hcsFMMfFFhFp. The only item type that appears in both compartments is lowercase p.
|
|
||||||
The second rucksack's compartments contain jqHRNqRjqzjGDLGL and rsFMfFZSrLrFZsSL. The only item type that appears in both compartments is uppercase L.
|
|
||||||
The third rucksack's compartments contain PmmdzqPrV and vPwwTWBwg; the only common item type is uppercase P.
|
|
||||||
The fourth rucksack's compartments only share item type v.
|
|
||||||
The fifth rucksack's compartments only share item type t.
|
|
||||||
The sixth rucksack's compartments only share item type s.
|
|
||||||
To help prioritize item rearrangement, every item type can be converted to a priority:
|
|
||||||
|
|
||||||
Lowercase item types a through z have priorities 1 through 26.
|
|
||||||
Uppercase item types A through Z have priorities 27 through 52.
|
|
||||||
In the above example, the priority of the item type that appears in both compartments of each rucksack is 16 (p), 38 (L), 42 (P), 22 (v), 20 (t), and 19 (s); the sum of these is 157.
|
|
||||||
|
|
||||||
Find the item type that appears in both compartments of each rucksack. What is the sum of the priorities of those item types?
|
|
||||||
|
|
||||||
--- Part Two ---
|
|
||||||
As you finish identifying the misplaced items, the Elves come to you with another issue.
|
|
||||||
|
|
||||||
For safety, the Elves are divided into groups of three. Every Elf carries a badge that identifies their group. For efficiency, within each group of three Elves, the badge is the only item type carried by all three Elves. That is, if a group's badge is item type B, then all three Elves will have item type B somewhere in their rucksack, and at most two of the Elves will be carrying any other item type.
|
|
||||||
|
|
||||||
The problem is that someone forgot to put this year's updated authenticity sticker on the badges. All of the badges need to be pulled out of the rucksacks so the new authenticity stickers can be attached.
|
|
||||||
|
|
||||||
Additionally, nobody wrote down which item type corresponds to each group's badges. The only way to tell which item type is the right one is by finding the one item type that is common between all three Elves in each group.
|
|
||||||
|
|
||||||
Every set of three lines in your list corresponds to a single group, but each group can have a different badge item type. So, in the above example, the first group's rucksacks are the first three lines:
|
|
||||||
|
|
||||||
vJrwpWtwJgWrhcsFMMfFFhFp
|
|
||||||
jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL
|
|
||||||
PmmdzqPrVvPwwTWBwg
|
|
||||||
And the second group's rucksacks are the next three lines:
|
|
||||||
|
|
||||||
wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn
|
|
||||||
ttgJtRGJQctTZtZT
|
|
||||||
CrZsJsPPZsGzwwsLwLmpwMDw
|
|
||||||
In the first group, the only item type that appears in all three rucksacks is lowercase r; this must be their badges. In the second group, their badge item type must be Z.
|
|
||||||
|
|
||||||
Priorities for these items must still be found to organize the sticker attachment efforts: here, they are 18 (r) for the first group and 52 (Z) for the second group. The sum of these is 70.
|
|
||||||
|
|
||||||
Find the item type that corresponds to the badges of each three-Elf group. What is the sum of the priorities of those item types?
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,57 +0,0 @@
|
|||||||
# Day 4 Puzzle Text.
|
|
||||||
|
|
||||||
--- Day 4: Camp Cleanup ---
|
|
||||||
Space needs to be cleared before the last supplies can be unloaded from the ships, and so several Elves have been assigned the job of cleaning up sections of the camp. Every section has a unique ID number, and each Elf is assigned a range of section IDs.
|
|
||||||
|
|
||||||
However, as some of the Elves compare their section assignments with each other, they've noticed that many of the assignments overlap. To try to quickly find overlaps and reduce duplicated effort, the Elves pair up and make a big list of the section assignments for each pair (your puzzle input).
|
|
||||||
|
|
||||||
For example, consider the following list of section assignment pairs:
|
|
||||||
```
|
|
||||||
2-4,6-8
|
|
||||||
2-3,4-5
|
|
||||||
5-7,7-9
|
|
||||||
2-8,3-7
|
|
||||||
6-6,4-6
|
|
||||||
2-6,4-8
|
|
||||||
```
|
|
||||||
For the first few pairs, this list means:
|
|
||||||
|
|
||||||
Within the first pair of Elves, the first Elf was assigned sections 2-4 (sections 2, 3, and 4), while the second Elf was assigned sections 6-8 (sections 6, 7, 8).
|
|
||||||
The Elves in the second pair were each assigned two sections.
|
|
||||||
The Elves in the third pair were each assigned three sections: one got sections 5, 6, and 7, while the other also got 7, plus 8 and 9.
|
|
||||||
This example list uses single-digit section IDs to make it easier to draw; your actual list might contain larger numbers. Visually, these pairs of section assignments look like this:
|
|
||||||
```
|
|
||||||
.234..... 2-4
|
|
||||||
.....678. 6-8
|
|
||||||
|
|
||||||
.23...... 2-3
|
|
||||||
...45.... 4-5
|
|
||||||
|
|
||||||
....567.. 5-7
|
|
||||||
......789 7-9
|
|
||||||
|
|
||||||
.2345678. 2-8
|
|
||||||
..34567.. 3-7
|
|
||||||
|
|
||||||
.....6... 6-6
|
|
||||||
...456... 4-6
|
|
||||||
|
|
||||||
.23456... 2-6
|
|
||||||
...45678. 4-8
|
|
||||||
```
|
|
||||||
Some of the pairs have noticed that one of their assignments fully contains the other. For example, 2-8 fully contains 3-7, and 6-6 is fully contained by 4-6. In pairs where one assignment fully contains the other, one Elf in the pair would be exclusively cleaning sections their partner will already be cleaning, so these seem like the most in need of reconsideration. In this example, there are 2 such pairs.
|
|
||||||
|
|
||||||
In how many assignment pairs does one range fully contain the other?
|
|
||||||
|
|
||||||
--- Part Two ---
|
|
||||||
It seems like there is still quite a bit of duplicate work planned. Instead, the Elves would like to know the number of pairs that overlap at all.
|
|
||||||
|
|
||||||
In the above example, the first two pairs (2-4,6-8 and 2-3,4-5) don't overlap, while the remaining four pairs (5-7,7-9, 2-8,3-7, 6-6,4-6, and 2-6,4-8) do overlap:
|
|
||||||
|
|
||||||
5-7,7-9 overlaps in a single section, 7.
|
|
||||||
2-8,3-7 overlaps all of the sections 3 through 7.
|
|
||||||
6-6,4-6 overlaps in a single section, 6.
|
|
||||||
2-6,4-8 overlaps in sections 4, 5, and 6.
|
|
||||||
So, in this example, the number of overlapping assignment pairs is 4.
|
|
||||||
|
|
||||||
In how many assignment pairs do the ranges overlap?
|
|
||||||
@@ -1,512 +0,0 @@
|
|||||||
[N] [G] [Q]
|
|
||||||
[H] [B] [B] [R] [H]
|
|
||||||
[S] [N] [Q] [M] [T] [Z]
|
|
||||||
[J] [T] [R] [V] [H] [R] [S]
|
|
||||||
[F] [Q] [W] [T] [V] [J] [V] [M]
|
|
||||||
[W] [P] [V] [S] [F] [B] [Q] [J] [H]
|
|
||||||
[T] [R] [Q] [B] [D] [D] [B] [N] [N]
|
|
||||||
[D] [H] [L] [N] [N] [M] [D] [D] [B]
|
|
||||||
1 2 3 4 5 6 7 8 9
|
|
||||||
|
|
||||||
move 3 from 1 to 2
|
|
||||||
move 1 from 7 to 1
|
|
||||||
move 1 from 6 to 5
|
|
||||||
move 5 from 5 to 9
|
|
||||||
move 2 from 5 to 2
|
|
||||||
move 1 from 6 to 8
|
|
||||||
move 1 from 5 to 7
|
|
||||||
move 5 from 4 to 6
|
|
||||||
move 1 from 7 to 6
|
|
||||||
move 1 from 2 to 4
|
|
||||||
move 5 from 2 to 6
|
|
||||||
move 2 from 1 to 5
|
|
||||||
move 2 from 1 to 9
|
|
||||||
move 16 from 6 to 4
|
|
||||||
move 6 from 8 to 3
|
|
||||||
move 7 from 2 to 4
|
|
||||||
move 5 from 9 to 3
|
|
||||||
move 1 from 1 to 4
|
|
||||||
move 1 from 1 to 3
|
|
||||||
move 3 from 7 to 4
|
|
||||||
move 2 from 5 to 4
|
|
||||||
move 31 from 4 to 8
|
|
||||||
move 22 from 8 to 4
|
|
||||||
move 9 from 3 to 6
|
|
||||||
move 7 from 9 to 5
|
|
||||||
move 4 from 5 to 6
|
|
||||||
move 6 from 3 to 2
|
|
||||||
move 2 from 6 to 7
|
|
||||||
move 5 from 2 to 7
|
|
||||||
move 1 from 2 to 4
|
|
||||||
move 1 from 7 to 5
|
|
||||||
move 4 from 5 to 4
|
|
||||||
move 2 from 6 to 9
|
|
||||||
move 2 from 4 to 6
|
|
||||||
move 7 from 6 to 4
|
|
||||||
move 2 from 6 to 1
|
|
||||||
move 1 from 6 to 8
|
|
||||||
move 8 from 8 to 1
|
|
||||||
move 1 from 7 to 6
|
|
||||||
move 4 from 1 to 5
|
|
||||||
move 9 from 4 to 8
|
|
||||||
move 4 from 1 to 7
|
|
||||||
move 3 from 5 to 3
|
|
||||||
move 2 from 1 to 9
|
|
||||||
move 1 from 3 to 2
|
|
||||||
move 1 from 9 to 8
|
|
||||||
move 1 from 2 to 1
|
|
||||||
move 1 from 1 to 8
|
|
||||||
move 1 from 5 to 1
|
|
||||||
move 2 from 3 to 1
|
|
||||||
move 2 from 6 to 9
|
|
||||||
move 19 from 4 to 1
|
|
||||||
move 4 from 4 to 2
|
|
||||||
move 6 from 1 to 4
|
|
||||||
move 1 from 2 to 4
|
|
||||||
move 4 from 4 to 3
|
|
||||||
move 7 from 7 to 3
|
|
||||||
move 7 from 8 to 2
|
|
||||||
move 2 from 7 to 4
|
|
||||||
move 3 from 2 to 1
|
|
||||||
move 8 from 8 to 2
|
|
||||||
move 3 from 9 to 1
|
|
||||||
move 2 from 9 to 1
|
|
||||||
move 10 from 2 to 7
|
|
||||||
move 4 from 3 to 1
|
|
||||||
move 1 from 8 to 3
|
|
||||||
move 1 from 4 to 5
|
|
||||||
move 1 from 3 to 6
|
|
||||||
move 1 from 2 to 1
|
|
||||||
move 10 from 1 to 3
|
|
||||||
move 1 from 4 to 7
|
|
||||||
move 1 from 6 to 4
|
|
||||||
move 7 from 3 to 2
|
|
||||||
move 5 from 2 to 8
|
|
||||||
move 11 from 7 to 2
|
|
||||||
move 3 from 4 to 3
|
|
||||||
move 1 from 4 to 3
|
|
||||||
move 5 from 8 to 9
|
|
||||||
move 17 from 2 to 4
|
|
||||||
move 11 from 1 to 5
|
|
||||||
move 4 from 1 to 3
|
|
||||||
move 5 from 9 to 2
|
|
||||||
move 4 from 2 to 1
|
|
||||||
move 3 from 5 to 7
|
|
||||||
move 6 from 5 to 3
|
|
||||||
move 1 from 5 to 8
|
|
||||||
move 6 from 1 to 8
|
|
||||||
move 3 from 8 to 5
|
|
||||||
move 1 from 1 to 4
|
|
||||||
move 1 from 7 to 2
|
|
||||||
move 15 from 3 to 4
|
|
||||||
move 1 from 1 to 3
|
|
||||||
move 10 from 3 to 9
|
|
||||||
move 2 from 7 to 4
|
|
||||||
move 1 from 2 to 8
|
|
||||||
move 21 from 4 to 9
|
|
||||||
move 1 from 2 to 3
|
|
||||||
move 1 from 8 to 1
|
|
||||||
move 9 from 4 to 2
|
|
||||||
move 1 from 1 to 5
|
|
||||||
move 5 from 2 to 7
|
|
||||||
move 2 from 8 to 5
|
|
||||||
move 1 from 8 to 1
|
|
||||||
move 2 from 2 to 8
|
|
||||||
move 2 from 4 to 9
|
|
||||||
move 24 from 9 to 5
|
|
||||||
move 3 from 4 to 1
|
|
||||||
move 2 from 2 to 5
|
|
||||||
move 12 from 5 to 1
|
|
||||||
move 10 from 1 to 5
|
|
||||||
move 23 from 5 to 6
|
|
||||||
move 8 from 9 to 1
|
|
||||||
move 3 from 8 to 1
|
|
||||||
move 1 from 1 to 2
|
|
||||||
move 1 from 3 to 7
|
|
||||||
move 11 from 6 to 1
|
|
||||||
move 1 from 2 to 4
|
|
||||||
move 6 from 6 to 8
|
|
||||||
move 4 from 6 to 7
|
|
||||||
move 1 from 7 to 3
|
|
||||||
move 1 from 3 to 4
|
|
||||||
move 23 from 1 to 8
|
|
||||||
move 1 from 4 to 2
|
|
||||||
move 1 from 2 to 1
|
|
||||||
move 1 from 6 to 7
|
|
||||||
move 6 from 5 to 3
|
|
||||||
move 1 from 7 to 8
|
|
||||||
move 1 from 1 to 8
|
|
||||||
move 1 from 9 to 3
|
|
||||||
move 6 from 7 to 2
|
|
||||||
move 3 from 5 to 9
|
|
||||||
move 5 from 2 to 3
|
|
||||||
move 28 from 8 to 3
|
|
||||||
move 4 from 1 to 9
|
|
||||||
move 5 from 9 to 5
|
|
||||||
move 2 from 8 to 5
|
|
||||||
move 1 from 9 to 4
|
|
||||||
move 2 from 7 to 5
|
|
||||||
move 1 from 4 to 2
|
|
||||||
move 1 from 4 to 8
|
|
||||||
move 2 from 8 to 3
|
|
||||||
move 6 from 5 to 2
|
|
||||||
move 1 from 7 to 2
|
|
||||||
move 39 from 3 to 2
|
|
||||||
move 2 from 3 to 8
|
|
||||||
move 1 from 9 to 6
|
|
||||||
move 2 from 2 to 9
|
|
||||||
move 2 from 9 to 6
|
|
||||||
move 1 from 8 to 1
|
|
||||||
move 1 from 1 to 6
|
|
||||||
move 5 from 6 to 9
|
|
||||||
move 2 from 5 to 8
|
|
||||||
move 20 from 2 to 4
|
|
||||||
move 2 from 4 to 8
|
|
||||||
move 2 from 8 to 3
|
|
||||||
move 3 from 3 to 1
|
|
||||||
move 22 from 2 to 5
|
|
||||||
move 2 from 9 to 1
|
|
||||||
move 3 from 1 to 7
|
|
||||||
move 1 from 2 to 6
|
|
||||||
move 1 from 2 to 9
|
|
||||||
move 1 from 1 to 8
|
|
||||||
move 2 from 7 to 9
|
|
||||||
move 1 from 6 to 8
|
|
||||||
move 1 from 2 to 7
|
|
||||||
move 1 from 1 to 3
|
|
||||||
move 1 from 9 to 8
|
|
||||||
move 1 from 8 to 5
|
|
||||||
move 3 from 8 to 7
|
|
||||||
move 3 from 7 to 8
|
|
||||||
move 15 from 4 to 1
|
|
||||||
move 1 from 4 to 3
|
|
||||||
move 10 from 1 to 6
|
|
||||||
move 3 from 8 to 1
|
|
||||||
move 5 from 9 to 4
|
|
||||||
move 7 from 5 to 1
|
|
||||||
move 4 from 6 to 3
|
|
||||||
move 15 from 5 to 2
|
|
||||||
move 4 from 6 to 4
|
|
||||||
move 7 from 2 to 1
|
|
||||||
move 6 from 4 to 6
|
|
||||||
move 1 from 5 to 9
|
|
||||||
move 1 from 5 to 7
|
|
||||||
move 1 from 3 to 5
|
|
||||||
move 11 from 1 to 8
|
|
||||||
move 3 from 4 to 6
|
|
||||||
move 4 from 1 to 5
|
|
||||||
move 1 from 2 to 5
|
|
||||||
move 2 from 8 to 3
|
|
||||||
move 11 from 6 to 1
|
|
||||||
move 1 from 3 to 7
|
|
||||||
move 1 from 9 to 8
|
|
||||||
move 6 from 5 to 8
|
|
||||||
move 3 from 8 to 4
|
|
||||||
move 1 from 4 to 5
|
|
||||||
move 3 from 3 to 1
|
|
||||||
move 9 from 8 to 2
|
|
||||||
move 2 from 1 to 5
|
|
||||||
move 11 from 2 to 5
|
|
||||||
move 1 from 3 to 6
|
|
||||||
move 2 from 8 to 5
|
|
||||||
move 3 from 4 to 6
|
|
||||||
move 1 from 8 to 3
|
|
||||||
move 2 from 1 to 9
|
|
||||||
move 1 from 3 to 8
|
|
||||||
move 16 from 5 to 7
|
|
||||||
move 3 from 1 to 6
|
|
||||||
move 1 from 3 to 5
|
|
||||||
move 1 from 6 to 7
|
|
||||||
move 1 from 9 to 4
|
|
||||||
move 1 from 5 to 4
|
|
||||||
move 1 from 3 to 2
|
|
||||||
move 1 from 1 to 2
|
|
||||||
move 3 from 4 to 9
|
|
||||||
move 1 from 2 to 7
|
|
||||||
move 2 from 8 to 3
|
|
||||||
move 6 from 2 to 8
|
|
||||||
move 11 from 1 to 3
|
|
||||||
move 6 from 3 to 1
|
|
||||||
move 4 from 3 to 2
|
|
||||||
move 2 from 3 to 1
|
|
||||||
move 1 from 1 to 3
|
|
||||||
move 4 from 8 to 4
|
|
||||||
move 4 from 8 to 2
|
|
||||||
move 11 from 7 to 2
|
|
||||||
move 9 from 7 to 5
|
|
||||||
move 1 from 7 to 3
|
|
||||||
move 4 from 5 to 7
|
|
||||||
move 14 from 2 to 3
|
|
||||||
move 17 from 3 to 7
|
|
||||||
move 2 from 5 to 2
|
|
||||||
move 1 from 5 to 7
|
|
||||||
move 1 from 5 to 6
|
|
||||||
move 4 from 6 to 7
|
|
||||||
move 8 from 1 to 2
|
|
||||||
move 2 from 6 to 4
|
|
||||||
move 1 from 6 to 8
|
|
||||||
move 6 from 4 to 1
|
|
||||||
move 1 from 8 to 5
|
|
||||||
move 6 from 7 to 8
|
|
||||||
move 5 from 8 to 3
|
|
||||||
move 12 from 2 to 1
|
|
||||||
move 1 from 8 to 4
|
|
||||||
move 4 from 3 to 1
|
|
||||||
move 4 from 2 to 4
|
|
||||||
move 3 from 9 to 3
|
|
||||||
move 3 from 3 to 2
|
|
||||||
move 1 from 3 to 2
|
|
||||||
move 3 from 4 to 1
|
|
||||||
move 2 from 5 to 7
|
|
||||||
move 22 from 1 to 8
|
|
||||||
move 17 from 8 to 6
|
|
||||||
move 21 from 7 to 6
|
|
||||||
move 3 from 2 to 8
|
|
||||||
move 3 from 1 to 5
|
|
||||||
move 3 from 5 to 2
|
|
||||||
move 2 from 4 to 6
|
|
||||||
move 7 from 6 to 5
|
|
||||||
move 1 from 9 to 4
|
|
||||||
move 14 from 6 to 4
|
|
||||||
move 5 from 8 to 3
|
|
||||||
move 1 from 6 to 3
|
|
||||||
move 3 from 3 to 9
|
|
||||||
move 2 from 9 to 1
|
|
||||||
move 2 from 7 to 1
|
|
||||||
move 16 from 6 to 8
|
|
||||||
move 2 from 6 to 7
|
|
||||||
move 1 from 2 to 7
|
|
||||||
move 1 from 3 to 8
|
|
||||||
move 7 from 4 to 1
|
|
||||||
move 2 from 7 to 2
|
|
||||||
move 4 from 4 to 7
|
|
||||||
move 5 from 2 to 4
|
|
||||||
move 1 from 7 to 3
|
|
||||||
move 3 from 5 to 8
|
|
||||||
move 1 from 7 to 5
|
|
||||||
move 12 from 1 to 6
|
|
||||||
move 3 from 7 to 2
|
|
||||||
move 7 from 4 to 2
|
|
||||||
move 3 from 3 to 2
|
|
||||||
move 1 from 4 to 2
|
|
||||||
move 1 from 9 to 8
|
|
||||||
move 8 from 6 to 8
|
|
||||||
move 12 from 2 to 4
|
|
||||||
move 5 from 5 to 2
|
|
||||||
move 11 from 4 to 9
|
|
||||||
move 3 from 6 to 3
|
|
||||||
move 2 from 4 to 2
|
|
||||||
move 4 from 2 to 6
|
|
||||||
move 5 from 2 to 8
|
|
||||||
move 12 from 8 to 4
|
|
||||||
move 20 from 8 to 5
|
|
||||||
move 13 from 5 to 3
|
|
||||||
move 1 from 8 to 5
|
|
||||||
move 5 from 5 to 9
|
|
||||||
move 16 from 9 to 1
|
|
||||||
move 9 from 4 to 5
|
|
||||||
move 12 from 3 to 9
|
|
||||||
move 5 from 6 to 5
|
|
||||||
move 9 from 9 to 7
|
|
||||||
move 14 from 1 to 4
|
|
||||||
move 14 from 4 to 1
|
|
||||||
move 15 from 5 to 7
|
|
||||||
move 4 from 8 to 2
|
|
||||||
move 3 from 4 to 3
|
|
||||||
move 3 from 1 to 8
|
|
||||||
move 1 from 5 to 9
|
|
||||||
move 1 from 5 to 3
|
|
||||||
move 3 from 9 to 8
|
|
||||||
move 4 from 3 to 4
|
|
||||||
move 1 from 4 to 6
|
|
||||||
move 20 from 7 to 2
|
|
||||||
move 2 from 3 to 8
|
|
||||||
move 3 from 7 to 2
|
|
||||||
move 4 from 2 to 1
|
|
||||||
move 1 from 6 to 7
|
|
||||||
move 3 from 4 to 2
|
|
||||||
move 2 from 2 to 3
|
|
||||||
move 4 from 3 to 4
|
|
||||||
move 1 from 8 to 1
|
|
||||||
move 3 from 8 to 1
|
|
||||||
move 2 from 7 to 8
|
|
||||||
move 1 from 4 to 5
|
|
||||||
move 14 from 2 to 5
|
|
||||||
move 6 from 1 to 5
|
|
||||||
move 1 from 4 to 3
|
|
||||||
move 15 from 1 to 4
|
|
||||||
move 1 from 8 to 2
|
|
||||||
move 1 from 9 to 5
|
|
||||||
move 4 from 8 to 7
|
|
||||||
move 13 from 5 to 6
|
|
||||||
move 1 from 8 to 1
|
|
||||||
move 2 from 7 to 9
|
|
||||||
move 12 from 6 to 4
|
|
||||||
move 1 from 3 to 6
|
|
||||||
move 1 from 1 to 6
|
|
||||||
move 4 from 5 to 2
|
|
||||||
move 5 from 5 to 6
|
|
||||||
move 2 from 6 to 2
|
|
||||||
move 1 from 7 to 5
|
|
||||||
move 2 from 6 to 9
|
|
||||||
move 1 from 5 to 9
|
|
||||||
move 16 from 2 to 5
|
|
||||||
move 17 from 4 to 1
|
|
||||||
move 3 from 1 to 3
|
|
||||||
move 1 from 2 to 6
|
|
||||||
move 2 from 6 to 1
|
|
||||||
move 3 from 3 to 1
|
|
||||||
move 14 from 1 to 8
|
|
||||||
move 3 from 5 to 2
|
|
||||||
move 4 from 8 to 2
|
|
||||||
move 3 from 4 to 5
|
|
||||||
move 15 from 5 to 3
|
|
||||||
move 1 from 7 to 6
|
|
||||||
move 3 from 1 to 8
|
|
||||||
move 2 from 3 to 7
|
|
||||||
move 1 from 1 to 2
|
|
||||||
move 1 from 7 to 6
|
|
||||||
move 4 from 2 to 8
|
|
||||||
move 2 from 6 to 2
|
|
||||||
move 1 from 7 to 6
|
|
||||||
move 3 from 8 to 2
|
|
||||||
move 12 from 8 to 6
|
|
||||||
move 1 from 5 to 6
|
|
||||||
move 3 from 2 to 5
|
|
||||||
move 2 from 2 to 5
|
|
||||||
move 4 from 6 to 5
|
|
||||||
move 4 from 3 to 5
|
|
||||||
move 1 from 8 to 4
|
|
||||||
move 11 from 6 to 4
|
|
||||||
move 6 from 3 to 1
|
|
||||||
move 2 from 9 to 8
|
|
||||||
move 20 from 4 to 5
|
|
||||||
move 1 from 4 to 9
|
|
||||||
move 2 from 3 to 8
|
|
||||||
move 1 from 3 to 8
|
|
||||||
move 17 from 5 to 8
|
|
||||||
move 5 from 5 to 9
|
|
||||||
move 9 from 5 to 1
|
|
||||||
move 2 from 6 to 7
|
|
||||||
move 23 from 8 to 2
|
|
||||||
move 2 from 7 to 5
|
|
||||||
move 3 from 9 to 4
|
|
||||||
move 16 from 2 to 4
|
|
||||||
move 11 from 1 to 8
|
|
||||||
move 4 from 5 to 8
|
|
||||||
move 11 from 2 to 6
|
|
||||||
move 2 from 6 to 1
|
|
||||||
move 5 from 9 to 5
|
|
||||||
move 5 from 5 to 6
|
|
||||||
move 5 from 8 to 6
|
|
||||||
move 1 from 6 to 7
|
|
||||||
move 7 from 8 to 1
|
|
||||||
move 12 from 1 to 2
|
|
||||||
move 1 from 9 to 5
|
|
||||||
move 1 from 1 to 3
|
|
||||||
move 1 from 1 to 4
|
|
||||||
move 1 from 5 to 3
|
|
||||||
move 1 from 3 to 6
|
|
||||||
move 1 from 8 to 2
|
|
||||||
move 18 from 6 to 2
|
|
||||||
move 1 from 6 to 2
|
|
||||||
move 2 from 8 to 3
|
|
||||||
move 3 from 3 to 8
|
|
||||||
move 18 from 4 to 9
|
|
||||||
move 11 from 9 to 2
|
|
||||||
move 2 from 9 to 6
|
|
||||||
move 2 from 4 to 1
|
|
||||||
move 1 from 1 to 5
|
|
||||||
move 1 from 5 to 4
|
|
||||||
move 1 from 4 to 8
|
|
||||||
move 42 from 2 to 1
|
|
||||||
move 3 from 9 to 3
|
|
||||||
move 1 from 8 to 1
|
|
||||||
move 1 from 3 to 4
|
|
||||||
move 3 from 8 to 7
|
|
||||||
move 1 from 4 to 1
|
|
||||||
move 2 from 3 to 2
|
|
||||||
move 17 from 1 to 6
|
|
||||||
move 15 from 6 to 3
|
|
||||||
move 2 from 9 to 7
|
|
||||||
move 1 from 3 to 6
|
|
||||||
move 2 from 7 to 6
|
|
||||||
move 2 from 2 to 4
|
|
||||||
move 1 from 2 to 3
|
|
||||||
move 1 from 4 to 9
|
|
||||||
move 1 from 4 to 1
|
|
||||||
move 1 from 6 to 3
|
|
||||||
move 20 from 1 to 9
|
|
||||||
move 6 from 1 to 9
|
|
||||||
move 7 from 9 to 3
|
|
||||||
move 20 from 9 to 1
|
|
||||||
move 1 from 6 to 7
|
|
||||||
move 2 from 6 to 7
|
|
||||||
move 1 from 6 to 5
|
|
||||||
move 1 from 6 to 8
|
|
||||||
move 4 from 7 to 3
|
|
||||||
move 3 from 7 to 2
|
|
||||||
move 1 from 6 to 4
|
|
||||||
move 1 from 2 to 1
|
|
||||||
move 1 from 4 to 9
|
|
||||||
move 21 from 3 to 2
|
|
||||||
move 5 from 3 to 8
|
|
||||||
move 1 from 5 to 1
|
|
||||||
move 2 from 8 to 7
|
|
||||||
move 4 from 8 to 3
|
|
||||||
move 4 from 2 to 5
|
|
||||||
move 19 from 2 to 3
|
|
||||||
move 1 from 9 to 2
|
|
||||||
move 23 from 3 to 2
|
|
||||||
move 2 from 7 to 4
|
|
||||||
move 3 from 5 to 9
|
|
||||||
move 16 from 2 to 1
|
|
||||||
move 1 from 5 to 4
|
|
||||||
move 1 from 9 to 3
|
|
||||||
move 2 from 3 to 8
|
|
||||||
move 3 from 4 to 6
|
|
||||||
move 1 from 6 to 2
|
|
||||||
move 1 from 8 to 6
|
|
||||||
move 5 from 2 to 6
|
|
||||||
move 7 from 6 to 5
|
|
||||||
move 4 from 2 to 6
|
|
||||||
move 6 from 5 to 9
|
|
||||||
move 1 from 8 to 4
|
|
||||||
move 18 from 1 to 9
|
|
||||||
move 1 from 5 to 2
|
|
||||||
move 9 from 9 to 4
|
|
||||||
move 5 from 6 to 3
|
|
||||||
move 9 from 4 to 1
|
|
||||||
move 4 from 9 to 2
|
|
||||||
move 1 from 4 to 8
|
|
||||||
move 1 from 8 to 3
|
|
||||||
move 7 from 1 to 8
|
|
||||||
move 6 from 3 to 2
|
|
||||||
move 10 from 2 to 9
|
|
||||||
move 21 from 1 to 8
|
|
||||||
move 1 from 2 to 8
|
|
||||||
move 19 from 8 to 4
|
|
||||||
move 1 from 8 to 3
|
|
||||||
move 16 from 4 to 8
|
|
||||||
move 1 from 4 to 2
|
|
||||||
move 2 from 1 to 5
|
|
||||||
move 1 from 2 to 3
|
|
||||||
move 1 from 4 to 5
|
|
||||||
move 1 from 4 to 8
|
|
||||||
move 2 from 1 to 3
|
|
||||||
move 3 from 3 to 2
|
|
||||||
move 5 from 9 to 1
|
|
||||||
move 1 from 3 to 4
|
|
||||||
move 4 from 9 to 4
|
|
||||||
move 2 from 1 to 9
|
|
||||||
move 2 from 2 to 5
|
|
||||||
move 1 from 2 to 7
|
|
||||||
move 3 from 1 to 7
|
|
||||||
move 10 from 8 to 6
|
|
||||||
move 4 from 8 to 5
|
|
||||||
move 3 from 4 to 3
|
|
||||||
move 3 from 3 to 4
|
|
||||||
move 1 from 9 to 8
|
|
||||||
move 2 from 7 to 2
|
|
||||||
move 1 from 2 to 1
|
|
||||||
move 4 from 9 to 3
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
# Day 5 Puzzle Text.
|
|
||||||
--- Day 5: Supply Stacks ---
|
|
||||||
The expedition can depart as soon as the final supplies have been unloaded from the ships. Supplies are stored in stacks of marked crates, but because the needed supplies are buried under many other crates, the crates need to be rearranged.
|
|
||||||
|
|
||||||
The ship has a giant cargo crane capable of moving crates between stacks. To ensure none of the crates get crushed or fall over, the crane operator will rearrange them in a series of carefully-planned steps. After the crates are rearranged, the desired crates will be at the top of each stack.
|
|
||||||
|
|
||||||
The Elves don't want to interrupt the crane operator during this delicate procedure, but they forgot to ask her which crate will end up where, and they want to be ready to unload them as soon as possible so they can embark.
|
|
||||||
|
|
||||||
They do, however, have a drawing of the starting stacks of crates and the rearrangement procedure (your puzzle input). For example:
|
|
||||||
```
|
|
||||||
[D]
|
|
||||||
[N] [C]
|
|
||||||
[Z] [M] [P]
|
|
||||||
1 2 3
|
|
||||||
|
|
||||||
move 1 from 2 to 1
|
|
||||||
move 3 from 1 to 3
|
|
||||||
move 2 from 2 to 1
|
|
||||||
move 1 from 1 to 2
|
|
||||||
```
|
|
||||||
In this example, there are three stacks of crates. Stack 1 contains two crates: crate Z is on the bottom, and crate N is on top. Stack 2 contains three crates; from bottom to top, they are crates M, C, and D. Finally, stack 3 contains a single crate, P.
|
|
||||||
|
|
||||||
Then, the rearrangement procedure is given. In each step of the procedure, a quantity of crates is moved from one stack to a different stack. In the first step of the above rearrangement procedure, one crate is moved from stack 2 to stack 1, resulting in this configuration:
|
|
||||||
```
|
|
||||||
[D]
|
|
||||||
[N] [C]
|
|
||||||
[Z] [M] [P]
|
|
||||||
1 2 3
|
|
||||||
```
|
|
||||||
In the second step, three crates are moved from stack 1 to stack 3. Crates are moved one at a time, so the first crate to be moved (D) ends up below the second and third crates:
|
|
||||||
```
|
|
||||||
[Z]
|
|
||||||
[N]
|
|
||||||
[C] [D]
|
|
||||||
[M] [P]
|
|
||||||
1 2 3
|
|
||||||
```
|
|
||||||
Then, both crates are moved from stack 2 to stack 1. Again, because crates are moved one at a time, crate C ends up below crate M:
|
|
||||||
```
|
|
||||||
[Z]
|
|
||||||
[N]
|
|
||||||
[M] [D]
|
|
||||||
[C] [P]
|
|
||||||
1 2 3
|
|
||||||
```
|
|
||||||
Finally, one crate is moved from stack 1 to stack 2:
|
|
||||||
```
|
|
||||||
[Z]
|
|
||||||
[N]
|
|
||||||
[D]
|
|
||||||
[C] [M] [P]
|
|
||||||
1 2 3
|
|
||||||
```
|
|
||||||
The Elves just need to know which crate will end up on top of each stack; in this example, the top crates are C in stack 1, M in stack 2, and Z in stack 3, so you should combine these together and give the Elves the message CMZ.
|
|
||||||
|
|
||||||
After the rearrangement procedure completes, what crate ends up on top of each stack?
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Paste any inputs into this file.
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 6: Tuning Trouble ---</h2><p>The preparations are finally complete; you and the Elves leave camp on foot and begin to make your way toward the <em class="star">star</em> fruit grove.</p>
|
|
||||||
<p>As you move through the dense undergrowth, one of the Elves gives you a handheld <em>device</em>. He says that it has many fancy features, but the most important one to set up right now is the <em>communication system</em>.</p>
|
|
||||||
<p>However, because he's heard you have <a href="/2016/day/6">significant</a> <a href="/2016/day/25">experience</a> <a href="/2019/day/7">dealing</a> <a href="/2019/day/9">with</a> <a href="/2019/day/16">signal-based</a> <a href="/2021/day/25">systems</a>, he convinced the other Elves that it would be okay to give you their one malfunctioning device - surely you'll have no problem fixing it.</p>
|
|
||||||
<p>As if inspired by comedic timing, the device emits a few <span title="The magic smoke, on the other hand, seems to be contained... FOR NOW!">colorful sparks</span>.</p>
|
|
||||||
<p>To be able to communicate with the Elves, the device needs to <em>lock on to their signal</em>. The signal is a series of seemingly-random characters that the device receives one at a time.</p>
|
|
||||||
<p>To fix the communication system, you need to add a subroutine to the device that detects a <em>start-of-packet marker</em> in the datastream. In the protocol being used by the Elves, the start of a packet is indicated by a sequence of <em>four characters that are all different</em>.</p>
|
|
||||||
<p>The device will send your subroutine a datastream buffer (your puzzle input); your subroutine needs to identify the first position where the four most recently received characters were all different. Specifically, it needs to report the number of characters from the beginning of the buffer to the end of the first such four-character marker.</p>
|
|
||||||
<p>For example, suppose you receive the following datastream buffer:</p>
|
|
||||||
<pre><code>mjqjpqmgbljsphdztnvjfqwrcgsmlb</code></pre>
|
|
||||||
<p>After the first three characters (<code>mjq</code>) have been received, there haven't been enough characters received yet to find the marker. The first time a marker could occur is after the fourth character is received, making the most recent four characters <code>mjqj</code>. Because <code>j</code> is repeated, this isn't a marker.</p>
|
|
||||||
<p>The first time a marker appears is after the <em>seventh</em> character arrives. Once it does, the last four characters received are <code>jpqm</code>, which are all different. In this case, your subroutine should report the value <code><em>7</em></code>, because the first start-of-packet marker is complete after 7 characters have been processed.</p>
|
|
||||||
<p>Here are a few more examples:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>bvwbjplbgvbhsrlpgdmjqwftvncz</code>: first marker after character <code><em>5</em></code></li>
|
|
||||||
<li><code>nppdvjthqldpwncqszvftbrmjlhg</code>: first marker after character <code><em>6</em></code></li>
|
|
||||||
<li><code>nznrnfrfntjfmvfwmzdfjlvtqnbhcprsg</code>: first marker after character <code><em>10</em></code></li>
|
|
||||||
<li><code>zcfzfwzzqfrljwzlrfnpqdbhtmscgvjw</code>: first marker after character <code><em>11</em></code></li>
|
|
||||||
</ul>
|
|
||||||
<p><em>How many characters need to be processed before the first start-of-packet marker is detected?</em></p>
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,76 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 7: No Space Left On Device ---</h2><p>You can hear birds chirping and raindrops hitting leaves as the expedition proceeds. Occasionally, you can even hear much louder sounds in the distance; how big do the animals get out here, anyway?</p>
|
|
||||||
<p>The device the Elves gave you has problems with more than just its communication system. You try to run a system update:</p>
|
|
||||||
<pre><code>$ system-update --please --pretty-please-with-sugar-on-top
|
|
||||||
<span title="E099 PROGRAMMER IS OVERLY POLITE">Error</span>: No space left on device
|
|
||||||
</code></pre>
|
|
||||||
<p>Perhaps you can delete some files to make space for the update?</p>
|
|
||||||
<p>You browse around the filesystem to assess the situation and save the resulting terminal output (your puzzle input). For example:</p>
|
|
||||||
<pre><code>$ cd /
|
|
||||||
$ ls
|
|
||||||
dir a
|
|
||||||
14848514 b.txt
|
|
||||||
8504156 c.dat
|
|
||||||
dir d
|
|
||||||
$ cd a
|
|
||||||
$ ls
|
|
||||||
dir e
|
|
||||||
29116 f
|
|
||||||
2557 g
|
|
||||||
62596 h.lst
|
|
||||||
$ cd e
|
|
||||||
$ ls
|
|
||||||
584 i
|
|
||||||
$ cd ..
|
|
||||||
$ cd ..
|
|
||||||
$ cd d
|
|
||||||
$ ls
|
|
||||||
4060174 j
|
|
||||||
8033020 d.log
|
|
||||||
5626152 d.ext
|
|
||||||
7214296 k
|
|
||||||
</code></pre>
|
|
||||||
<p>The filesystem consists of a tree of files (plain data) and directories (which can contain other directories or files). The outermost directory is called <code>/</code>. You can navigate around the filesystem, moving into or out of directories and listing the contents of the directory you're currently in.</p>
|
|
||||||
<p>Within the terminal output, lines that begin with <code>$</code> are <em>commands you executed</em>, very much like some modern computers:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>cd</code> means <em>change directory</em>. This changes which directory is the current directory, but the specific result depends on the argument:
|
|
||||||
<ul>
|
|
||||||
<li><code>cd x</code> moves <em>in</em> one level: it looks in the current directory for the directory named <code>x</code> and makes it the current directory.</li>
|
|
||||||
<li><code>cd ..</code> moves <em>out</em> one level: it finds the directory that contains the current directory, then makes that directory the current directory.</li>
|
|
||||||
<li><code>cd /</code> switches the current directory to the outermost directory, <code>/</code>.</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li><code>ls</code> means <em>list</em>. It prints out all of the files and directories immediately contained by the current directory:
|
|
||||||
<ul>
|
|
||||||
<li><code>123 abc</code> means that the current directory contains a file named <code>abc</code> with size <code>123</code>.</li>
|
|
||||||
<li><code>dir xyz</code> means that the current directory contains a directory named <code>xyz</code>.</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p>Given the commands and output in the example above, you can determine that the filesystem looks visually like this:</p>
|
|
||||||
<pre><code>- / (dir)
|
|
||||||
- a (dir)
|
|
||||||
- e (dir)
|
|
||||||
- i (file, size=584)
|
|
||||||
- f (file, size=29116)
|
|
||||||
- g (file, size=2557)
|
|
||||||
- h.lst (file, size=62596)
|
|
||||||
- b.txt (file, size=14848514)
|
|
||||||
- c.dat (file, size=8504156)
|
|
||||||
- d (dir)
|
|
||||||
- j (file, size=4060174)
|
|
||||||
- d.log (file, size=8033020)
|
|
||||||
- d.ext (file, size=5626152)
|
|
||||||
- k (file, size=7214296)
|
|
||||||
</code></pre>
|
|
||||||
<p>Here, there are four directories: <code>/</code> (the outermost directory), <code>a</code> and <code>d</code> (which are in <code>/</code>), and <code>e</code> (which is in <code>a</code>). These directories also contain files of various sizes.</p>
|
|
||||||
<p>Since the disk is full, your first step should probably be to find directories that are good candidates for deletion. To do this, you need to determine the <em>total size</em> of each directory. The total size of a directory is the sum of the sizes of the files it contains, directly or indirectly. (Directories themselves do not count as having any intrinsic size.)</p>
|
|
||||||
<p>The total sizes of the directories above can be found as follows:</p>
|
|
||||||
<ul>
|
|
||||||
<li>The total size of directory <code>e</code> is <em>584</em> because it contains a single file <code>i</code> of size 584 and no other directories.</li>
|
|
||||||
<li>The directory <code>a</code> has total size <em>94853</em> because it contains files <code>f</code> (size 29116), <code>g</code> (size 2557), and <code>h.lst</code> (size 62596), plus file <code>i</code> indirectly (<code>a</code> contains <code>e</code> which contains <code>i</code>).</li>
|
|
||||||
<li>Directory <code>d</code> has total size <em>24933642</em>.</li>
|
|
||||||
<li>As the outermost directory, <code>/</code> contains every file. Its total size is <em>48381165</em>, the sum of the size of every file.</li>
|
|
||||||
</ul>
|
|
||||||
<p>To begin, find all of the directories with a total size of <em>at most 100000</em>, then calculate the sum of their total sizes. In the example above, these directories are <code>a</code> and <code>e</code>; the sum of their total sizes is <code><em>95437</em></code> (94853 + 584). (As in this example, this process can count files more than once!)</p>
|
|
||||||
<p>Find all of the directories with a total size of at most 100000. <em>What is the sum of the total sizes of those directories?</em></p>
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
011112220220323233332231343014141131140112421211413355234334024414242133303312210313023000021220102
|
|
||||||
221002103112233201234202003421134043024153515443332415451142151141323114321301434333033210022221022
|
|
||||||
201200003311133331441214403131041312551423522332422531524232533513033233434420203421023110323221022
|
|
||||||
121121213131010131201002413232224444334133213322251443153145222321552044232113011214212110102102211
|
|
||||||
212113303331021314321111140111522454555135544314235452234224545142541330223322222234211031300120220
|
|
||||||
010212031223201244112200401335253221225255255322553133211323513113422143522323420011223321133113101
|
|
||||||
011020312301013040344114333334442144514455512552221415123255124524531151554104224200443112211210031
|
|
||||||
212103301320231332441144214355422451145143521345255326544451431544214432121550112030101122302303021
|
|
||||||
220232122110131143411335344551322314153422353555245353522346615142142533512423212340133002223102320
|
|
||||||
123203222223430330030314515252515255254362252265436645524643534633245232434155413030142133001200320
|
|
||||||
232211213322123322103442125511131155663325635553522434545445552266442151514322444424100420020000011
|
|
||||||
321232322313243000453341414523445426226644644265452262664344634465246122122543132514120020411332033
|
|
||||||
202331334121420235323225354242425245652324266442344526232654535245252651555215135125041401014413003
|
|
||||||
030112100334314051222325325124636325444634664346624462255253366255466452513431325251113413144442330
|
|
||||||
020200433043320152232154136232564443545365465255646653263522363554354564422421324241211021000140121
|
|
||||||
032011132023104255151145246424353264523526344436554334475646444542435562556325335443513020140421120
|
|
||||||
210204303043241221415453653453366254565373457364675545654666377423454542265263342335255230433142310
|
|
||||||
210312323220343143353556243436325432556736764666334633457533745332644345623536221544225432033020410
|
|
||||||
233410214315423344423442656226454445357767646343373565363645755734732354353645223242442442112322443
|
|
||||||
322403301001251255154242326443445466736576466455545656643435677365674243235222245343143455320114330
|
|
||||||
232343201234134131134332335444557474363474446344776366756565574535744735324323246532552555432040041
|
|
||||||
221232224415533122543465364445435364564576534743763474566355767775774577553544653464142513144443313
|
|
||||||
122112442244542214262445665475477545734565457478857667547473567477336557726442444644441243444402330
|
|
||||||
143012145515212424235524535555733334457686447444847564554866735433374643763343245542354341522310301
|
|
||||||
343034021325435535455442355474677535777784688864647648684444458747443667643423643452544435114443124
|
|
||||||
000403451411241463226443476733365546877644754747566667486574544543776475363624545332334511311214303
|
|
||||||
013002242525556352626433636455377384766855876756685885854848875568474373437675532433635212321111322
|
|
||||||
101010142252123346235437467476546685846885866865567487856755684744544675575633223264225545223542222
|
|
||||||
342002313434136635656244356646468576664565586756447555664585478665556463354555546643556622525525002
|
|
||||||
304211422335342355323755634454757484685568785668995686856577754577844777634756472362366633324314412
|
|
||||||
231133244553256623647336646666864756787445877675585597686594886667647464354533657554554353332112524
|
|
||||||
120344321215652622227445664658856658787585889889659567969656785855874777755473764556264244443152242
|
|
||||||
440423214313632526376434563658657485749798857588556576776776858587648478466464663564663336325425331
|
|
||||||
011254331316253653674574346456874647667888866559779658686765656768765578865554674352333225544221323
|
|
||||||
023413144524364645635675736677586666956885689798886598595799575656874764865373535644332466511331341
|
|
||||||
122254414355225323664755365568758589577679686887799795759896779887545576777454544375265466443443235
|
|
||||||
412421452563253445537467347658777879785759567968966967575558955868854646578873575357565236511122521
|
|
||||||
015221314664564236645543668766675798567999788879796666869699657885985874547845773566464625361212125
|
|
||||||
213255112624445653744634755467766595886577869989896967967796599685695675888763355455363352561531455
|
|
||||||
051115255524443264764435668448576976667776669978668998866669987997588887564444673776525636555252522
|
|
||||||
315344432555344664633555485554469988678878999897687977797786889787978545858784436346566536662543432
|
|
||||||
342334532442256655765436787556789957565686789788896899987689678797579887867778443435552454223234514
|
|
||||||
044222226353425754474346685474575657758678966697998869888679776868568567678584464343643446543142315
|
|
||||||
144512246654532464343347645766565789898698789788997968679687989758869974574466636667665323253213321
|
|
||||||
154415255624566636654388858668758665689978996897979798788878699767976598455446474765435324456113342
|
|
||||||
222333513555245346467374666655885657577998667798797888978998868866957797665858765377465234256133231
|
|
||||||
345551444536645634576788887678768556687766667898989777979999976777866956665855476574554565645424315
|
|
||||||
214425354332335634336444556745876659867688868787798798879898768996785655575686846567542442554353234
|
|
||||||
411151526365526435763654766745695769989997787877899999777677796975768665578855433353537425364324435
|
|
||||||
522535522334266753767645655578787759999797977799978897877967869699787686678555733446763633345235242
|
|
||||||
434554556234464756756646566577685856698867888798779989897888768886756666848455565474773255436431353
|
|
||||||
442445343526335577465554675665559886897887778777987888778968877985997667668778573677767566543431434
|
|
||||||
211451552626333634363465768567858685978899767778888797787769889997886696648488453374457335426324331
|
|
||||||
352321245665435473457546867457579566688987988898999788977968676875958875756786856557334623665613554
|
|
||||||
134251534254346364373746868447957667578688897887888977799998977767868758754674643636734354455334533
|
|
||||||
245245423445544557373667445675755587897766677987799879977688696665989986846448873477364262625234454
|
|
||||||
145224324344246776343755754785995768789786888699787788766886767677965697467477553656766544246513254
|
|
||||||
324145213325563543644657785454865677777876788869778868797668787676695555668476343574675463435354251
|
|
||||||
413445215463653557663646785857989685956686966678678698889778897766895898544664356673734242234254124
|
|
||||||
034351535553342544655674756865698875897888787897688768789698799656958666567856653353444644544544421
|
|
||||||
133431555226353336664734658784788759769799696889799686678886856966568675647876755663336364665314322
|
|
||||||
352533334635454546743545675475565978755677998676889876879868566868875574457747644333625466224445225
|
|
||||||
355351222554253337357543454756675876989667686867777777888979575678967457886686766643322426625255125
|
|
||||||
301424431256355654573454748776556985989986569888688898788856597696575488864856754567355352241115321
|
|
||||||
334321351343534467436553584585445758875669977678797666578677575578655877475477536443424544521454224
|
|
||||||
013544235464335336476633477774477476686866559855687876665969679665764854667467373455335366315243233
|
|
||||||
112151451535653464334745366774754847778758859698679755768697858997878486758757546343322225255512514
|
|
||||||
443545411335354445544673335765684574789589677978989757787667778688476787477664364445336662115531221
|
|
||||||
443244544145445266247734664546768464658669796775859668897565658658468857653377655436433366414135313
|
|
||||||
010252534423256334446667573476457575487596776895885755586667884466654888463534655556544243135421414
|
|
||||||
014442551411344322466653454757848477584476886899967686787665786647774457465756356452536324535435123
|
|
||||||
334422335251334244533574565465486878485446665569659976696474654844488654654664446434222541455145113
|
|
||||||
422042222114544645653646637673357446446767657686784455466855674884758555555655725563322345443214311
|
|
||||||
402101351333342265545553643374447487578876487756686755567778855457564663644744556325335113252214413
|
|
||||||
020401432452525465462342675634576768765558475768546747458444657465736777435756524535423151534540433
|
|
||||||
243400241421422365236324343433537655646765656686868457744888876887645466644353552522561443452110131
|
|
||||||
003103135121351256222624237444364336577744656885555668476484458534564557546523454435651431352134341
|
|
||||||
442201144132352152442423554634347545537756888457774564788446865557333633753246362522533121322124221
|
|
||||||
042304405522541234526265624675463537343637577754484575664343357636766467765454625421455125252421130
|
|
||||||
314110031551545454255523645535756377673434677564574657764673676766535556624242334545542323234044343
|
|
||||||
041012332333325345165432634364576475755744555334564654644333744353563644464423523312312411403444121
|
|
||||||
124302121131253134543646522633333333576373775465555676773747353674453633545332653355411213114300403
|
|
||||||
302411422212352135214225645652536667357533357667635654377766436757352425435362534153522532340243120
|
|
||||||
203202223241334312122414443425254534435347434576567673567635537464322534362435145114215322422004201
|
|
||||||
110342140441034112531143666254342264344435346667664677454757336354363455622352232125251133310231303
|
|
||||||
300304343314324221532432445663443563562366357346443374734472246525566435265232524142512222034111133
|
|
||||||
202233112212120515131252235262346544266665653664554636565424424235234433226241324545132240232410001
|
|
||||||
332313111224211043414543212336356265244525555535245664242355426664325225354122332125233004041231313
|
|
||||||
212202242323141205314235551145533455663632653424353364426426265425636324111513154352142322133233021
|
|
||||||
222001223102021231253525543223522653656656533626646546323265643636332221114125535230342011132023003
|
|
||||||
131321002042102021303551143221352255263646432525653222536364426366255225412113334103102433030120120
|
|
||||||
123013232113443113004333513541141433446563565453423353632226246342532522253511543223024330220123232
|
|
||||||
020100001122004013021214144132214525141333344452225255633226351331523254423535242210042134110021313
|
|
||||||
000032312330431022234112313521113225332255235165644226445131125441512142114320042430310221111210323
|
|
||||||
222131320213212322000341013532113515512425422422531545412311135522225313553330241403034233001021201
|
|
||||||
102232032332111012030031433325455242543415353325354325411434155351223114403024214003424030023121101
|
|
||||||
001023120230001141401143210134432545451343542414432432444534422135454111411010334001323200230022022
|
|
||||||
020210023322210014243401240134314541235251513215515342432345433232312001040222232101223203330221220
|
|
||||||
022010220332323232024402340343441321225445453325151544211235521343432303124012101020011220000301222
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 8: Treetop Tree House ---</h2><p>The expedition comes across a peculiar patch of tall trees all planted carefully in a grid. The Elves explain that a previous expedition planted these trees as a reforestation effort. Now, they're curious if this would be a good location for a <a href="https://en.wikipedia.org/wiki/Tree_house" target="_blank">tree house</a>.</p>
|
|
||||||
<p>First, determine whether there is enough tree cover here to keep a tree house <em>hidden</em>. To do this, you need to count the number of trees that are <em>visible from outside the grid</em> when looking directly along a row or column.</p>
|
|
||||||
<p>The Elves have already launched a <a href="https://en.wikipedia.org/wiki/Quadcopter" target="_blank">quadcopter</a> to generate a map with the height of each tree (<span title="The Elves have already launched a quadcopter (your puzzle input).">your puzzle input</span>). For example:</p>
|
|
||||||
<pre><code>30373
|
|
||||||
25512
|
|
||||||
65332
|
|
||||||
33549
|
|
||||||
35390
|
|
||||||
</code></pre>
|
|
||||||
<p>Each tree is represented as a single digit whose value is its height, where <code>0</code> is the shortest and <code>9</code> is the tallest.</p>
|
|
||||||
<p>A tree is <em>visible</em> if all of the other trees between it and an edge of the grid are <em>shorter</em> than it. Only consider trees in the same row or column; that is, only look up, down, left, or right from any given tree.</p>
|
|
||||||
<p>All of the trees around the edge of the grid are <em>visible</em> - since they are already on the edge, there are no trees to block the view. In this example, that only leaves the <em>interior nine trees</em> to consider:</p>
|
|
||||||
<ul>
|
|
||||||
<li>The top-left <code>5</code> is <em>visible</em> from the left and top. (It isn't visible from the right or bottom since other trees of height <code>5</code> are in the way.)</li>
|
|
||||||
<li>The top-middle <code>5</code> is <em>visible</em> from the top and right.</li>
|
|
||||||
<li>The top-right <code>1</code> is not visible from any direction; for it to be visible, there would need to only be trees of height <em>0</em> between it and an edge.</li>
|
|
||||||
<li>The left-middle <code>5</code> is <em>visible</em>, but only from the right.</li>
|
|
||||||
<li>The center <code>3</code> is not visible from any direction; for it to be visible, there would need to be only trees of at most height <code>2</code> between it and an edge.</li>
|
|
||||||
<li>The right-middle <code>3</code> is <em>visible</em> from the right.</li>
|
|
||||||
<li>In the bottom row, the middle <code>5</code> is <em>visible</em>, but the <code>3</code> and <code>4</code> are not.</li>
|
|
||||||
</ul>
|
|
||||||
<p>With 16 trees visible on the edge and another 5 visible in the interior, a total of <code><em>21</em></code> trees are visible in this arrangement.</p>
|
|
||||||
<p>Consider your map; <em>how many trees are visible from outside the grid?</em></p>
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,233 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 9: Rope Bridge ---</h2><p>This rope bridge creaks as you walk along it. You aren't sure how old it is, or whether it can even support your weight.</p>
|
|
||||||
<p>It seems to support the Elves just fine, though. The bridge spans a gorge which was carved out by the massive river far below you.</p>
|
|
||||||
<p>You step carefully; as you do, the ropes stretch and twist. You decide to distract yourself by modeling rope physics; maybe you can even figure out where <em>not</em> to step.</p>
|
|
||||||
<p>Consider a rope with a knot at each end; these knots mark the <em>head</em> and the <em>tail</em> of the rope. If the head moves far enough away from the tail, the tail is pulled toward the head.</p>
|
|
||||||
<p>Due to nebulous reasoning involving <a href="https://en.wikipedia.org/wiki/Planck_units#Planck_length" target="_blank">Planck lengths</a>, you should be able to model the positions of the knots on a two-dimensional grid. Then, by following a hypothetical <em>series of motions</em> (your puzzle input) for the head, you can determine how the tail will move.</p>
|
|
||||||
<p><span title="I'm an engineer, not a physicist!">Due to the aforementioned Planck lengths</span>, the rope must be quite short; in fact, the head (<code>H</code>) and tail (<code>T</code>) must <em>always be touching</em> (diagonally adjacent and even overlapping both count as touching):</p>
|
|
||||||
<pre><code>....
|
|
||||||
.TH.
|
|
||||||
....
|
|
||||||
|
|
||||||
....
|
|
||||||
.H..
|
|
||||||
..T.
|
|
||||||
....
|
|
||||||
|
|
||||||
...
|
|
||||||
.H. (H covers T)
|
|
||||||
...
|
|
||||||
</code></pre>
|
|
||||||
<p>If the head is ever two steps directly up, down, left, or right from the tail, the tail must also move one step in that direction so it remains close enough:</p>
|
|
||||||
<pre><code>..... ..... .....
|
|
||||||
.TH.. -> .T.H. -> ..TH.
|
|
||||||
..... ..... .....
|
|
||||||
|
|
||||||
... ... ...
|
|
||||||
.T. .T. ...
|
|
||||||
.H. -> ... -> .T.
|
|
||||||
... .H. .H.
|
|
||||||
... ... ...
|
|
||||||
</code></pre>
|
|
||||||
<p>Otherwise, if the head and tail aren't touching and aren't in the same row or column, the tail always moves one step diagonally to keep up:</p>
|
|
||||||
<pre><code>..... ..... .....
|
|
||||||
..... ..H.. ..H..
|
|
||||||
..H.. -> ..... -> ..T..
|
|
||||||
.T... .T... .....
|
|
||||||
..... ..... .....
|
|
||||||
|
|
||||||
..... ..... .....
|
|
||||||
..... ..... .....
|
|
||||||
..H.. -> ...H. -> ..TH.
|
|
||||||
.T... .T... .....
|
|
||||||
..... ..... .....
|
|
||||||
</code></pre>
|
|
||||||
<p>You just need to work out where the tail goes as the head follows a series of motions. Assume the head and the tail both start at the same position, overlapping.</p>
|
|
||||||
<p>For example:</p>
|
|
||||||
<pre><code>R 4
|
|
||||||
U 4
|
|
||||||
L 3
|
|
||||||
D 1
|
|
||||||
R 4
|
|
||||||
D 1
|
|
||||||
L 5
|
|
||||||
R 2
|
|
||||||
</code></pre>
|
|
||||||
<p>This series of motions moves the head <em>right</em> four steps, then <em>up</em> four steps, then <em>left</em> three steps, then <em>down</em> one step, and so on. After each step, you'll need to update the position of the tail if the step means the head is no longer adjacent to the tail. Visually, these motions occur as follows (<code>s</code> marks the starting position as a reference point):</p>
|
|
||||||
<pre><code>== Initial State ==
|
|
||||||
|
|
||||||
......
|
|
||||||
......
|
|
||||||
......
|
|
||||||
......
|
|
||||||
H..... (H covers T, s)
|
|
||||||
|
|
||||||
== R 4 ==
|
|
||||||
|
|
||||||
......
|
|
||||||
......
|
|
||||||
......
|
|
||||||
......
|
|
||||||
TH.... (T covers s)
|
|
||||||
|
|
||||||
......
|
|
||||||
......
|
|
||||||
......
|
|
||||||
......
|
|
||||||
sTH...
|
|
||||||
|
|
||||||
......
|
|
||||||
......
|
|
||||||
......
|
|
||||||
......
|
|
||||||
s.TH..
|
|
||||||
|
|
||||||
......
|
|
||||||
......
|
|
||||||
......
|
|
||||||
......
|
|
||||||
s..TH.
|
|
||||||
|
|
||||||
== U 4 ==
|
|
||||||
|
|
||||||
......
|
|
||||||
......
|
|
||||||
......
|
|
||||||
....H.
|
|
||||||
s..T..
|
|
||||||
|
|
||||||
......
|
|
||||||
......
|
|
||||||
....H.
|
|
||||||
....T.
|
|
||||||
s.....
|
|
||||||
|
|
||||||
......
|
|
||||||
....H.
|
|
||||||
....T.
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
....H.
|
|
||||||
....T.
|
|
||||||
......
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
== L 3 ==
|
|
||||||
|
|
||||||
...H..
|
|
||||||
....T.
|
|
||||||
......
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
..HT..
|
|
||||||
......
|
|
||||||
......
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
.HT...
|
|
||||||
......
|
|
||||||
......
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
== D 1 ==
|
|
||||||
|
|
||||||
..T...
|
|
||||||
.H....
|
|
||||||
......
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
== R 4 ==
|
|
||||||
|
|
||||||
..T...
|
|
||||||
..H...
|
|
||||||
......
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
..T...
|
|
||||||
...H..
|
|
||||||
......
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
......
|
|
||||||
...TH.
|
|
||||||
......
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
......
|
|
||||||
....TH
|
|
||||||
......
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
== D 1 ==
|
|
||||||
|
|
||||||
......
|
|
||||||
....T.
|
|
||||||
.....H
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
== L 5 ==
|
|
||||||
|
|
||||||
......
|
|
||||||
....T.
|
|
||||||
....H.
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
......
|
|
||||||
....T.
|
|
||||||
...H..
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
......
|
|
||||||
......
|
|
||||||
..HT..
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
......
|
|
||||||
......
|
|
||||||
.HT...
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
......
|
|
||||||
......
|
|
||||||
HT....
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
== R 2 ==
|
|
||||||
|
|
||||||
......
|
|
||||||
......
|
|
||||||
.H.... (H covers T)
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
|
|
||||||
......
|
|
||||||
......
|
|
||||||
.TH...
|
|
||||||
......
|
|
||||||
s.....
|
|
||||||
</code></pre>
|
|
||||||
<p>After simulating the rope, you can count up all of the positions the <em>tail visited at least once</em>. In this diagram, <code>s</code> again marks the starting position (which the tail also visited) and <code>#</code> marks other positions the tail visited:</p>
|
|
||||||
<pre><code>..##..
|
|
||||||
...##.
|
|
||||||
.####.
|
|
||||||
....#.
|
|
||||||
s###..
|
|
||||||
</code></pre>
|
|
||||||
<p>So, there are <code><em>13</em></code> positions the tail visited at least once.</p>
|
|
||||||
<p>Simulate your complete hypothetical series of motions. <em>How many positions does the tail of the rope visit at least once?</em></p>
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,28 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 1: Trebuchet?! ---</h2><p>Something is wrong with global snow production, and you've been selected to take a look. The Elves have even given you a map; on it, they've used stars to mark the top fifty locations that are likely to be having problems.</p>
|
|
||||||
<p>You've been doing this long enough to know that to restore snow operations, you need to check all <em class="star">fifty stars</em> by December 25th.</p>
|
|
||||||
<p>Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants <em class="star">one star</em>. Good luck!</p>
|
|
||||||
<p>You try to ask why they can't just use a <a href="/2015/day/1">weather machine</a> ("not powerful enough") and where they're even sending you ("the sky") and why your map looks mostly blank ("you sure ask a lot of questions") <span title="My hope is that this abomination of a run-on sentence somehow conveys the chaos of being hastily loaded into a trebuchet.">and</span> hang on did you just say the sky ("of course, where do you think snow comes from") when you realize that the Elves are already loading you into a <a href="https://en.wikipedia.org/wiki/Trebuchet" target="_blank">trebuchet</a> ("please hold still, we need to strap you in").</p>
|
|
||||||
<p>As they're making the final adjustments, they discover that their calibration document (your puzzle input) has been <em>amended</em> by a very young Elf who was apparently just excited to show off her art skills. Consequently, the Elves are having trouble reading the values on the document.</p>
|
|
||||||
<p>The newly-improved calibration document consists of lines of text; each line originally contained a specific <em>calibration value</em> that the Elves now need to recover. On each line, the calibration value can be found by combining the <em>first digit</em> and the <em>last digit</em> (in that order) to form a single <em>two-digit number</em>.</p>
|
|
||||||
<p>For example:</p>
|
|
||||||
<pre><code>1abc2
|
|
||||||
pqr3stu8vwx
|
|
||||||
a1b2c3d4e5f
|
|
||||||
treb7uchet
|
|
||||||
</code></pre>
|
|
||||||
<p>In this example, the calibration values of these four lines are <code>12</code>, <code>38</code>, <code>15</code>, and <code>77</code>. Adding these together produces <code><em>142</em></code>.</p>
|
|
||||||
<p>Consider your entire calibration document. <em>What is the sum of all of the calibration values?</em></p>
|
|
||||||
|
|
||||||
<p>Your puzzle answer was <code>56049</code>.</p><article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>Your calculation isn't quite right. It looks like some of the digits are actually <em>spelled out with letters</em>: <code>one</code>, <code>two</code>, <code>three</code>, <code>four</code>, <code>five</code>, <code>six</code>, <code>seven</code>, <code>eight</code>, and <code>nine</code> <em>also</em> count as valid "digits".</p>
|
|
||||||
<p>Equipped with this new information, you now need to find the real first and last digit on each line. For example:</p>
|
|
||||||
<pre><code>two1nine
|
|
||||||
eightwothree
|
|
||||||
abcone2threexyz
|
|
||||||
xtwone3four
|
|
||||||
4nineeightseven2
|
|
||||||
zoneight234
|
|
||||||
7pqrstsixteen
|
|
||||||
</code></pre>
|
|
||||||
<p>In this example, the calibration values are <code>29</code>, <code>83</code>, <code>13</code>, <code>24</code>, <code>42</code>, <code>14</code>, and <code>76</code>. Adding these together produces <code><em>281</em></code>.</p>
|
|
||||||
<p><em>What is the sum of all of the calibration values?</em></p>
|
|
||||||
@@ -1,140 +0,0 @@
|
|||||||
|-L.FL-FJFL.|7FJ7F|F7-7F77.FL7---.7FF77--.|-F|FF--7FF7F-7F--77FFFJFJF7.F-LF7LFJJ.F|.|77F7F---7FLL.|FFJ.FF7-77..F77.-F-7FL-FF|77F-FFLL-FJ-|.J
|
|
||||||
|7JF77-|L7J-F-JJL7|-|LJLF-|7.|.LLLJ7|-7.LFJFF--JF7L7|||FJ|F-J77L|F7.L-FJF----L7.FF.FJ-J-L-7|L|LJ7FJJJ.F|L-7L7.FF-|-7F-|J..||LJ-|-J-.|L|J|LF|
|
|
||||||
LJ-LL|F7|LL7LLL-|-F7||..||..FJ.FJJF-7JJ|.7JLL--7|L7LJLJ|FJL-77|..FFJ7FJ7L7-|-JL.F--7LJJ|LJJ.F-|L7.FF-L7-F-7F77|J7||FLFJ|FFLL7.|JFJJ--J|.7-7|
|
|
||||||
|.FJ.|F7-7L77|||L7JL-7LF777-JJ.|7F-L7JFJ7|F-|.LLJ|L---7||F--J7JFLF|JF-.--7||J.|F-.7LLLFF7||7F777L7FJ-||LJ7|||F|L-7.JJ.||7||J7.|-LL.7J.F7L7--
|
|
||||||
F-7LF||.FLJL-7|FF|L7FL-L||F-7|FL7LJ|L7L|.LLJ|FJJLF---7|||L---7L7|L|7||FLFLJ|-FF-7|777FJ7|-FFJ|L77LL-F.JJJL7LLJ.|L7FJFF-77LF-7-|-|77L|7.L--7|
|
|
||||||
F-JF-L7--J|JLL7-|LJ|F|J7L|J.J-|F7J7F|JF-7.|LF7F77L--7||LJF---JL-JJ|LJ7FJL7L|JLFJF|7FF7.-JJFL7|-F77J-777JF|L7J.|--L|J7|7LJ7JFJJ..|-J--7.L7.FJ
|
|
||||||
L7J|7||J--L-F7.||LFL-JF7.F7.|.FL7.FF7L|7F|FF-7F-7F7FJLJF7L----7JFFJJ.J|7L|7L7JLL|JFFJ7.|.|F-J|FJL7|F7-|F7JF|FF.|.||7L-J7LF-||.L7J7L7FJ7.L-.|
|
|
||||||
L7.L-FJJJF|FJ-.|JF--J7FJ7LLJ-..LJF||L-7F-7-L7|L7|||L--7|L-----J-FF-F7FL77|---F7JLL-|JF-77FL-7LJF-JFJ|-|-7-7L-7-7-JLJ-|L7-JJLF7-J-7|L77JFJJ.|
|
|
||||||
LL-|FJL7.L|J7|-L7F.|FL-.FJJ.F-F-F-7L-7LJFJ|F|L-JLJL7F7|L----7|.F7F7F7JJ-L--|JJ7|-7-LF|FJF7J|L-7||FJFJ.LLJ.77||.L.LF7LF-F77F-J.F7-J7L-F7FJF-.
|
|
||||||
FJ.|J7L77-7LL7J-7---FJ-FL---|||FJFJLLL-7|F7FL-----7||||F--7FJ-FJ||LJ||..LF7|JL--F||.FJL7||LF-7|L7|FJF7-.F-LJ.-7.F7.77F7||7-|L7LJJJFJ.FJJF-L.
|
|
||||||
|.F|F7-.|.JJ.L..L|JL7..FJL|FF-7L7L-7F--JLJ|7LF7F--JLJLJ|F7LJJFL7||F-J--J7|7..F|-FL|FL7FJ|L7L7LJFJ|L7||7F|J|L7.F7F77.FJ||L--7--7|7.L-7L-77J|7
|
|
||||||
LF-LL.L7J.FF-.F-||--.|-|-F--|FJ7L-7|L--7F7|F-J||F7F---7|||F7LFFJLJL7JL|.FF-77FF7JJF77|||L7L-JF-JLL7||L7F7|F-|.||||LFL7||F7FJ-LJ-77J-J7.LJF7J
|
|
||||||
FF.|..7JJ7FLJ7|L-7F|F|.|7LLL|L7F--JL7F7||LJL7FJLJLJLF7|||LJL7FJF---J-|F77|JL7L|||FJL-JL-7L--7L7F7FJ|L7||L7L-F-J|||F7F||||LJ7LLJ.7JFFLF-L7LJ-
|
|
||||||
L.FJ-|77--F||F77JJLF-7-J7F7LL7||F--7||LJL7|FJL-7F--7|||LJF--JL7|F-7JF--F7|.L7.|L7L----7FJF7FJFJ||L7|FJ||FJ77L-7LJ||L-JLJL7-|..-.|F7--77LJ-|J
|
|
||||||
F|.L7||--FLJ7.L7F-J|FJJFF7FF7||LJF7||L7F7L7L7F-JL-7||||F-JLF-7|LJFJ7JFLF--77L-L7|7FF-7|L7||L7L7||FJ|L7LJ|F7F-7|F-JL--7F--J7F|J-F|7|LLJL7JF|.
|
|
||||||
J|LF|FJFFL.|F7LLJ|.|L7F7||FJLJL--JLJL7LJL7L7|L--7FJLJLJ|LF-JFJ|F-JF7.|.L7FJF7JFJL7FJFJ|FJ||7L7||LJFJ7L7FJ||L7|||F-7F7||F7LLJJ7.FJ.F77JF|F7|F
|
|
||||||
||JFJ|F|J|7|JJL|-7-L7LJ|||L-7F7F--7F7L7F7L7LJF--JL--7F7L7|F-JFJL-7||-F-7||FJL7L7FJL7L-JL7||F-JLJF-JLF-JL-J|FJLJLJFJ|LJLJ|7J.F|7LJL|--7FJF|||
|
|
||||||
L7--.LLJJ--|.FFJF-7-L-7||L-7LJ||F7LJL7LJL7L-7L-7F7F-J|L7LJL77L7F-J|L7L7|||L-7|FJL7FJF-7FJ||L-7F7|F7JL7F7F-JL--7F-J|L--7FJF77J|F|JLL7FLFLLJ|F
|
|
||||||
.JLLF77.L-.|.LJ-7||FF-J||F-JF7LJ|L--7L-7FJF7|F-J||L--JLL-7FJF7||F7L7|FJ||L7FJLJF-JL-J||L7|L-7LJ|||L7FJ|||JF7F-J|F--7F-JL-JL7F---7JJ|F-JJ7LL-
|
|
||||||
7-F7|FLJ7|7L-|.FJFL-L-7||L7FJL7LL-7FJF7|L-JLJL-7|L7F-7F7FJ|FJLJLJL7||L7||FJL-7FJF7F7F7|FJ|F-JF7|||FJ|FJLJFJ|L-7||F-JL--7F-7LJF--JJ7||||.7F|.
|
|
||||||
L7LL|J|FFJ7FL7.FFJFFF-JLJFJL7FJF7FJ|FJ||F7F---7||FJL7||||FJ|F-7F7FJ||FJLJL7FFJL-J||LJLJL7|L-7||||||L||F7FJFJF-JLJ|F7F7FJL7L7FJF7.F7J-FF.FL-7
|
|
||||||
LJ.LL7-J-JL|F|F---7FJF7F7L-7|L7|LJFJL7|LJLJF7FJLJL-7|LJ|||L||7LJLJJ|||F---JFJF---JL---7FJ|F-J|LJ||L7||||L7||L---7LJ|||L7FJ-|L-JL-J|.F-JFF.L7
|
|
||||||
FJF|.L--L|-FLFL--7|L7||||F-J|FJL-7L7FJ|7F--JLJF----JL-7LJL7|L---7F7|LJL-7F7|FJF-7F-7F7|L7|L-7L7FJ|FJ|||L7|L7-F-7L-7LJL-JL-7L--7F--J.|.7JL|L|
|
|
||||||
F-|77FJLFFJ|J.|F7|L7LJLJ||F-JL7F7L7|L7L7L----7L----7F7L-7FJ|F---J||L---7||LJL7L7|L7|||L7||F-JFJL-J|FJ||FJ|FJFJFJF7|F---7F7L7.LLJJJ.--7J.F777
|
|
||||||
|..77-L-7-.LF7FJLJFJ7FF-J|L--7||L7||FJFJF7F7L|F---7|||F7|L7|L--7FJL7F7FJ||F7FJFJ|FJLJL7|||L7FJF7F-JL7LJL7|L-JFJFJLJ|F7F|||FJ-LJ|LLL.J|F-F.|.
|
|
||||||
-7-LL|7FJ7L-|-|F-7L--7L-7|F7L|||FJ||L7|F|||L7||JF7LJ|LJ|L7||F--JL7FJ||L7|||LJL|FJL---7||||FJ|FJLJF--JF--J|F--JFJF--J|L7|||L7JFFF7L|7.L|F77J7
|
|
||||||
F|7J.-J-LL7L-JLJ7L7F-JF-JLJL-JLJ|FJL7|L7||L7LJL7||F7L-7L7|||L-7F7|L7|L7|||L---JL7F-7FJ||LJL-J|FF7L-7FJ|F-JL7F7L7L7F7|FJLJL-J-F-7.F|F7JL-JFFF
|
|
||||||
FLF.LLL7|.|-7.F7F7||F7L-------7FJL7FJL7|||LL7F-J|||L--JFJ|||F-J|||FJL7||LJF-----JL7||FJ|F---7L-J|F7||F7L--7|||.|FJ|LJ|F7.F7|7L7L7-J|FJL|LLJJ
|
|
||||||
LJ.|7|LF|7J.LFJLJLJLJL7F--7F--JL--JL7FJ|||F-JL-7||L---7|FJLJL-7|LJL77|||F-JF-7-F7FJLJ|7LJF--JF--J|||LJ|FF7|||L-JL-JF7LJ|FJL77FJFJ|.JJ7F-J|||
|
|
||||||
FF-|-J|LJ||7LL--7F7F7FJL-7|L-7F7F-7FJ|FJ|||F---J|L-7F-J||F----JL--7L7|LJ|F7L7L7||L--7L--7L--7L--7|||F-JFJLJLJF7F7F-JL--J|F7L-JFJJ-LJL-J.|F--
|
|
||||||
-J||-LJJF-F-J7L-LJLJ|L---JL--J|||FJ|FJ|FJ||L-7F-JF7|L-7LJL-7F-7F7L|FJL7FJ|L7L7|||F7FJF--JF7.|F--J|||L-7L--7F-JLJ|L------J|L---J7|-J7FFL77||J
|
|
||||||
LL||7.|LJ.|L-7L7-F-7|F7F-7F7F7|LJL7LJFJL7||F-JL--J||F7|F-7FJ|FJ|L-JL7FJL-JFJF||||||L7|F-7||FJL7F7|LJF-JFF-J|F--7L-7F-7F--J7F7|F7777LFL.LF-77
|
|
||||||
.LL-F-77J.J7-|-F7|FJLJLJ-LJLJLJ-F7L-7|F7|LJ|F7F7F-J|||LJFJL7|L7L---7LJF---JF7|||LJ|FJLJFJ||L7FJ||L-7L--7L-7LJF7L-7||FJL----JL-JL77FF|-|-7|LL
|
|
||||||
F7.F|-|--7JFF77|||L7F---7|F7FFF7|L--J|||L-7LJLJ||F7LJ|F7L7FJL7|F7F-JF7|F--7||||L-7LJF--JFJ|FJL7||F7L7F-JF7|F-JL-7|||L7F--------7L7----|FJ-7L
|
|
||||||
L|-L--|FFFF7||FJ|L7|L--7|FJL7FJ|L---7|||F7|F---JLJL7FJ||7||F7||||L7FJLJ|F-J||||F7L-7|F77L7|L7FJ||||L||F7|||L---7LJLJFJL-------7|FJ-77JF77.7J
|
|
||||||
F--||.F--7||||L7|J|L---JLJF7|L7|7F--JLJ|||||F-7F7F-JL7|L7|||||||L7||F7FJ|F7|||||L7FJ||L7FJL7||FJ||L7|||LJLJF7F7L--7-L-7F7F----J||--J-7LLJ-JJ
|
|
||||||
LJFJ|FL-7LJLJL-JL7L----7F7|||FJL7L---7F||LJ||FJ||L7F-J|FJ|LJ||LJ-||LJ|L7LJ||||||FJL7||FJ|-FJ|||FJL7||||F---JLJL--7L--7|||L-7..LLJ7|.|F7FJ7L7
|
|
||||||
|.L7L-|-|F7F-7F-7|-F7F7LJ|||LJF7L77F7|FJL-7|||FJ|FJL-7|L7|F-JL--7LJF7L7L7FJ|||LJ|F-J|||FJFJFJ||L7FJ||||L---7F---7|F--JLJL--J-FF7JLL-F7LJ||J.
|
|
||||||
-J-LJ7LFLJ|L7|L7|L-JLJL-7LJL7FJL7L-J|||F7FJ||||7LJF--JL7||L7F7F7L7FJL7L7|L7|||F7|L-7||||FL7|FJL7|L7||LJF---J|F7FJ|L-7F-7F7F7-FJ|-|.F777F|JFJ
|
|
||||||
|F-LL7F|J.|FJL-JL7F----7|.F7LJF7L--7LJLJ|L7|||L--7L7F7FJ||J||LJ|FJ|F7L-J|F|||LJ||F-J||LJF-J||F-J|FJLJF7L----J|||-L--JL7||LJL7|FJJ|-|L-7JJ.L7
|
|
||||||
L-J.|L7JJ.LJ.F7F7LJ|F7FJL7|L--JL--7L7F7.|FJLJ|F--J.LJ|L7||FJL7FJL7LJL7F7|FJ|L7FJ|L7-|L-7L7FJ||JFJL7F-JL------JLJF7F7F7|||F--J|L-77.|F-JJ7JF|
|
|
||||||
|-7F|J|.|.F7.|LJL---J|L-7LJF7F7F-7L-J|L7|L7F-JL---7F7|FJLJ|F7|L7FJF7F||||L7|L|L7L7L7|F-J.||JLJFJF-JL-----------7|||||||LJL7F7|F-J7-|L-7.F.-L
|
|
||||||
F7L7|L|F-7|L-JF-----7L--JF7|LJLJFL---JFJ|FJL-7F7F7||LJL--7LJ||-LJFJL7LJ||J||FJFJ7|FJLJF--J|F--JFJFF7F---------7LJ||LJLJF7FJ|||L7F7FJF-J7|F..
|
|
||||||
.FFFJ.|7.F|F7FJF-7F7L--7FJ||F7LF7F----JFLJF7FJ|||||L7F7F7|FFJL--7|F7L--JL7|||FJF-JL-7.L7F7|L--7||FJLJF-------7L--J|F---JLJFJ||FJ|LJFJ|7L|J.F
|
|
||||||
--7|LJ-JF-LJLJ|L7LJL---JL7LJ||FJ|L-7F--7F7||L7|LJ||7||LJ|L7L7F-7|||L7F-7FJ||LJ-L7F--JF7LJLJF--JL7L7F-JJF-----JF---JL--7F77|FJ||FJF7L-7--J||J
|
|
||||||
FLLJ-LF7J||F-7F7L---7F7F-JF7||L7L-7LJF7|||||7LJF7LJFJL-7|FJFJL7LJLJFJL7||FJ|F---JL---JL-7F-JF-7FJFJ|FF7L-----7|F------J||FJL7|LJFJ|F7|F|FFL7
|
|
||||||
JL---77J|--L7LJL-7F-J|LJF-JLJ|7|F7L--JLJ|LJL---JL-7|F7FJ|L7|F7L--7FJF7|||L7||F7F7F7F-7F7||F-JFJL7L-JFJL------J|L---7F--J|L7FJ|F-JLLJ||7LFJFJ
|
|
||||||
.|L7||JF--JL|F7F7||F7|F-JF7F7L-J||F7F7JFJF7F7F7F--J|||L7L7||||F-7|L7|||||FJ|||||LJ|L7||||LJ-FJF7|F7FJF----7F7.|F---J|F--JF|L-JL-7L|-LJ--77FL
|
|
||||||
L7LLJ.LJ.|FLLJ||||LJ||L--JLJL7F-JLJLJL-JFJLJ|||L--7|||FJ7||||||FLJF||||LJL7||||L-7|FJ||||F--JFJLJ|LJFJF---J|L7||F7F7||F7|FJF---7L7-7L|-L-7J|
|
|
||||||
.J7.LL7F--J-||LJ|L-7||F-7F7F7LJF----7F--JF7.LJL7F-J|||L-7|||||L7F--J|LJ-F-J|||L7FJ|||LJ||L7F7L7FSL--J.L--7.L7||LJLJLJLJL7L7L--7|FJF-F|7|LL-7
|
|
||||||
F||JJFFFJ|FFFF-7L7FJLJL7|||||F7L---7||F7F|L---7||F7|||F7||||||FJL7F7L--7|F7|||FJ|FJL--7|L7LJL7||L----7F--JF7|||F--------JFJF--JLJ7L7F777|.|L
|
|
||||||
FL77.F777FF7JL7L-JL7LF7|LJ||LJL----JLJ||FJF7F7||LJ|LJ||LJ||||||F-J|L7F7|LJ|||||FJ|F7F-JL-JF77LJL---7FJL---JLJLJL----7.F7-|FJF--7F7L7J|JL-.L|
|
|
||||||
|.L-77JL7F7F7.L--7FJFJ|L-7|L----------JLJFJ|||||F-JF7||F7LJLJLJ|F7|FJ||L-7||||||FJ|||F-7LFJ|F-7F7F-J|F7F--------7F--JFJL7|L-JF7LJL--77--J7L-
|
|
||||||
L7FL7J|L7|LJL----JL-JFJF-J|F-7|F7F--7F7F-JFLJLJLJF-J||LJL7|F--7LJLJL7||F-JLJ||LJL-JLJ|FJFJFJ|FJ||L-7LJ|L-----7F7LJF-7|F-J|F--JL7F---J..F|LF|
|
|
||||||
|.|LJL|-FL----------7|-L-7|L7L7||L-7|||L7F-----7LL7FJL7F7L7|F-J-F---J||L-7F-JL7FF7F-7|L7L7L-JL7||F7L-7|F----7LJ|F7L7||L--JL---7LJ7|7-J-7|-7|
|
|
||||||
|.LF7FJF7F7-F7F-----JL-7FJ|7L7LJL--JLJL7LJF----JF-J|F7LJL7LJL-7FL----J|F-JL7F7|FJ||FJL7|FJF7F7LJLJ|F7||L---7|F7LJL7|||F--7F7F7L--7F77.LLJLJ7
|
|
||||||
L7LJ7J|LFJL7||L-------7|L7|F7L--------7L7FJF---7L-7LJL--7L-7F7|F------JL-7FJ|||L7LJL--JLJFJLJL--7FJ|||L----J|||F-7LJLJL-7||||L7F7LJL-7-LJ||J
|
|
||||||
F|7LF-7FJF7LJL--------JL-JLJL---7F7F--J7LJ.L7F-JF-JF7F--JF7LJ|||F7F-7F7F7||FJ||7L----7F-7L7F--7FJL-J|L7F---7||LJFJF-----JLJ|L7LJ|F7F-J7F-|J|
|
|
||||||
77-7L7LJFJL7F7F7F7F7F---7F-7F7F7LJLJF7F7FF7-|L-7|F-JLJLF-JL-7LJ||LJFJ||||||L7||F-----JL7L-JL-7LJF--7L-J|F--JLJF7L7L---7-F7FJFJLFJ||L-7F|F7LL
|
|
||||||
||LJ.L7FJF-J|LJLJ||LJ-F-J|FJ|LJL-7F7|||L-JL7|F-J|L----7L-7F-JLLLJF-JFJ|||||FJ|||F----7FJF----JF7L-7L7F7|L-----JL7|F7F7L7||L-JF7|FJL--JFF777|
|
|
||||||
F-.J7LLJF|F-JF77FJ|F--JF7|L-J.F--J|LJLJF7F7LJL--JF----JF7|L7F7|JL|F7|F||LJ|||LJLJF---JL7L7F-7FJ|F-J7LJLJF------7|LJLJL7|||F77||LJLF7|F7|L77|
|
|
||||||
F-|LJ7.|F||F-JL-JFJL7F-JLJF7F7L7F-JF-7FJ|||F7F7F7|F-7F7|||FJ||77LLJLJFJL7.||F----JF7F7FJL|L7LJFJL-7F---7L-----7LJF---7LJ|LJL-JL---J|FJLJFJF7
|
|
||||||
.FL77F|LFLJL--7F7|F7||F---JLJL7LJF-J-LJFJ|LJ||LJLJL7||||LJ|FJL7-|.|L-L-7|-LJL--7F7||||L7FJFJF-JF7FJL7F7L------JF7|F--JF7|F------7F-J|F-7L-J|
|
|
||||||
FL7|L77FJ|FF-7|||||LJ|L7F7F-7FJF7L----7L7L-7LJF7FF7|LJLJF-JL7FJ-F--7|L.LJ-||F--J|||LJ|FJL7L7|F-JLJF7LJ|F-------JLJL---J||L7F---7|L--J|LL7F7|
|
|
||||||
FJ77.L-7JFLL7|LJ||L--J|LJLJFJL-JL-----JLL-7L7FJL7|||F7F7L7JFJL7.|FLFF-FJ|7.LL7F7|LJF7||F7L7||L7F--JL--J|F--7F7F--------J|FJ|F--JL7F-7L-7||LJ
|
|
||||||
|LFL-7.-JFJFJL-7LJF-7-F7F7LL--7F7F-7F7F7F7L-J|F-J||||LJL7L-JF-JF77-|J7J-J7-|.||LJF7||LJ|L7LJL-JL-------JL-7|||L---------JL-JL-7LF||||F-J||JJ
|
|
||||||
-.F|-L.L-F-JF-7|FFJFJFJLJL-7F-J|||JLJ||||L--7|L--JLJL--7L---JF-J|-7|J||7LJ7LLLJJF|LJL7-|FJF--7F7F7F-------J||L7F-7F-----7F7F7FJF7LJ-||JLLJ..
|
|
||||||
LF-|JL|JLL-7|FJL-JFJFJF-7F7|L7FJ||F--J|||F--J|F-7F7F7F7L-----JF-J-|J-|FFJ|-JFLF|-L-7FJFJ|FJF7LJLJ|L---7F-7FLJ|LJFJ|F-7F7LJLJ|L-JL7J|LJ77.|F7
|
|
||||||
FL.|..L-JF7LJL---7L-JFJFLJ||FJ|LLJL---JLJL-7FJL7LJ|||||F-7F7F7L-7-|J7L--7FJFFFFJ7LFJL7L7|L-JL7F-7L7F7|LJLL----77L-JL7LJL7.F7L---7L--7-LF-7.7
|
|
||||||
|FJ77F-J-||F----7L--7L7F--J|L-JF------7F---J|F-JF7LJLJ|L7|||||F7|J|F|F-7|J|F-J|F7FJF-JFJL7F7FJ||L7LJL---------JF7.F7|F-7L-JL---7L7F-J7-|-F7|
|
|
||||||
L||L--JF-JLJF7F7L--7L-JL--7L--7L-----7||-F7FJL7FJL--7FL7|||LJ||LJ.|-F-J|.F7JF7F||L7|F7L7FJ||L-JF7L-------------J|FJ||L7L--7F--7L7LJ||.||L7-J
|
|
||||||
.JJJ.J||F7F-JLJL7F7L7F7|F7L-7FJF-----J|L-JLJF-JL7F-7L-7||LJ7FLJJF77L-7||F-JLF7FJL-JLJ|FJ|FJL-7FJL----7F---------JL7||FJ.F7LJF7L7L---77F--|-L
|
|
||||||
FL|.FJFLJ||F----J|L7LJ|FJL--J|-L-7F7F7L7F7F7L---JL7L7FJ|L7F--7JFJL-7||-|L|.|||L-----7LJFJL--7|L-----7|L----7F7F7F7|LJL-7|L7FJL7|F---J-JJFF-L
|
|
||||||
-.FJ|.F|7LJL-----J|L-7|L----7|F7JLJLJL7|||||F7F7F7L7||FL7LJF-J7F|-LL77.J.77FJL------JF7L-7FFJL7F----JL--7F7LJ||||LJF7F-J|FJ|F-JLJF7J.FJ-F|7|
|
|
||||||
L-F-7-F|J7FF7F----77FJL-----JLJ|F-----JLJ||||LJ|||FJ|L-7|F7L7-L.|JJL|J-F7.LL--7F7F7F7||F7L7L7FJL----7F-7|||F7LJLJF-J|L--JL-JL---7||7F7J|FJFL
|
|
||||||
LFJL|LJL|F-J|L--7FJFJF----7F--7LJF---7F77LJ|L-7||LJFL--JLJL-J.FJ.777L7FF7.L7.|LJ||LJLJLJL7L-JL7F7F77LJFJLJLJL7F-7L-7|F-7F7F-----J|L7-J.-J7F7
|
|
||||||
7J.|JF|7-L-7|JF7|L-JFJF-7FJ|F-JF7|F-7LJL-7FJF7||L-----7F7-F--7JJ-F7J-FL-..LLF7JLLJJ-F7.F-JF7F7LJLJL--7L-----7LJ7L--J|L7|||L------JFJ7|||FFL|
|
|
||||||
|7L.L||JLF-JL-JLJF7FJ7L7LJFJL7FJ||L7L----J|FJLJL7F----J|L-JF7|J.FF7-F7F||7L||L----7FJL7L--JLJL7F-7F-7L-----7L-7F7F7-L-JLJ|F7F-7F--JF7FF--JL|
|
|
||||||
|7-|.L|..L---7F7FJ||F--JF7L7FJ|FJL7L---7F7LJF---JL--7F7|F--JLJF7FJ|7F7J7F7FFL----7|L7FJF7F7F77LJFJ|FJF----7L7FJ|LJL--7F--J|LJJLJF--JL7J.|.FJ
|
|
||||||
FJ7L|J|FF--7FJ|LJ7LJL--7|L7|L-JL--JF7F7LJL7|L------7LJLJL-----J|L7L--7.-JL-F.LF--JL-JL7|LJLJL-7FL-JL7|F-7FJ|LJFJF----JL--7L---7FJF7F7|.FJ-|7
|
|
||||||
L7|J|JL-L-7|L7|F-------JL7LJF----7-||||F-7L-7F7.F-7L7F7F7F7F7F-J-|F--J7|-J|JFLL-----7FJL-7F7F-JF7JF7LJL7|L----JFJFF77F-7FJF--7LJFJ||||F--|.|
|
|
||||||
L|.FF7|LLFJL7LJL-7F------JF7L---7L-JLJLJF|F-J|L7|FJ7LJLJLJLJLJJFFJ|L|FF-7|F7JLF-7F--J|F-7LJ||F7|L7|L---JL---7F7|F7|L-JFJL7L-7|F7|7||||7LF-|7
|
|
||||||
-L-FFFJ7FL-7|F--7LJF------J|F---JF----7F7LJF7|FJ||FF7F----7F--7-L7L7|7L7L-7LF|L7|L--7|L7L--JLJ||FJL--------7|||LJLJF7FJF-JF-J|||L7||LJL7|J|L
|
|
||||||
JLLLJ|-F---J|L-7|F7L7F7F--7|L--7FJLF--J|||FJ||L-J|FJLJF---J|F-JF-JFJF7|L7FJF7F7|L---JL-JF-7F-7LJL7F--------J||L7F--JLJ-L-7L-7LJL-JLJJ|J.F7F7
|
|
||||||
LL7LL||L---7L7FJLJL7||LJF-JL--7LJF-JF-7|L7|FJ|F--J|F--JF7F7|L-7L-7|-|L7||L7|LJLJF7F-7F-7|FJ|JL7F7|L----7F7F7LJJ|L-------7|F7L---7L|7L|-F-JLJ
|
|
||||||
.F|7|.F-7F7L7|L--7FJLJF7L----7L7JL-7|FJ|FJ||FJL-7FJ|F--JLJLJF-JF7||FJFJFJFJ|F--7|LJLLJFJ|L-JF7LJ||7F7F7LJLJL--7L-------7|LJ|F-7FJ.L7-|L.FJJ7
|
|
||||||
LJ|FF-L7LJL-JL-7FJL7F7||F7F-7L7L-7FJ||J|L-JLJF7FJL7LJF------JF7||||L7L7L7|-LJF7LJF----JFJF--JL--JL-JLJ|F-----7L-------7|L-7||L||-L-F77.FFJ.J
|
|
||||||
||L77FFJF-----7LJF7LJLJLJ|L7||L-7|L-JL7|F--7FJLJF7|F7L-7F--7FJLJLJL7|FJL|L7F7|L-7L----7L7L-7F7F7F7F7F7LJF--7LL--------JL--JLJ-LJ.|.L--FJ.F||
|
|
||||||
.F7FF7L-JJF7F-JF-JL-7F--7|FJL---JL---7LJL-7|L---JLJ|L7FJL7FJL7F---7|||7-|FJ||L7FJF7F--JFJF7LJLJLJLJLJL--JF-JF7F----------7F7F7J.F77FL-L|.F7-
|
|
||||||
F|FFJL7F7F||L-7|FF7|LJF-J|L7F---7F--7|F-7FJL--7F7F-JF||F7|L-7LJF--JLJL7FJ|FJ|FJ|-||L7F-JFJL7F7F-7F7F-----JF7|||F--------7LJLJL-7-7-|F--F7JL|
|
|
||||||
-FLL-7LJL-JL--J|FJ|F7JL-7L-J|F--J|F-JLJFJL---7|||L--7|||||F-JF7L----7FJL7|L7|L7|FJL7||F7L-7LJ||FJ||L------JLJLJL7JF----7L------J.|J|F-FLJ..F
|
|
||||||
LLLF-JF-7F7F-7FJL7LJL---JF7FJ|F7FJL7-F7L---7FJLJ|F--JLJ||||F7||JF7F7||J.||FJ|FJLJF7|LJ||F-JF7LJL-J||F7F7F--7F7F7L7|F---J7F7F----7JJLF77-77.|
|
|
||||||
|LFL-7L7||||FJL7LL7F-7F7FJ|L7LJ||F-JFJL---7||F-7LJF7F7FJLJLJLJ|FJLJLJL7FJ|L7|L7F-JLJ7FJ|L--JL7F-7FJFJLJ|L7FLJLJL-J||F7F--JLJF---J-LJ|L|---77
|
|
||||||
J7|JLL7|||||L--JF7||FJ|||FJFJF-J|L--JF----JLJ|FJF7|LJ|L-7F----JL-----7|L7|FJL-JL7F7-FJFJ|F7F7||FJL7L-7FJFL-----7F7|||||F---7L7F7F7|FF777L-JF
|
|
||||||
|F7J.F||LJLJF7F7|LJ|L7|LJL-JJL--JF---JF----7F|L-J|L7FJF-J|F7FF7F--7JFJ|FJ|L----7LJ|FJFJJFJ||LJ|L-7|JFJL--------J|LJLJ|||F-7L-J|LJL7FJ|7--JFJ
|
|
||||||
L7J.-L||F---JLJLJF7L7LJFF---7F--7L-7F7L7F--JFJF7FJFJL7L-7||L7|||F-JFJFJ|FJ|F--7L-7LJFJF7|FJL7FJF-JL-JF7F----7F-7|F---J|||FJF7.L-7FJ|FJ..FFF7
|
|
||||||
||.L|JLJL7F7F-7F7|L-JF7FJF-7LJF-JF-J||FJL7F-JFJ||FJF-JF-JLJFJ||||7FJFJFJ|F-JF-JF7L7FJFJ|||JLLJJL7F7F7|||F-7FJL7|||JF-7|LJL7|L7F7|L7|L77-FLL-
|
|
||||||
|77||7|.LLJ||FJ|||F--JLJFJFJF7L--JF7|LJF-J|F-J.LJL7L7.L---7L7||||FJFJ|L7LJF-JF7|L-J|FJFJ|L7F7F--J|||LJLJL7LJ-FJ||L7L7||F--J|FJ||L7||FJF-7JJJ
|
|
||||||
|J|-7-JFLLFJ|L7|||L----7|-L-JL----JLJF7L-7||LF77F7L7L7F7F7|FJ|||||FJF77L-7|F7||L7F-JL7|F|FJ||L--7|LJF-7F-J|F7|FJ|FJ7||||JF7|L7|L7|LJL-JFJJ||
|
|
||||||
|.|LJL|7|.L7|FJ|LJF----J|F-------7F--J|F-J|L7|L7||FJFJ||||||FJ||||L7|L--7|||||L-J|LF-JL7|L7|L7F7LJF7L7LJF--JLJL-JL--JLJL-JLJFJL7||F---7||.F7
|
|
||||||
7FJ7JFJ-LF7LJL-JF7L-----JL------7|L--7LJF-JFJ|FJ|||FJFJLJLJLJFJ|||FJL7F7||LJ|L--7L7L-7FJL7|L7||L7FJ|FJF-JF7F7F---7F-7F-7F7F7L--JLJL-7-LJ77L-
|
|
||||||
FJF|-|J-J|--FLF-JL--7F----------JL---JF7L7FJF||FJLJL7|F--7F--JFJ|||F7LJ||L-7|F7J|FJF7|L-7||FJ||FJL7|L-JF-JLJLJJF7LJFLJL|||||F7F7F7F7L77|||7|
|
|
||||||
F7F-7|F|FL-77JL----7|L-7F7F7F7F-----7FJL-JL7FJ|L--7FJLJF7|L7F7|FJ|||L7FJ|F7||||FJ|FJ||F-J||L7|||F7||F7FL---7LF7|L-----7||||LJLJ||||L7L77JLFJ
|
|
||||||
|-J|-|F|7J.LL-.F7F7||F-J|LJLJLJF-7F-JL---7FJL7|F7FJ|F7FJ||FJ||||FJ||FJL7LJLJ||LJFJL7|||F-J|FJ|||||||||F7F--JFJLJF---7FJLJ|L---7||LJ||FJ|.7.|
|
|
||||||
7FFJF-F--.|F-JF|LJLJLJF7|F-77F7|FJL7LF7F7||F7||||L7||||FJ||7|||||FJ||F7L---7||F-J.L||||L-7||FJ||||||||||L-7J|F-7L--7||F7.|F7F7|LJJF7LJF-..F7
|
|
||||||
-FJFJF|JJ7L|JL|L---7F7|LJL7L-JLJL--JFJ||||||||LJ|FJ||LJ|FJL7||||||FJ|||F-7FJ||L7F7FJ||L7FJ||L7||||||||||F7L-JL7|F7FJ|LJL7|||||L---JL--7|FLF-
|
|
||||||
L|-|F7.L7--7FF-F---J|||F--JF7F7F-7F-JFJ|LJ||||F-J|FJ|FFJL7FJ|LJ|||L7||||FJL7||FJ|||J||-||-LJFJ|LJ||||LJ|||F7F-J||LJLL-7FJ|||||F-7F7F--J--LJ|
|
|
||||||
.|FJF-7-LLLLFJ.L---7|||L7F-JLJ||FJ|F-JFJF-J|LJL7FJL7L7L-7|L7L-7|||FJ|||||F7|LJL7|||FJL7||F7-|FJF-J|||F-J||||L-7|L7F-7L|L7LJLJ|L7|||L-7J|LJF7
|
|
||||||
F7J|L|-.J.|.JJ.LLF-J||L7LJF---J|L7|L-7|JL-7|F--JL7FJFJF7LJFJF7||||L7||LJ||LJFF7LJ||L7FJ|LJL7|L7L7FJ||L-7|LJ|F-JL7LJFJFJFJLF7FL-JLJL--JL7-7LJ
|
|
||||||
LJ.FLJ|.|F-7|7-JJ|F7|L-JF7L----JFJL7FJL7-FJ|L7F7FJL7L-JL-7L7|LJLJ|FJ|L7J|L-7FJL--J|.|L7|F-7|L7L7||||L7FJL-7|L--7|F-JJL7L-7|L------7L|7F|.|J|
|
|
||||||
L77JLF|7|.L|LJ7.|LJLJF--J|F-----JF-JL-7L7L7L7LJ||F-JF--7FJFJL--7FJ|FJFJFJF7|L-7F7FJFJFJ|L7||FJFJ|L7|FJL7F-J|F-7|LJ|F-7|F7LJF------J-F|J|7.LL
|
|
||||||
||J7F7LJ-7|L-LL7F|L||L--7|L7F-7F7L7F--JFJLL7|F-J||F7L7LLJFJF7F-J|FJL-JFJFJ||F-J|||||FJFJFJ||L7||L7|||F-JL7FLJ||L---JFJ|||F-JF-----7L||LJ7F7|
|
|
||||||
LJ-L7LF7.F7|7LJLF|7FF7F-JL7LJ-LJ|FJL--7|J7|LJL-7|||L7L--7|FJ||F-JL7F--JFJ7LJL-7||L7|||L7|FJL7LJF7LJ||L--7L---7L7F7F-JFJ||L-7|F----J|LJ7L7JL7
|
|
||||||
L||LL-L|77-FL-J.LLF-J|L7F7L-----J|-F7FJL7FFF7F7LJ|L7|F-7|||-|||F-7||F-7L7F----J||FJ|L-7LJ|F7|F-JL--JL7F-JF7F-J.|||L-7L7||F7LJ|F--7L7.L7-L.LL
|
|
||||||
7--7..7L|-J|L-7F.FL-7L7LJL---7F-7L7|LJF7L7FJLJL--JFJ||FJ||L7||LJ-LJ|L7L7|L-7F-7|LJFJF7L-7|||||F7F7F7FJ|F7||L--7|||F7||||LJ|F7LJF-JF77F7JL-7.
|
|
||||||
|J7|..JFL.F|7L7JFF|7L7L------JL7L7|L7FJL7|L7F--7F7L7|||FJ|FJ|L-7FF-JFJFJ|F-JL7||F7|FJL--JLJ||||LJ|||L7LJLJ|F--JLJLJLJFJL-7|||F7L--JL-7LF7.L7
|
|
||||||
.FF.J-JF-L-7--F.F.F7FJF-7F7F---J-LJFJ|F7LJFJ|F7||L7|||||FJL7|F7|FJF7L7|FJL7F7||||LJL------7|||||FJ|L7|7F--JL------7F7L7F-JLJ||L7F7F-7|7LL-J|
|
|
||||||
.F|.L|.F7JFJJL7.LF|LJFJ|LJLJF----77L7LJL-7|FJ|||L7|||||||F7|||LJ|FJ|FJLJF-J|||LJL7F7F7F7F7|LJ||FJFJFJL7|F--7F7F---J||L|L---7LJJLJLJLLJJJ.|JF
|
|
||||||
FLJJFFFF77J-J7|..FJF7|F--7F-JF--7L7F|F7F-JLJFJLJFJ|||||||||||L-7||FJL--7L--J||F--J|||LJ||LJF7LJL7||L7FJ||F-J|||LF7FJL7L7F--J7L7JJ7..LL7FF77J
|
|
||||||
L-JJL7-7J--7JLJ.LL-JLJL-7|L--JF7L7L-J|||7F--JF7FJFJ||||||||||F-JLJL-7F-JF7F-J|L7F7||L-7LJ7FJ|F--J|F-JL7|||F7||L-J||F-JFJL-7JJ7|FFF7FFJ-7LJL.
|
|
||||||
FL7-|J.L7LJJF-F--F------JL-7F-JL-JF-7||L7|F7FJLJFJFJ|||||||||L7-F7JFJL--J|L-7|F|||||F7L7F7|FJL7F7|L-7FJ||LJ|||F-7LJL-7L---JJLFJ7F|-JJ7LL7-|7
|
|
||||||
77|.|L7LL7J--.L.-L----7F7F7LJF-7F-JFJ||FJLJ|L7F7L7L7||||LJLJ|FJFJL-JF7F-7|F-J|FJ|||||L7LJLJ|F-J||||FJL7LJF-J|||FJF7F7L----77FL7|JL77J|F|-FL7
|
|
||||||
J-77J7L7LF-7L-LFJ|L|L|LJLJ|F7|FJL77L7||L7F-JFJ|L-JFJLJ|L---7|L7L-7F7|LJ.||L-7|L7|||LJFJF-7FJL--J||FJF7L7FJF7|||L7||||F7F7FJ77JF--LJJ-LJJLJJJ
|
|
||||||
|..--|LJ7.FJJ.L--F-F7F7F7FJ|LJ|F-JF-J|L7||F7L7L7F7L--7L7F7FJ|FJF-J||L--7LJF7||7|||L-7L7|-LJF7F7.LJ|FJ|FJL7|||LJFJ|LJLJLJLJ.JJ.---JJ|JF7|-FJJ
|
|
||||||
L-J-F|.FJF|FFF-7J.L|LJLJLJFJF-JL7|L-7L7||LJL7|FJ||F--JFJ|LJF|L7|F7|L7F7|F-JLJL7LJL--JFJL---JLJL77FJL7||L||||L7JL7L-----7J77|F|-7LFJ|-LF--J|7
|
|
||||||
LJ7LJJ.LJ-F|JL7L7--L-7F-7FJL|F7FJF--JFJ|L--7||L-J|L-7|L7L--7L-JLJ||FJ|||L-7F-7L-7|F--JF-7F-----JFJF7||L-7||L7|F-JF-7F--JLFJL-LJF7F7|.FF7-J7.
|
|
||||||
F-LF7.JJ|L-F7F7FJ7|JFJ|FJL-7||||FJF7FJL|F-7|||F--JF7L-7L---JF----J|L7||L7F||LL7FJFJF-7L7|L7F7F-7|FJ|||F7|LJLLJL7FJFJL---77.L77L-JJLF|.JJJ7.J
|
|
||||||
|-LL-7JF7.FL-|J7|F7FL-JL7F-JLJ||L7||L-7||FJ|LJL--7|L-7L-7F7JL-7F7FJ|||L-JFJL7FJL7L7|FJFJL7LJLJFJ||FJ||||L7F-7F-JL7|F-7F7L7JJL7|L-F--|-LJ.FF.
|
|
||||||
L7LF-7LJJF|FL.LJ7J.F.F7FJL-7F-J|JLJL7FJLJ|FJ7F7F-JL-7|F-J|L-7F|||L7FJL--7L7FJ|F7|-LJL7L-7L7F7FJFJ||FJ||L7LJFJL-7FJ|L7LJL-J|-|F|LF7.LJ.LF|FJ7
|
|
||||||
LJFL-J7.L-LF-F-L|JLF7|LJF7FJL7FJF---JL7F7LJ-FJ|L--7FJ|L--JF-J-LJL-JL-7F-JFJL7||||F---JF7|FJ||L7|FJ|L7LJLL7FJF--J|.L7L--7JL7-F|F7JL-.L|7LL|-7
|
|
||||||
JFJLL-L7J.||F7JLJ7J||L7FJ||FFJ||L7F7F7LJL-7-L7L---JL7|F-7FJ.F|-|-|JJLLJJFL-7|||LJL7F7FJ|||FJL7|LJLL7L7F--J|LL7F7L-7L7F7|.|L7LL7J||LJ.FF7||F-
|
|
||||||
.|J||7JF-7FJ-J-FJFFJL-JL7LJFL7L7L||LJ|F-7FJF-JF7F7F7|||FJ|7-J7.|FF-L7J-LF--J||L-7FJ||L7LJ||7FJ||7..L-JL--7L-7LJ|F-J||||L7---7L|-FFFJF-JLF7J.
|
|
||||||
FJ7JFLFF..JJ||F--LL---7FJJ-FJL7|FJ|F-JL7LJFJF7|LJ||LJ||L7|-.LJ7LJ||7||LFJF-7|L7FJL-JL7L-7|L7L7L-7-J|.F7.FJF7L7FJL7F-LJL-JJ|.|.|JLJ||-|F.-|..
|
|
||||||
F.F----J.F|LF7F7-|JLJ-||JL.F-L||L-J|F-7L-7L7|||F-JL-7|L7||.|7FF7FFFJ-L-L7|FJ|7LJ.LF7FJF-J|FJ-L7FJ7JF-|L-JFJ|FJL-7L7.L..|L7JF7-|J7-F.L7JFJJ7F
|
|
||||||
LLJL|FJJ7LF-J7|7F||J|.||F|F--7LJJFFJ|FJF7L7LJLJL7F7FJL-J||.LLLLJJL7.7J|LLJL7|7F---JLJFJ-FJL7-LLJJLFJFL7F7L7LJJ..|FJ7..FJ7.LLJ|.FF-J--7F-.77|
|
|
||||||
-7JLF||-|LJJ..LJJ||FJ-LJ7J-J.7JFF-L-JL7||FJ-J.LFJ|||J...LJ--7L7J|7J7L-L77.FJL7L-----7L-7|F7|J|FJJL.F|L||L7|J|.-FJ|JF-77..FFJFFLJ-7L-J.F.JJ--
|
|
||||||
J777L|7L--LJF-|7L7J7.LJ7F.|..F.|.J.L|.LJ|||-J-FL7|||LL..||.LFFJF--F-.F|F-7L--JJLLLF-JF-JLJ||F77.FL.|J.|||LJL---L7|7LLFF7-FJJLLJ|F7.|.7|J|F|J
|
|
||||||
L--J.7|.|.FF7--7.J-F|--F|-7.FL7|7..FL-J-LJ-7|JLF||LJ7|7.FFJ7JLL7F7JJ.F|J.FJ.JJ.7.LL7FJJL7LLJ-J77FJ-|FFLJJ7|.|FFL||--7|J.|.L77L-L|7FL7-|L7-77
|
|
||||||
LJ-LJ.F-|.7|...||7F77|F|J-.|FLFL77-|J.|.|JLJJ|LLLJ|-F|77-||L|.F-FJJ.|-LJ7L7J.F--7LLLJ.FJJ.F|J-|||.F|FFJ|||7.|-J-LJ.L--7L--|FFJJ7.F7J|-JL-.F7
|
|
||||||
7JFF.FF-L-LJJJ-7JL7LLL|7JJ.LJJLLLFJLFJ7JJL.LL--JJLJ..JLL-FF---J.J.F.L.J.|-|LFF--7-L|-LF.J-JJJLLF--L-|J.L|L|.J-J.LLJJ-L|.|-L-F---J.LJJJ.FJL|7
|
|
||||||
@@ -1,173 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 10: Pipe Maze ---</h2><p>You use the hang glider to ride the hot air from Desert Island all the way up to the floating metal island. This island is surprisingly cold and there definitely aren't any thermals to glide on, so you leave your hang glider behind.</p>
|
|
||||||
<p>You wander around for a while, but you don't find any people or animals. However, you do occasionally find signposts labeled "<a href="https://en.wikipedia.org/wiki/Hot_spring" target="_blank">Hot Springs</a>" pointing in a seemingly consistent direction; maybe you can find someone at the hot springs and ask them where the desert-machine parts are made.</p>
|
|
||||||
<p>The landscape here is alien; even the flowers and trees are made of metal. As you stop to admire some metal grass, you notice something metallic scurry away in your peripheral vision and jump into a big pipe! It didn't look like any animal you've ever seen; if you want a better look, you'll need to get ahead of it.</p>
|
|
||||||
<p>Scanning the area, you discover that the entire field you're standing on is <span title="Manufactured by Hamilton and Hilbert Pipe Company">densely packed with pipes</span>; it was hard to tell at first because they're the same metallic silver color as the "ground". You make a quick sketch of all of the surface pipes you can see (your puzzle input).</p>
|
|
||||||
<p>The pipes are arranged in a two-dimensional grid of <em>tiles</em>:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>|</code> is a <em>vertical pipe</em> connecting north and south.</li>
|
|
||||||
<li><code>-</code> is a <em>horizontal pipe</em> connecting east and west.</li>
|
|
||||||
<li><code>L</code> is a <em>90-degree bend</em> connecting north and east.</li>
|
|
||||||
<li><code>J</code> is a <em>90-degree bend</em> connecting north and west.</li>
|
|
||||||
<li><code>7</code> is a <em>90-degree bend</em> connecting south and west.</li>
|
|
||||||
<li><code>F</code> is a <em>90-degree bend</em> connecting south and east.</li>
|
|
||||||
<li><code>.</code> is <em>ground</em>; there is no pipe in this tile.</li>
|
|
||||||
<li><code>S</code> is the <em>starting position</em> of the animal; there is a pipe on this tile, but your sketch doesn't show what shape the pipe has.</li>
|
|
||||||
</ul>
|
|
||||||
<p>Based on the acoustics of the animal's scurrying, you're confident the pipe that contains the animal is <em>one large, continuous loop</em>.</p>
|
|
||||||
<p>For example, here is a square loop of pipe:</p>
|
|
||||||
<pre><code>.....
|
|
||||||
.F-7.
|
|
||||||
.|.|.
|
|
||||||
.L-J.
|
|
||||||
.....
|
|
||||||
</code></pre>
|
|
||||||
<p>If the animal had entered this loop in the northwest corner, the sketch would instead look like this:</p>
|
|
||||||
<pre><code>.....
|
|
||||||
.<em>S</em>-7.
|
|
||||||
.|.|.
|
|
||||||
.L-J.
|
|
||||||
.....
|
|
||||||
</code></pre>
|
|
||||||
<p>In the above diagram, the <code>S</code> tile is still a 90-degree <code>F</code> bend: you can tell because of how the adjacent pipes connect to it.</p>
|
|
||||||
<p>Unfortunately, there are also many pipes that <em>aren't connected to the loop</em>! This sketch shows the same loop as above:</p>
|
|
||||||
<pre><code>-L|F7
|
|
||||||
7S-7|
|
|
||||||
L|7||
|
|
||||||
-L-J|
|
|
||||||
L|-JF
|
|
||||||
</code></pre>
|
|
||||||
<p>In the above diagram, you can still figure out which pipes form the main loop: they're the ones connected to <code>S</code>, pipes those pipes connect to, pipes <em>those</em> pipes connect to, and so on. Every pipe in the main loop connects to its two neighbors (including <code>S</code>, which will have exactly two pipes connecting to it, and which is assumed to connect back to those two pipes).</p>
|
|
||||||
<p>Here is a sketch that contains a slightly more complex main loop:</p>
|
|
||||||
<pre><code>..F7.
|
|
||||||
.FJ|.
|
|
||||||
SJ.L7
|
|
||||||
|F--J
|
|
||||||
LJ...
|
|
||||||
</code></pre>
|
|
||||||
<p>Here's the same example sketch with the extra, non-main-loop pipe tiles also shown:</p>
|
|
||||||
<pre><code>7-F7-
|
|
||||||
.FJ|7
|
|
||||||
SJLL7
|
|
||||||
|F--J
|
|
||||||
LJ.LJ
|
|
||||||
</code></pre>
|
|
||||||
<p>If you want to <em>get out ahead of the animal</em>, you should find the tile in the loop that is <em>farthest</em> from the starting position. Because the animal is in the pipe, it doesn't make sense to measure this by direct distance. Instead, you need to find the tile that would take the longest number of steps <em>along the loop</em> to reach from the starting point - regardless of which way around the loop the animal went.</p>
|
|
||||||
<p>In the first example with the square loop:</p>
|
|
||||||
<pre><code>.....
|
|
||||||
.S-7.
|
|
||||||
.|.|.
|
|
||||||
.L-J.
|
|
||||||
.....
|
|
||||||
</code></pre>
|
|
||||||
<p>You can count the distance each tile in the loop is from the starting point like this:</p>
|
|
||||||
<pre><code>.....
|
|
||||||
.012.
|
|
||||||
.1.3.
|
|
||||||
.23<em>4</em>.
|
|
||||||
.....
|
|
||||||
</code></pre>
|
|
||||||
<p>In this example, the farthest point from the start is <code><em>4</em></code> steps away.</p>
|
|
||||||
<p>Here's the more complex loop again:</p>
|
|
||||||
<pre><code>..F7.
|
|
||||||
.FJ|.
|
|
||||||
SJ.L7
|
|
||||||
|F--J
|
|
||||||
LJ...
|
|
||||||
</code></pre>
|
|
||||||
<p>Here are the distances for each tile on that loop:</p>
|
|
||||||
<pre><code>..45.
|
|
||||||
.236.
|
|
||||||
01.7<em>8</em>
|
|
||||||
14567
|
|
||||||
23...
|
|
||||||
</code></pre>
|
|
||||||
<p>Find the single giant loop starting at <code>S</code>. <em>How many steps along the loop does it take to get from the starting position to the point farthest from the starting position?</em></p>
|
|
||||||
|
|
||||||
<p>Your puzzle answer was <code>7066</code>.</p><p class="day-success">The first half of this puzzle is complete! It provides one gold star: *</p>
|
|
||||||
<article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>You quickly reach the farthest point of the loop, but the animal never emerges. Maybe its nest is <em>within the area enclosed by the loop</em>?</p>
|
|
||||||
<p>To determine whether it's even worth taking the time to search for such a nest, you should calculate how many tiles are contained within the loop. For example:</p>
|
|
||||||
<pre><code>...........
|
|
||||||
.S-------7.
|
|
||||||
.|F-----7|.
|
|
||||||
.||.....||.
|
|
||||||
.||.....||.
|
|
||||||
.|L-7.F-J|.
|
|
||||||
.|..|.|..|.
|
|
||||||
.L--J.L--J.
|
|
||||||
...........
|
|
||||||
</code></pre>
|
|
||||||
<p>The above loop encloses merely <em>four tiles</em> - the two pairs of <code>.</code> in the southwest and southeast (marked <code>I</code> below). The middle <code>.</code> tiles (marked <code>O</code> below) are <em>not</em> in the loop. Here is the same loop again with those regions marked:</p>
|
|
||||||
<pre><code>...........
|
|
||||||
.S-------7.
|
|
||||||
.|F-----7|.
|
|
||||||
.||<em>OOOOO</em>||.
|
|
||||||
.||<em>OOOOO</em>||.
|
|
||||||
.|L-7<em>O</em>F-J|.
|
|
||||||
.|<em>II</em>|<em>O</em>|<em>II</em>|.
|
|
||||||
.L--J<em>O</em>L--J.
|
|
||||||
.....<em>O</em>.....
|
|
||||||
</code></pre>
|
|
||||||
<p>In fact, there doesn't even need to be a full tile path to the outside for tiles to count as outside the loop - squeezing between pipes is also allowed! Here, <code>I</code> is still within the loop and <code>O</code> is still outside the loop:</p>
|
|
||||||
<pre><code>..........
|
|
||||||
.S------7.
|
|
||||||
.|F----7|.
|
|
||||||
.||<em>OOOO</em>||.
|
|
||||||
.||<em>OOOO</em>||.
|
|
||||||
.|L-7F-J|.
|
|
||||||
.|<em>II</em>||<em>II</em>|.
|
|
||||||
.L--JL--J.
|
|
||||||
..........
|
|
||||||
</code></pre>
|
|
||||||
<p>In both of the above examples, <code><em>4</em></code> tiles are enclosed by the loop.</p>
|
|
||||||
<p>Here's a larger example:</p>
|
|
||||||
<pre><code>.F----7F7F7F7F-7....
|
|
||||||
.|F--7||||||||FJ....
|
|
||||||
.||.FJ||||||||L7....
|
|
||||||
FJL7L7LJLJ||LJ.L-7..
|
|
||||||
L--J.L7...LJS7F-7L7.
|
|
||||||
....F-J..F7FJ|L7L7L7
|
|
||||||
....L7.F7||L7|.L7L7|
|
|
||||||
.....|FJLJ|FJ|F7|.LJ
|
|
||||||
....FJL-7.||.||||...
|
|
||||||
....L---J.LJ.LJLJ...
|
|
||||||
</code></pre>
|
|
||||||
<p>The above sketch has many random bits of ground, some of which are in the loop (<code>I</code>) and some of which are outside it (<code>O</code>):</p>
|
|
||||||
<pre><code><em>O</em>F----7F7F7F7F-7<em>OOOO</em>
|
|
||||||
<em>O</em>|F--7||||||||FJ<em>OOOO</em>
|
|
||||||
<em>O</em>||<em>O</em>FJ||||||||L7<em>OOOO</em>
|
|
||||||
FJL7L7LJLJ||LJ<em>I</em>L-7<em>OO</em>
|
|
||||||
L--J<em>O</em>L7<em>III</em>LJS7F-7L7<em>O</em>
|
|
||||||
<em>OOOO</em>F-J<em>II</em>F7FJ|L7L7L7
|
|
||||||
<em>OOOO</em>L7<em>I</em>F7||L7|<em>I</em>L7L7|
|
|
||||||
<em>OOOOO</em>|FJLJ|FJ|F7|<em>O</em>LJ
|
|
||||||
<em>OOOO</em>FJL-7<em>O</em>||<em>O</em>||||<em>OOO</em>
|
|
||||||
<em>OOOO</em>L---J<em>O</em>LJ<em>O</em>LJLJ<em>OOO</em>
|
|
||||||
</code></pre>
|
|
||||||
<p>In this larger example, <code><em>8</em></code> tiles are enclosed by the loop.</p>
|
|
||||||
<p>Any tile that isn't part of the main loop can count as being enclosed by the loop. Here's another example with many bits of junk pipe lying around that aren't connected to the main loop at all:</p>
|
|
||||||
<pre><code>FF7FSF7F7F7F7F7F---7
|
|
||||||
L|LJ||||||||||||F--J
|
|
||||||
FL-7LJLJ||||||LJL-77
|
|
||||||
F--JF--7||LJLJ7F7FJ-
|
|
||||||
L---JF-JLJ.||-FJLJJ7
|
|
||||||
|F|F-JF---7F7-L7L|7|
|
|
||||||
|FFJF7L7F-JF7|JL---7
|
|
||||||
7-L-JL7||F7|L7F-7F7|
|
|
||||||
L.L7LFJ|||||FJL7||LJ
|
|
||||||
L7JLJL-JLJLJL--JLJ.L
|
|
||||||
</code></pre>
|
|
||||||
<p>Here are just the tiles that are <em>enclosed by the loop</em> marked with <code>I</code>:</p>
|
|
||||||
<pre><code>FF7FSF7F7F7F7F7F---7
|
|
||||||
L|LJ||||||||||||F--J
|
|
||||||
FL-7LJLJ||||||LJL-77
|
|
||||||
F--JF--7||LJLJ<em>I</em>F7FJ-
|
|
||||||
L---JF-JLJ<em>IIII</em>FJLJJ7
|
|
||||||
|F|F-JF---7<em>III</em>L7L|7|
|
|
||||||
|FFJF7L7F-JF7<em>II</em>L---7
|
|
||||||
7-L-JL7||F7|L7F-7F7|
|
|
||||||
L.L7LFJ|||||FJL7||LJ
|
|
||||||
L7JLJL-JLJLJL--JLJ.L
|
|
||||||
</code></pre>
|
|
||||||
<p>In this last example, <code><em>10</em></code> tiles are enclosed by the loop.</p>
|
|
||||||
<p>Figure out whether you have time to search for the nest by calculating the area within the loop. <em>How many tiles are enclosed by the loop?</em></p>
|
|
||||||
@@ -1,140 +0,0 @@
|
|||||||
.............................................................................................#..............................................
|
|
||||||
...#....................#............................#......................#........................#...........#................#.........
|
|
||||||
................#.....................................................#..............#.....................#................................
|
|
||||||
................................................................#.......................................................#...................
|
|
||||||
.......#........................#.........................#..............................#.....#............................................
|
|
||||||
............#............................#..................................................................................................
|
|
||||||
......................#........................#......................................................#.....................................
|
|
||||||
....................................#.....................................#.................#..........................................#....
|
|
||||||
................................................................................................................#..............#............
|
|
||||||
...................#.................................................#............................#.........................................
|
|
||||||
............................................#.........#...............................#.................#...................................
|
|
||||||
.....#.....................#..................................................#.............................................................
|
|
||||||
........................................................................#.................#.................................................
|
|
||||||
...............................................................#.....................................................#............#.........
|
|
||||||
..............#.......................#...........................................#.........................................................
|
|
||||||
.......................#.......................#...........................................................#................................
|
|
||||||
.........#........................................................#.........................................................................
|
|
||||||
.........................................................................#................................................................#.
|
|
||||||
............................#..........................#........................#.....#...............................#.....................
|
|
||||||
.....................................#..................................................................#....................#..............
|
|
||||||
#...........................................................................................................................................
|
|
||||||
..........#......................#...........#............#............#....................................................................
|
|
||||||
....................#.........................................................#.................................#...........................
|
|
||||||
.................................................#.............#.....................#..........#......................#..........#.........
|
|
||||||
....................................#.......................................................................................................
|
|
||||||
..........................................#..............................................................................................#..
|
|
||||||
......................#.....................................................................................#.....#.........#...............
|
|
||||||
...........#................#.............................#.............#.....................#.............................................
|
|
||||||
#.................#...............................................#...........#.............................................................
|
|
||||||
.......................................#.................................................#..................................................
|
|
||||||
.....#.......................................#.......................................................#..............................#......#
|
|
||||||
..............#.................#.................#..................#..............#..............................#........................
|
|
||||||
...........................................................................#................................................................
|
|
||||||
.........................#............................#....................................................#................#...............
|
|
||||||
.#..............................................................................#...........................................................
|
|
||||||
.......................................#................................#......................#............................................
|
|
||||||
................#...........#...................#.......................................................................................#...
|
|
||||||
..............................................................#..........................................................#..................
|
|
||||||
.......#......................................................................#.........#.............#.....................................
|
|
||||||
.......................................................#....................................................................................
|
|
||||||
......................#................................................#....................................#.............................#.
|
|
||||||
#.........................................#......................................................................#..........................
|
|
||||||
..................................#................#............................................#.......#...................................
|
|
||||||
.....#.....................#.............................#.............................#....................................................
|
|
||||||
................#...............................................#...........................................................................
|
|
||||||
...............................#................................................#....................#..........................#...........
|
|
||||||
......................................................#....................#................#................#..............................
|
|
||||||
..#..........................................#......................................................................#.......................
|
|
||||||
.............#..............................................................................................................................
|
|
||||||
.......................................................................................................................................#....
|
|
||||||
.......................#..............#...........................#............................#...............#............................
|
|
||||||
.........#..................#...............................................#...........#...................................................
|
|
||||||
......................................................................#........................................................#............
|
|
||||||
..............................................................#....................#...............#......#........#........................
|
|
||||||
..............#...................#.............#.....................................................................................#.....
|
|
||||||
............................................................................................................................................
|
|
||||||
.....................#.....#............#...........#......................................#................................................
|
|
||||||
..........#...................................................................................................................#...........#.
|
|
||||||
...#......................................................................#.....................#................#..........................
|
|
||||||
.............................................#...........................................................................#..................
|
|
||||||
......................................................#...........#................#................#.................................#.....
|
|
||||||
.................................#.....................................#..................#...............#......................#..........
|
|
||||||
............................................................................................................................................
|
|
||||||
.......#..............................................................................................................#.....................
|
|
||||||
.....................#..............#......#.................................................#..............................................
|
|
||||||
..............................#..................................#..............#............................#..............................
|
|
||||||
..........#...............................................#............................#..........................................#.........
|
|
||||||
#.................................................#...................#...........................#.........................................
|
|
||||||
.......................................#....................................................................................................
|
|
||||||
.......#...........................................................................#........................................................
|
|
||||||
................#............................................#............................................#.........#....................#..
|
|
||||||
.......................#........#.........#...............................................................................#.................
|
|
||||||
............................................................................................................................................
|
|
||||||
..#................#........................................................................................................................
|
|
||||||
..........#...........................................#......................................#..............................................
|
|
||||||
............................................................................................................................................
|
|
||||||
.....#.....................................#...................#....................................................................#.......
|
|
||||||
.........................#...........#............#.................................................................#....................#..
|
|
||||||
........................................................#...............#...................................................................
|
|
||||||
............#.................#.................................................#......#..............#.....................................
|
|
||||||
.............................................................................................#................#................#............
|
|
||||||
........................................#.......................#..........................................................................#
|
|
||||||
..#.................#..........................#......................#.............#..............#...................#.............#......
|
|
||||||
............................#............................#................................#......................#..........................
|
|
||||||
.............#.................................................................................#............................................
|
|
||||||
.................................#.........................................#................................................................
|
|
||||||
.........................#.........................#.................................................#........................#.............
|
|
||||||
.......#......................................................#.............................................................................
|
|
||||||
............................................................................................................................................
|
|
||||||
............................................................................................................................................
|
|
||||||
.......................#.........................................................................................#..........................
|
|
||||||
...#...........................#..................................................................#......#................#.................
|
|
||||||
...............................................#................#...........................................................................
|
|
||||||
....................#.................................#.................#.......#..........#........................................#.......
|
|
||||||
...........#.................................................................................................#.............................#
|
|
||||||
.#..................................................................................................#.......................................
|
|
||||||
.....................................#.................................................................................#....................
|
|
||||||
...............#.........#...........................................................#......................................................
|
|
||||||
................................#........................#........#.........................................................................
|
|
||||||
......#..........................................#.............................................................................#............
|
|
||||||
...............................................................................................#.......#....................................
|
|
||||||
...............................................................................................................#............................
|
|
||||||
..............................#...........#............................#.................................................#............#.....
|
|
||||||
...................#...........................#............................................................................................
|
|
||||||
...............................................................#.....................#.....#................................................
|
|
||||||
........#.................#.......................................................................................#...........#.............
|
|
||||||
...............#............................#.........#.......................#...........................#.................................
|
|
||||||
.#...................................#...................................#................................................................#.
|
|
||||||
.........................................................................................#...........................................#......
|
|
||||||
........................#...................................................................................................................
|
|
||||||
....................................................................................................................#.......................
|
|
||||||
........................................#.....#.........#.........#.........................................................................
|
|
||||||
.......................................................................................#............#.......................................
|
|
||||||
.#..............................#.............................................................#........................#.....#.....#........
|
|
||||||
............#...............................................................#.................................#.........................#...
|
|
||||||
..............................................................#.........................................#...................................
|
|
||||||
........................#..............................#...............#........#.........#.................................................
|
|
||||||
...................#........................#.......................................................................#.......................
|
|
||||||
.......................................#...................................................................#................................
|
|
||||||
..............#..................#..............#...................................................................................#.......
|
|
||||||
........#......................................................#..............#.................#.........................................#.
|
|
||||||
....................................................................#.......................................................#...............
|
|
||||||
.............................#..........................................................................#...................................
|
|
||||||
.................#..................................................................#.......................................................
|
|
||||||
............................................#..........................#............................................#..............#........
|
|
||||||
......#..............#..........................................#...........#..............................#................................
|
|
||||||
............#.....................#.................................................................#.......................................
|
|
||||||
...........................#.............#...............#..................................................................#...............
|
|
||||||
#....................................................................................................................................#......
|
|
||||||
.............................................................#.....................#........................................................
|
|
||||||
.......#..........................................#.................#....................................#........#.......................#.
|
|
||||||
..........................................................................................#.................................................
|
|
||||||
..........................#..............................................#......................#...........................................
|
|
||||||
...............................#.....................#..........................#.............................#.............................
|
|
||||||
....#......#................................................#..........................#.......................................#............
|
|
||||||
..................#.............................#...........................................................................................
|
|
||||||
...........................................#..................................................#.............................................
|
|
||||||
.......................#...........................................#...................................................#...................#
|
|
||||||
.......#......#.............#.........................#..................#..............................#...........................#.......
|
|
||||||
..#..............................................................................................................#..........................
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 11: Cosmic Expansion ---</h2><p>You continue following signs for "Hot Springs" and eventually come across an <a href="https://en.wikipedia.org/wiki/Observatory" target="_blank">observatory</a>. The Elf within turns out to be a researcher studying cosmic expansion using the giant telescope here.</p>
|
|
||||||
<p>He doesn't know anything about the missing machine parts; he's only visiting for this research project. However, he confirms that the hot springs are the next-closest area likely to have people; he'll even take you straight there once he's done with today's observation analysis.</p>
|
|
||||||
<p>Maybe you can help him with the analysis to speed things up?</p>
|
|
||||||
<p>The researcher has collected a bunch of data and compiled the data into a single giant <em>image</em> (your puzzle input). The image includes <em>empty space</em> (<code>.</code>) and <em>galaxies</em> (<code>#</code>). For example:</p>
|
|
||||||
<pre><code>...#......
|
|
||||||
.......#..
|
|
||||||
#.........
|
|
||||||
..........
|
|
||||||
......#...
|
|
||||||
.#........
|
|
||||||
.........#
|
|
||||||
..........
|
|
||||||
.......#..
|
|
||||||
#...#.....
|
|
||||||
</code></pre>
|
|
||||||
<p>The researcher is trying to figure out the sum of the lengths of the <em>shortest path between every pair of galaxies</em>. However, there's a catch: the universe expanded in the time it took the light from those galaxies to reach the observatory.</p>
|
|
||||||
<p>Due to something involving gravitational effects, <em>only some space expands</em>. In fact, the result is that <em>any rows or columns that contain no galaxies</em> should all actually be twice as big.</p>
|
|
||||||
<p>In the above example, three columns and two rows contain no galaxies:</p>
|
|
||||||
<pre><code> v v v
|
|
||||||
...#......
|
|
||||||
.......#..
|
|
||||||
#.........
|
|
||||||
>..........<
|
|
||||||
......#...
|
|
||||||
.#........
|
|
||||||
.........#
|
|
||||||
>..........<
|
|
||||||
.......#..
|
|
||||||
#...#.....
|
|
||||||
^ ^ ^
|
|
||||||
</code></pre>
|
|
||||||
<p>These rows and columns need to be <em>twice as big</em>; the result of cosmic expansion therefore looks like this:</p>
|
|
||||||
<pre><code>....#........
|
|
||||||
.........#...
|
|
||||||
#............
|
|
||||||
.............
|
|
||||||
.............
|
|
||||||
........#....
|
|
||||||
.#...........
|
|
||||||
............#
|
|
||||||
.............
|
|
||||||
.............
|
|
||||||
.........#...
|
|
||||||
#....#.......
|
|
||||||
</code></pre>
|
|
||||||
<p>Equipped with this expanded universe, the shortest path between every pair of galaxies can be found. It can help to assign every galaxy a unique number:</p>
|
|
||||||
<pre><code>....1........
|
|
||||||
.........2...
|
|
||||||
3............
|
|
||||||
.............
|
|
||||||
.............
|
|
||||||
........4....
|
|
||||||
.5...........
|
|
||||||
............6
|
|
||||||
.............
|
|
||||||
.............
|
|
||||||
.........7...
|
|
||||||
8....9.......
|
|
||||||
</code></pre>
|
|
||||||
<p>In these 9 galaxies, there are <em>36 pairs</em>. Only count each pair once; order within the pair doesn't matter. For each pair, find any shortest path between the two galaxies using only steps that move up, down, left, or right exactly one <code>.</code> or <code>#</code> at a time. (The shortest path between two galaxies is allowed to pass through another galaxy.)</p>
|
|
||||||
<p>For example, here is one of the shortest paths between galaxies <code>5</code> and <code>9</code>:</p>
|
|
||||||
<pre><code>....1........
|
|
||||||
.........2...
|
|
||||||
3............
|
|
||||||
.............
|
|
||||||
.............
|
|
||||||
........4....
|
|
||||||
.5...........
|
|
||||||
.##.........6
|
|
||||||
..##.........
|
|
||||||
...##........
|
|
||||||
....##...7...
|
|
||||||
8....9.......
|
|
||||||
</code></pre>
|
|
||||||
<p>This path has length <code><em>9</em></code> because it takes a minimum of <em>nine steps</em> to get from galaxy <code>5</code> to galaxy <code>9</code> (the eight locations marked <code>#</code> plus the step onto galaxy <code>9</code> itself). Here are some other example shortest path lengths:</p>
|
|
||||||
<ul>
|
|
||||||
<li>Between galaxy <code>1</code> and galaxy <code>7</code>: 15</li>
|
|
||||||
<li>Between galaxy <code>3</code> and galaxy <code>6</code>: 17</li>
|
|
||||||
<li>Between galaxy <code>8</code> and galaxy <code>9</code>: 5</li>
|
|
||||||
</ul>
|
|
||||||
<p>In this example, after expanding the universe, the sum of the shortest path between all 36 pairs of galaxies is <code><em>374</em></code>.</p>
|
|
||||||
<p>Expand the universe, then find the length of the shortest path between every pair of galaxies. <em>What is the sum of these lengths?</em></p>
|
|
||||||
|
|
||||||
<p>Your puzzle answer was <code>9724940</code>.</p><p class="day-success">The first half of this puzzle is complete! It provides one gold star: *</p>
|
|
||||||
<article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>The galaxies are much <em>older</em> (and thus much <em>farther apart</em>) than the researcher initially estimated.</p>
|
|
||||||
<p>Now, instead of the expansion you did before, make each empty row or column <em><span title="And you have to have your pinky near your mouth when you do it.">one million</span> times</em> larger. That is, each empty row should be replaced with <code>1000000</code> empty rows, and each empty column should be replaced with <code>1000000</code> empty columns.</p>
|
|
||||||
<p>(In the example above, if each empty row or column were merely <code>10</code> times larger, the sum of the shortest paths between every pair of galaxies would be <code><em>1030</em></code>. If each empty row or column were merely <code>100</code> times larger, the sum of the shortest paths between every pair of galaxies would be <code><em>8410</em></code>. However, your universe will need to expand far beyond these values.)</p>
|
|
||||||
<p>Starting with the same initial image, expand the universe according to these new rules, then find the length of the shortest path between every pair of galaxies. <em>What is the sum of these lengths?</em></p>
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,76 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 12: Hot Springs ---</h2><p>You finally reach the hot springs! You can see steam rising from secluded areas attached to the primary, ornate building.</p>
|
|
||||||
<p>As you turn to enter, the <a href="11">researcher</a> stops you. "Wait - I thought you were looking for the hot springs, weren't you?" You indicate that this definitely looks like hot springs to you.</p>
|
|
||||||
<p>"Oh, sorry, common mistake! This is actually the <a href="https://en.wikipedia.org/wiki/Onsen" target="_blank">onsen</a>! The hot springs are next door."</p>
|
|
||||||
<p>You look in the direction the researcher is pointing and suddenly notice the <span title="I love this joke. I'm not sorry.">massive metal helixes</span> towering overhead. "This way!"</p>
|
|
||||||
<p>It only takes you a few more steps to reach the main gate of the massive fenced-off area containing the springs. You go through the gate and into a small administrative building.</p>
|
|
||||||
<p>"Hello! What brings you to the hot springs today? Sorry they're not very hot right now; we're having a <em>lava shortage</em> at the moment." You ask about the missing machine parts for Desert Island.</p>
|
|
||||||
<p>"Oh, all of Gear Island is currently offline! Nothing is being manufactured at the moment, not until we get more lava to heat our forges. And our springs. The springs aren't very springy unless they're hot!"</p>
|
|
||||||
<p>"Say, could you go up and see why the lava stopped flowing? The springs are too cold for normal operation, but we should be able to find one springy enough to launch <em>you</em> up there!"</p>
|
|
||||||
<p>There's just one problem - many of the springs have fallen into disrepair, so they're not actually sure which springs would even be <em>safe</em> to use! Worse yet, their <em>condition records of which springs are damaged</em> (your puzzle input) are also damaged! You'll need to help them repair the damaged records.</p>
|
|
||||||
<p>In the giant field just outside, the springs are arranged into <em>rows</em>. For each row, the condition records show every spring and whether it is <em>operational</em> (<code>.</code>) or <em>damaged</em> (<code>#</code>). This is the part of the condition records that is itself damaged; for some springs, it is simply <em>unknown</em> (<code>?</code>) whether the spring is operational or damaged.</p>
|
|
||||||
<p>However, the engineer that produced the condition records also duplicated some of this information in a different format! After the list of springs for a given row, the size of each <em>contiguous group of damaged springs</em> is listed in the order those groups appear in the row. This list always accounts for every damaged spring, and each number is the entire size of its contiguous group (that is, groups are always separated by at least one operational spring: <code>####</code> would always be <code>4</code>, never <code>2,2</code>).</p>
|
|
||||||
<p>So, condition records with no unknown spring conditions might look like this:</p>
|
|
||||||
<pre><code>#.#.### 1,1,3
|
|
||||||
.#...#....###. 1,1,3
|
|
||||||
.#.###.#.###### 1,3,1,6
|
|
||||||
####.#...#... 4,1,1
|
|
||||||
#....######..#####. 1,6,5
|
|
||||||
.###.##....# 3,2,1
|
|
||||||
</code></pre>
|
|
||||||
<p>However, the condition records are partially damaged; some of the springs' conditions are actually <em>unknown</em> (<code>?</code>). For example:</p>
|
|
||||||
<pre><code>???.### 1,1,3
|
|
||||||
.??..??...?##. 1,1,3
|
|
||||||
?#?#?#?#?#?#?#? 1,3,1,6
|
|
||||||
????.#...#... 4,1,1
|
|
||||||
????.######..#####. 1,6,5
|
|
||||||
?###???????? 3,2,1
|
|
||||||
</code></pre>
|
|
||||||
<p>Equipped with this information, it is your job to figure out <em>how many different arrangements</em> of operational and broken springs fit the given criteria in each row.</p>
|
|
||||||
<p>In the first line (<code>???.### 1,1,3</code>), there is exactly <em>one</em> way separate groups of one, one, and three broken springs (in that order) can appear in that row: the first three unknown springs must be broken, then operational, then broken (<code>#.#</code>), making the whole row <code>#.#.###</code>.</p>
|
|
||||||
<p>The second line is more interesting: <code>.??..??...?##. 1,1,3</code> could be a total of <em>four</em> different arrangements. The last <code>?</code> must always be broken (to satisfy the final contiguous group of three broken springs), and each <code>??</code> must hide exactly one of the two broken springs. (Neither <code>??</code> could be both broken springs or they would form a single contiguous group of two; if that were true, the numbers afterward would have been <code>2,3</code> instead.) Since each <code>??</code> can either be <code>#.</code> or <code>.#</code>, there are four possible arrangements of springs.</p>
|
|
||||||
<p>The last line is actually consistent with <em>ten</em> different arrangements! Because the first number is <code>3</code>, the first and second <code>?</code> must both be <code>.</code> (if either were <code>#</code>, the first number would have to be <code>4</code> or higher). However, the remaining run of unknown spring conditions have many different ways they could hold groups of two and one broken springs:</p>
|
|
||||||
<pre><code>?###???????? 3,2,1
|
|
||||||
.###.##.#...
|
|
||||||
.###.##..#..
|
|
||||||
.###.##...#.
|
|
||||||
.###.##....#
|
|
||||||
.###..##.#..
|
|
||||||
.###..##..#.
|
|
||||||
.###..##...#
|
|
||||||
.###...##.#.
|
|
||||||
.###...##..#
|
|
||||||
.###....##.#
|
|
||||||
</code></pre>
|
|
||||||
<p>In this example, the number of possible arrangements for each row is:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>???.### 1,1,3</code> - <code><em>1</em></code> arrangement</li>
|
|
||||||
<li><code>.??..??...?##. 1,1,3</code> - <code><em>4</em></code> arrangements</li>
|
|
||||||
<li><code>?#?#?#?#?#?#?#? 1,3,1,6</code> - <code><em>1</em></code> arrangement</li>
|
|
||||||
<li><code>????.#...#... 4,1,1</code> - <code><em>1</em></code> arrangement</li>
|
|
||||||
<li><code>????.######..#####. 1,6,5</code> - <code><em>4</em></code> arrangements</li>
|
|
||||||
<li><code>?###???????? 3,2,1</code> - <code><em>10</em></code> arrangements</li>
|
|
||||||
</ul>
|
|
||||||
<p>Adding all of the possible arrangement counts together produces a total of <code><em>21</em></code> arrangements.</p>
|
|
||||||
<p>For each row, count all of the different arrangements of operational and broken springs that meet the given criteria. <em>What is the sum of those counts?</em></p>
|
|
||||||
|
|
||||||
<p>Your puzzle answer was <code>7307</code>.</p><p class="day-success">The first half of this puzzle is complete! It provides one gold star: *</p>
|
|
||||||
<article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>As you look out at the field of springs, you feel like there are way more springs than the condition records list. When you examine the records, you discover that they were actually <em>folded up</em> this whole time!</p>
|
|
||||||
<p>To <em>unfold the records</em>, on each row, replace the list of spring conditions with five copies of itself (separated by <code>?</code>) and replace the list of contiguous groups of damaged springs with five copies of itself (separated by <code>,</code>).</p>
|
|
||||||
<p>So, this row:</p>
|
|
||||||
<pre><code>.# 1</code></pre>
|
|
||||||
<p>Would become:</p>
|
|
||||||
<pre><code>.#?.#?.#?.#?.# 1,1,1,1,1</code></pre>
|
|
||||||
<p>The first line of the above example would become:</p>
|
|
||||||
<pre><code>???.###????.###????.###????.###????.### 1,1,3,1,1,3,1,1,3,1,1,3,1,1,3</code></pre>
|
|
||||||
<p>In the above example, after unfolding, the number of possible arrangements for some rows is now much larger:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>???.### 1,1,3</code> - <code><em>1</em></code> arrangement</li>
|
|
||||||
<li><code>.??..??...?##. 1,1,3</code> - <code><em>16384</em></code> arrangements</li>
|
|
||||||
<li><code>?#?#?#?#?#?#?#? 1,3,1,6</code> - <code><em>1</em></code> arrangement</li>
|
|
||||||
<li><code>????.#...#... 4,1,1</code> - <code><em>16</em></code> arrangements</li>
|
|
||||||
<li><code>????.######..#####. 1,6,5</code> - <code><em>2500</em></code> arrangements</li>
|
|
||||||
<li><code>?###???????? 3,2,1</code> - <code><em>506250</em></code> arrangements</li>
|
|
||||||
</ul>
|
|
||||||
<p>After unfolding, adding all of the possible arrangement counts together produces <code><em>525152</em></code>.</p>
|
|
||||||
<p>Unfold your condition records; <em>what is the new sum of possible arrangement counts?</em></p>
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,94 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 13: Point of Incidence ---</h2><p>With your help, the hot springs team locates an appropriate spring which launches you neatly and precisely up to the edge of <em>Lava Island</em>.</p>
|
|
||||||
<p>There's just one problem: you don't see any <em>lava</em>.</p>
|
|
||||||
<p>You <em>do</em> see a lot of ash and igneous rock; there are even what look like gray mountains scattered around. After a while, you make your way to a nearby cluster of mountains only to discover that the valley between them is completely full of large <em>mirrors</em>. Most of the mirrors seem to be aligned in a consistent way; perhaps you should head in that direction?</p>
|
|
||||||
<p>As you move through the valley of mirrors, you find that several of them have fallen from the large metal frames keeping them in place. The mirrors are extremely flat and shiny, and many of the fallen mirrors have lodged into the ash at strange angles. Because the terrain is all one color, it's hard to tell where it's safe to walk or where you're about to run into a mirror.</p>
|
|
||||||
<p>You note down the patterns of ash (<code>.</code>) and rocks (<code>#</code>) that you see as you walk (your puzzle input); perhaps by carefully analyzing these patterns, you can figure out where the mirrors are!</p>
|
|
||||||
<p>For example:</p>
|
|
||||||
<pre><code>#.##..##.
|
|
||||||
..#.##.#.
|
|
||||||
##......#
|
|
||||||
##......#
|
|
||||||
..#.##.#.
|
|
||||||
..##..##.
|
|
||||||
#.#.##.#.
|
|
||||||
|
|
||||||
#...##..#
|
|
||||||
#....#..#
|
|
||||||
..##..###
|
|
||||||
#####.##.
|
|
||||||
#####.##.
|
|
||||||
..##..###
|
|
||||||
#....#..#
|
|
||||||
</code></pre>
|
|
||||||
<p>To find the reflection in each pattern, you need to find a perfect reflection across either a horizontal line between two rows or across a vertical line between two columns.</p>
|
|
||||||
<p>In the first pattern, the reflection is across a vertical line between two columns; arrows on each of the two columns point at the line between the columns:</p>
|
|
||||||
<pre><code>123456789
|
|
||||||
><
|
|
||||||
#.##..##.
|
|
||||||
..#.##.#.
|
|
||||||
##......#
|
|
||||||
##......#
|
|
||||||
..#.##.#.
|
|
||||||
..##..##.
|
|
||||||
#.#.##.#.
|
|
||||||
><
|
|
||||||
123456789
|
|
||||||
</code></pre>
|
|
||||||
<p>In this pattern, the line of reflection is the vertical line between columns 5 and 6. Because the vertical line is not perfectly in the middle of the pattern, part of the pattern (column 1) has nowhere to reflect onto and can be ignored; every other column has a reflected column within the pattern and must match exactly: column 2 matches column 9, column 3 matches 8, 4 matches 7, and 5 matches 6.</p>
|
|
||||||
<p>The second pattern reflects across a horizontal line instead:</p>
|
|
||||||
<pre><code>1 #...##..# 1
|
|
||||||
2 #....#..# 2
|
|
||||||
3 ..##..### 3
|
|
||||||
4v#####.##.v4
|
|
||||||
5^#####.##.^5
|
|
||||||
6 ..##..### 6
|
|
||||||
7 #....#..# 7
|
|
||||||
</code></pre>
|
|
||||||
<p>This pattern reflects across the horizontal line between rows 4 and 5. Row 1 would reflect with a hypothetical row 8, but since that's not in the pattern, row 1 doesn't need to match anything. The remaining rows match: row 2 matches row 7, row 3 matches row 6, and row 4 matches row 5.</p>
|
|
||||||
<p>To <em>summarize</em> your pattern notes, add up <em>the number of columns</em> to the left of each vertical line of reflection; to that, also add <em>100 multiplied by the number of rows</em> above each horizontal line of reflection. In the above example, the first pattern's vertical line has <code>5</code> columns to its left and the second pattern's horizontal line has <code>4</code> rows above it, a total of <code><em>405</em></code>.</p>
|
|
||||||
<p>Find the line of reflection in each of the patterns in your notes. <em>What number do you get after summarizing all of your notes?</em></p>
|
|
||||||
|
|
||||||
<p>Your puzzle answer was <code>27505</code>.</p><p class="day-success">The first half of this puzzle is complete! It provides one gold star: *</p>
|
|
||||||
<article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>You resume walking through the valley of mirrors and - <em>SMACK!</em> - run directly into one. Hopefully <span title="Sorry, Nobody saw that.">nobody</span> was watching, because that must have been pretty embarrassing.</p>
|
|
||||||
<p>Upon closer inspection, you discover that every mirror has exactly one <em>smudge</em>: exactly one <code>.</code> or <code>#</code> should be the opposite type.</p>
|
|
||||||
<p>In each pattern, you'll need to locate and fix the smudge that causes a <em>different reflection line</em> to be valid. (The old reflection line won't necessarily continue being valid after the smudge is fixed.)</p>
|
|
||||||
<p>Here's the above example again:</p>
|
|
||||||
<pre><code>#.##..##.
|
|
||||||
..#.##.#.
|
|
||||||
##......#
|
|
||||||
##......#
|
|
||||||
..#.##.#.
|
|
||||||
..##..##.
|
|
||||||
#.#.##.#.
|
|
||||||
|
|
||||||
#...##..#
|
|
||||||
#....#..#
|
|
||||||
..##..###
|
|
||||||
#####.##.
|
|
||||||
#####.##.
|
|
||||||
..##..###
|
|
||||||
#....#..#
|
|
||||||
</code></pre>
|
|
||||||
<p>The first pattern's smudge is in the top-left corner. If the top-left <code>#</code> were instead <code>.</code>, it would have a different, horizontal line of reflection:</p>
|
|
||||||
<pre><code>1 ..##..##. 1
|
|
||||||
2 ..#.##.#. 2
|
|
||||||
3v##......#v3
|
|
||||||
4^##......#^4
|
|
||||||
5 ..#.##.#. 5
|
|
||||||
6 ..##..##. 6
|
|
||||||
7 #.#.##.#. 7
|
|
||||||
</code></pre>
|
|
||||||
<p>With the smudge in the top-left corner repaired, a new horizontal line of reflection between rows 3 and 4 now exists. Row 7 has no corresponding reflected row and can be ignored, but every other row matches exactly: row 1 matches row 6, row 2 matches row 5, and row 3 matches row 4.</p>
|
|
||||||
<p>In the second pattern, the smudge can be fixed by changing the fifth symbol on row 2 from <code>.</code> to <code>#</code>:</p>
|
|
||||||
<pre><code>1v#...##..#v1
|
|
||||||
2^#...##..#^2
|
|
||||||
3 ..##..### 3
|
|
||||||
4 #####.##. 4
|
|
||||||
5 #####.##. 5
|
|
||||||
6 ..##..### 6
|
|
||||||
7 #....#..# 7
|
|
||||||
</code></pre>
|
|
||||||
<p>Now, the pattern has a different horizontal line of reflection between rows 1 and 2.</p>
|
|
||||||
<p>Summarize your notes as before, but instead use the new different reflection lines. In this example, the first pattern's new horizontal line has 3 rows above it and the second pattern's new horizontal line has 1 row above it, summarizing to the value <code><em>400</em></code>.</p>
|
|
||||||
<p>In each pattern, fix the smudge and find the different line of reflection. <em>What number do you get after summarizing the new reflection line in each pattern in your notes?</em></p>
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
O....##.##.....OO...O.O......#.OO.#.#....#.#..#..##....###..O.....O#..#.#.......O.#.##...O#OO.O....O
|
|
||||||
.#..OOO..#.#..O..O...O.#.......O..O....##..O##O..#..#.......O.O.#....O...O#.O#OOO...O...#O.#......O.
|
|
||||||
..#O...#O.......##.O.O..O#..OO..O...#.O...O.#...#.OOO.OO.O......#.....#.O..##.O.#.#...O.O#..#..#O.#.
|
|
||||||
O####.O.#.O...#..#...O.......#....#..O....OO#...O..##...#..##..O..####..OO.O..O.#OO..O.O..O##O.....#
|
|
||||||
OO..O.##..#.O##O.....#..#O#.O...#.......#O#...#.O....#..O.O.....O#.OO....O......O#O.#..O..OO.O.O....
|
|
||||||
..#O.O...O...O..O.OO.O#OO...#......#.....O.#.....#.....O##.#......#O..OO.......#..#..O...#.......O.O
|
|
||||||
.O...#.......OO..O.....#....#.#.O.........#....#......#.OO...O.........O.O.O....O..#..#O..##...#.O..
|
|
||||||
O#......#.O....#.O.#....#....O.......#O.O#O..O..#...#.O.#..O.OO...O..O....#O#OOOO................#..
|
|
||||||
O..O.#..#........O......O..O..#..O.#.O...#O...O##..O.....#OO.#..#...........##.#...O##.O...#..#..O..
|
|
||||||
..O.....OO.O#..#O#.....#......OOOO#..#.O.#.#..O..O.....O.O.#....#O...O...O.OO......#O#.#.##......O.O
|
|
||||||
.#.#............OO...O.OOO#O..#.#O#.O.#O#.O.O.....#.O..........#.....O#..O...O#.....O......##O..#OO.
|
|
||||||
.O#O....O#..#....OO.....#...O...O..O.O..O..##....#.#.....O....O..#O..........#O...#O##.#....O..##O..
|
|
||||||
....OOO.O..O#..#.OO.....O#..O.O#...#.....##OO.....OO...##O.....O......O#..O##...#...##.O..O....#.#..
|
|
||||||
.#......O.#..O...........O...#..O#.O.#O#..OO.........O.O...O##.........##.O#.........#.O......#...#.
|
|
||||||
O.#...##..#..........#OO........O#..##..##.#O#O..O..#O..O....O.OO....O...OOO...O.....#.OO#..#.#.....
|
|
||||||
.##.#O.##..#....O.##O..O.#..O...#...O....O#....O...O.#O#...........##O..O..#.O....O........O.#...OOO
|
|
||||||
.O#......OOOO...#..O....#..#.O#.#.##.##O#.#.#..O....O#..........O..#..O...#.....O........#....O.#..#
|
|
||||||
.....O......#..#...O....OO...O#OO...OO.O....#..O.O.....O#OO.#....#.#.#......O......OO........#.#.##.
|
|
||||||
......O......O...O##.#O........O.......#.##.O......O.#.#.#.....#.O....#..#O...O##..#..#.##...O#O.O.O
|
|
||||||
..OO.O...#..OO#.OO..O......##......O.#...#....O.OO..O...#.......#O##..OO....OO.O..#.O...#O..#.#O....
|
|
||||||
O...O.#.O..#.OOO...........O..#.#....OO..OO.O....O#O#O#..OOOO....OOO.OOO#....#....O#..O#.O.#....O...
|
|
||||||
.......O.....O..O.#...O.#...#O.O..#......#...O#OOOO#..OOO..#..O....#...O..O..O.#....O.O.O.O...#O....
|
|
||||||
#...O.#.........OO...#......OO....O.##OOO#O.......#.O..#..O.#O#.O...O.OOO.O##OO.#.O.O..#.....O...O#.
|
|
||||||
O.OOOOO##O#.......O#.....O...O.#...O..OOO.....##...O...O....O.#....##O....#.#OO..#..#O..OO#OO#......
|
|
||||||
...........O...#.O....O##O..O.O....#.#O...O..OO.......#..#.#...#.........##..#.O...#.O...OOO..O.#OO.
|
|
||||||
..O##....#....O.#.O#O##.OOOOO..O.#..#...O..#...#.##.#O.....#..O..O.O#...#.O..#....#O.#........O#...#
|
|
||||||
#...O.......#.O....O......OO#.##..##O..O..O....O.O##.OOO......#......#...OO..O.O..........OO.O.O..O.
|
|
||||||
........OO.O.#.#.O...............O......O...O....#........O..O....O..O.....O.O..O.O.O#O#.O..##......
|
|
||||||
O..O.......#O..O..O.O....O......O##.#...O##..#...O.O#.#.O..O.O#.#.....O...O#.#.#.....O.....#.#......
|
|
||||||
.#......O..O..#O....O...O...O.......#..#..#.O...##..#......O.O.OOOO...##..#.OO......#O.O.O#...O.##O#
|
|
||||||
..OOO...#.O.O..#.#..O....##.O....#.O..OO#.O.......O..##O##.#OO.....#.....#.....O.#O.OO#....#O..OO.O.
|
|
||||||
..O#OO#.#....O.#..O.#OO#.#...O.#.#.OO....O..O.#...#..O..OO.#.O#..##.#......#O.#.#..O..O...OO#..OOO..
|
|
||||||
#.#OO.....O...O......O............O...###..O.#.OO...O...#...O.....##OO#.......#...#.OO.#...#....#...
|
|
||||||
....O....#.#OO##OO...OO...#..#.#.....O.....O..O....#......O....O#....OO.#....O....O...#.O..#OOO.OOOO
|
|
||||||
.#..O.O.O.O.#.O##O..#..O...........O..........OO#.#..O...#O....#OO...O.#.....O.OOOO....O.......#O.#.
|
|
||||||
...O##....O.....#O..#.OO........#...O..#O#..OO#........###.O..O......O..#...##.#..#..#O.....O.#..#.#
|
|
||||||
.#..O.....O...OO#OO..#......O.#....#..#.#.....O.....OO.O...#.....###...O....O.......OO#..#....O.#..O
|
|
||||||
O...#.O..O....#.O....#...#.O....#.O..##.O.O#.O#O.O.....O.#OO#.#O......#.O..#.#..#........O.O...O..O#
|
|
||||||
......O.OOOO.O....O.#.##.O...#O....OOO...O..O###..OOO.........OO.O..O...OO.##..#.#..##.O.#...#....#.
|
|
||||||
.#O...#.##.O....#.#...##O....O#O.O.#.O.#.O...#...O.#.O#O....O.#..###.O.#OOOO.O#OO.....OOO#.....##..O
|
|
||||||
..O##O.#.#..O...#O..O.##.#O..O.#..OO.O..........O.....O#.#.OOO........#O.O#.#..O..OOO....#..O.O.#..O
|
|
||||||
OO.#O....OO#........O.O.#..#..O#.O.OO#O...O.#.O........O##.OO..O..#..O........O#.#O.............O...
|
|
||||||
................O#...........O........O#.O..O#..#O.O.O..#.....#.#O..O.O.#.....#.O.....#...#.#O..#..#
|
|
||||||
#....#...#....#.#O......##O.....#.#........#.O....OO#..OO.#....OO..#....O....OO..#..##......#O.O.#..
|
|
||||||
O####O.##....####O..#.#.OO.O..#O#O...O.OOO...#O##..##......O...O..OO..#.O#O...O.#O........O.....#..#
|
|
||||||
...OOO.O.....O..#.O.....O.OO...OOO#O.........O...O..#...#OO.....#..O....#....#.......##.....#...#.O#
|
|
||||||
#.....O#..O#.#.....#..O......#..O.......O##.....##.##O..OO##.OO#..##......O......O....O....O#....O..
|
|
||||||
O....OO......O.....O...O#.O..#.#...#....#..#....OO.O##O..##O..O#.O.#.OO#.OOO....#.OO..#O..O..#..##..
|
|
||||||
O.O#.#OO..O..O...OO......OO.......#.O#O.O#....#.O#O..O#.#...O#..O...O....O.#OO#.#..O.##..O.....#..OO
|
|
||||||
.##.O...O.O..O....OO...O#....OO..#.....#.....OO##.#.O.#......#.O...O..O...##..#O.....#.O....#O......
|
|
||||||
.OO#..O.O.....#.O.OO.##..#.....O......O..OO...O.O.O##OO.#O...O..O..O#...OO..O.....#.............O.OO
|
|
||||||
..O....#O..##.O..#...O#..#.OO....##.O.....#..##.O...#.O...O.#O.OO..#O...O##.O.......#.O.#.O..#O.....
|
|
||||||
.##..........O..#.#.........O....O..O#..##.#..#..O#OO..#..#O...O#O.#..#.#.O.OO......O###.....O.O....
|
|
||||||
...#O..O..O#..O#..O#...OO.O.O.#.OO..#.#..#.#.......O.O..#OO#..O....O...#O#..#O....O.#O.#..#.#..O...#
|
|
||||||
OO###....OO..#.##OO......#..O###..O.....O.O.#...OO..#O....OO..#O..#.#..OO.#.....O......OOO........OO
|
|
||||||
.O....#..#.O.O........O..#....O...O...O#.....OOOO.####.O..#.##.##O##..O.OO...O.OO..#O...O..O.O.#.O..
|
|
||||||
##O#...#...O.O#..O..O.#.OOO..O..##....#....##.O.#.O....O.#....O##...OO..O..#..O.O.#.....#OOO.O..O...
|
|
||||||
.O.....#....O#.O......#O...#.#.#...O.#..O.O..#...O.#O..O..O......#...........O##..O#O.#.#.#.........
|
|
||||||
OO.....O..#.O#.....##O..##....OO....O..O.O..#..O.O........O...#...O....O#O.O..#.O..##.#...#.....###.
|
|
||||||
.#..........O.....#O#O....O.OO.#..#...#..O.#...O.#.#.O#O....#O.O..#.....##O#.#.O..#O....O.##...#.O.O
|
|
||||||
.O....O....O##.O...O....O....O....O..O............#O...#.#...OOO....O#.....O#...##.......O.#........
|
|
||||||
.#.......OOO#............OO..........O.#...O..OO....#..O.#...##.O#....O..O.#.O#O##.O.O...#.#O#.O.O..
|
|
||||||
.#..#.#...........O.#..##..OO#.O..O..O.#OO##O.O..OOO....OO..#OO..#..###..O....##...........#O.###.O.
|
|
||||||
O....O..O...#........O.#OOOOO#.O.....O.#...O.OOO#.#......#.OO#.#.O..#..#O....##....#.###...#.###..#.
|
|
||||||
..O...O#.O.....#.OOO.O....O.......#O...O..#.#......#.#..O......OOO.#..O.#O..O..O#..#..#...#....O.#.O
|
|
||||||
O....O...OO.....#.....O#..#..##...O..O.....##....#O.....##.#..O#.O...#O.....O##.##O.....#O..O..O...#
|
|
||||||
O.##.OO.O.O.O...O..O..O...O.O...O.#..O...###....O..O##O#....OO.......#....#OO....#.#.......O....OO#O
|
|
||||||
.O......OO.....##...##.#..#..........##O..#.O#.#....#...#.OO..O.....#...O.......##.OO##....O..OO....
|
|
||||||
O....O#.....#.OO..O#..OO.OO#..O...O.O.OO.O.O.#...O.#OO..O#.....#.#.....#..O....O...........O#.#.#...
|
|
||||||
#..#.#..#.....#O.O.#####........O..#......#O......##.........#....#.#O.#.O...O.#..O.O..#O.#O..OO..#O
|
|
||||||
...O..O...O.OOOO.O#O###..O...#..#.......O#......O..O#O.OO.#..#.O.O...O....O.....###...#......##....O
|
|
||||||
..#.#O........O#O..##OOO....O##.#..O...#.O.O##..#OO.....#OO.#......O...#...#.O.#.O#.....O...O...##.#
|
|
||||||
O.....OO....OO#..O.....O....O..#.#.......OO#O........##.O..O#O.#.##.O..O.#.#.#......#O.##....O.#OO.O
|
|
||||||
..O..OO..O..O#....O...#....OO#O.......O....O..##O.O.O#..#O#....#..O.....#O.#.O#....##....O......#...
|
|
||||||
......#O#..O#..OO#...#......#.#.......O#..#.O#.O.O.OO...#..#O..##..#O..O...#..#.O....##O.O##O..O.#.O
|
|
||||||
..#O...#...O.........OO........O.O.O#......OO.#.....O.O..O#.#O#.....####.OO....#O#OO..#O.O..O##O...#
|
|
||||||
.#.O..#...O.#.O.OO###.#.OO#..O.#OO.#.#.#....O...#O#..OOOO#.......#.O...OO.....O#.#...##.............
|
|
||||||
.#.#.OO....O.........O..##O.#.O........O.#O.O##...O....O.O.#OOO....OO.O..O.OO...O..#OO...#......#..#
|
|
||||||
......O.....O..O...#...#......O..#O#...#...#...O...OO.........O..O.O.OOO.O.#.O.O....OO.O.#O..O...O..
|
|
||||||
........#....OO......#.....#O#...#..O.O..#..O..O.##O.O..........#...#.O...O#.O..........OOOO.O....O.
|
|
||||||
O..#.O.O....OO...#.O.......O....#.O#...O#.......OO..#O###O#O.O.O.#...#...#O#.O..O...OOO.OOO.#.#.....
|
|
||||||
.#.OO......O#.#...OO.#..O....O#O.O#..........O......#.#.O....O...O.#O.#OO........#..#...##..#....OOO
|
|
||||||
O.....#....O......O......OO#O#.##.##OO..O............O.OO...O#.....#...##...#...OO.OO.......O.....O.
|
|
||||||
.....OO.O......O.........O.#.O.....#.#O......O..O..#.#.##.........O##OO....O..OO...#........#...##..
|
|
||||||
#..###......O.....O#OO...#..#O....O.OO..O...........#..#.#...O##O...O.O....#.OO..#.#.OO....#..#O.O.#
|
|
||||||
.........O#.O#...##.#.#...O#.O.........O.#..OO........O.O.....#O....O#.#..O.O..#....#.....#.......O.
|
|
||||||
...#O...O.#...OOOO.#O..O.O#.....#.#.....O..#.....O.#.O......O.##O.O..O........#.........#O..O#..#...
|
|
||||||
#.#.#O#.O..#O.#O..#.##..O#.O..#.O.OOO...........O..O.O.#O..#....O....#O.##O.##O......O..OOO...#O...O
|
|
||||||
O.#O##.....#.O.O.OO.O..O....O...#O...........O.##O##...OO...##.#.#.#.#.O..O...#......O...O.#..#.#.O.
|
|
||||||
.OO....O.....#O.O........O#.......O...O.O##O..#....O.#O.#.O.....##..#...#.OO.O.O..##...#O.OOO#O..#.#
|
|
||||||
##O#OOO.##...#.O...#....#...O#.....O....#.OOO.O.##..OO.OO...O.O.O..O.O..#.#.#.##...O...#..#.#.O.....
|
|
||||||
..O#..#OOO#....O...#.O.#...#....#...#....O..........O.O#.....O.....O.OO...O.#.......O.#...O.........
|
|
||||||
#..#.#.O#.OO.O...O..#....#.O..OO.....#..O...O.#.#...OO....O#..O....###...###..O.O.O.O.O..OOO.....OO.
|
|
||||||
#..#..#.O..#..O.O..O#....##O.OO.O#OO.......O........#..O..#.O..#.#OOOO...O..#OOO....#..#..OOO......O
|
|
||||||
.#O.#.#.#...#OOO.OO..#O.##.....O..#O.##.O.O.O..OOO#....O.##......OOOOOO...O..O......#...#.O...O.#...
|
|
||||||
#O..O.O###...##O...O........##.O#....#O..O.O.O#.#OO##O.O.O#.#.##O.OO........O.........###O.O.#O#OO#O
|
|
||||||
O..#O......#.#O...O#...#####..#O#...O.##OO......O.....O.......O.O.#..O.O...........#OO..#..OOO....#.
|
|
||||||
....O.O#..#O#.#....#O.O##..#...O...#O.#.#.##O...OO....O..#..OO#........#O.........#O..O.#..OO.......
|
|
||||||
#..##.#.O#O..#O..OO...#.....#..O#..O....O#.....OO.O......O..#....O.##O#O...O....#..O.......O....O.##
|
|
||||||
#....#O..#O.O..#....OO#.#OO...O..O.......O..#......#.......#.O.#..OO..O........OO.......#O.O.#O....O
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 14: Parabolic Reflector Dish ---</h2><p>You reach the place where all of the mirrors were pointing: a massive <a href="https://en.wikipedia.org/wiki/Parabolic_reflector" target="_blank">parabolic reflector dish</a> <span title="Why, where do you attach YOUR massive parabolic reflector dishes?">attached</span> to the side of another large mountain.</p>
|
|
||||||
<p>The dish is made up of many small mirrors, but while the mirrors themselves are roughly in the shape of a parabolic reflector dish, each individual mirror seems to be pointing in slightly the wrong direction. If the dish is meant to focus light, all it's doing right now is sending it in a vague direction.</p>
|
|
||||||
<p>This system must be what provides the energy for the lava! If you focus the reflector dish, maybe you can go where it's pointing and use the light to fix the lava production.</p>
|
|
||||||
<p>Upon closer inspection, the individual mirrors each appear to be connected via an elaborate system of ropes and pulleys to a large metal platform below the dish. The platform is covered in large rocks of various shapes. Depending on their position, the weight of the rocks deforms the platform, and the shape of the platform controls which ropes move and ultimately the focus of the dish.</p>
|
|
||||||
<p>In short: if you move the rocks, you can focus the dish. The platform even has a control panel on the side that lets you <em>tilt</em> it in one of four directions! The rounded rocks (<code>O</code>) will roll when the platform is tilted, while the cube-shaped rocks (<code>#</code>) will stay in place. You note the positions of all of the empty spaces (<code>.</code>) and rocks (your puzzle input). For example:</p>
|
|
||||||
<pre><code>O....#....
|
|
||||||
O.OO#....#
|
|
||||||
.....##...
|
|
||||||
OO.#O....O
|
|
||||||
.O.....O#.
|
|
||||||
O.#..O.#.#
|
|
||||||
..O..#O..O
|
|
||||||
.......O..
|
|
||||||
#....###..
|
|
||||||
#OO..#....
|
|
||||||
</code></pre>
|
|
||||||
<p>Start by tilting the lever so all of the rocks will slide <em>north</em> as far as they will go:</p>
|
|
||||||
<pre><code>OOOO.#.O..
|
|
||||||
OO..#....#
|
|
||||||
OO..O##..O
|
|
||||||
O..#.OO...
|
|
||||||
........#.
|
|
||||||
..#....#.#
|
|
||||||
..O..#.O.O
|
|
||||||
..O.......
|
|
||||||
#....###..
|
|
||||||
#....#....
|
|
||||||
</code></pre>
|
|
||||||
<p>You notice that the support beams along the north side of the platform are <em>damaged</em>; to ensure the platform doesn't collapse, you should calculate the <em>total load</em> on the north support beams.</p>
|
|
||||||
<p>The amount of load caused by a single rounded rock (<code>O</code>) is equal to the number of rows from the rock to the south edge of the platform, including the row the rock is on. (Cube-shaped rocks (<code>#</code>) don't contribute to load.) So, the amount of load caused by each rock in each row is as follows:</p>
|
|
||||||
<pre><code>OOOO.#.O.. 10
|
|
||||||
OO..#....# 9
|
|
||||||
OO..O##..O 8
|
|
||||||
O..#.OO... 7
|
|
||||||
........#. 6
|
|
||||||
..#....#.# 5
|
|
||||||
..O..#.O.O 4
|
|
||||||
..O....... 3
|
|
||||||
#....###.. 2
|
|
||||||
#....#.... 1
|
|
||||||
</code></pre>
|
|
||||||
<p>The total load is the sum of the load caused by all of the <em>rounded rocks</em>. In this example, the total load is <code><em>136</em></code>.</p>
|
|
||||||
<p>Tilt the platform so that the rounded rocks all roll north. Afterward, <em>what is the total load on the north support beams?</em></p>
|
|
||||||
|
|
||||||
<p>Your puzzle answer was <code>106378</code>.</p><p class="day-success">The first half of this puzzle is complete! It provides one gold star: *</p>
|
|
||||||
<article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>The parabolic reflector dish deforms, but not in a way that focuses the beam. To do that, you'll need to move the rocks to the edges of the platform. Fortunately, a button on the side of the control panel labeled "<em>spin cycle</em>" attempts to do just that!</p>
|
|
||||||
<p>Each <em>cycle</em> tilts the platform four times so that the rounded rocks roll <em>north</em>, then <em>west</em>, then <em>south</em>, then <em>east</em>. After each tilt, the rounded rocks roll as far as they can before the platform tilts in the next direction. After one cycle, the platform will have finished rolling the rounded rocks in those four directions in that order.</p>
|
|
||||||
<p>Here's what happens in the example above after each of the first few cycles:</p>
|
|
||||||
<pre><code>After 1 cycle:
|
|
||||||
.....#....
|
|
||||||
....#...O#
|
|
||||||
...OO##...
|
|
||||||
.OO#......
|
|
||||||
.....OOO#.
|
|
||||||
.O#...O#.#
|
|
||||||
....O#....
|
|
||||||
......OOOO
|
|
||||||
#...O###..
|
|
||||||
#..OO#....
|
|
||||||
|
|
||||||
After 2 cycles:
|
|
||||||
.....#....
|
|
||||||
....#...O#
|
|
||||||
.....##...
|
|
||||||
..O#......
|
|
||||||
.....OOO#.
|
|
||||||
.O#...O#.#
|
|
||||||
....O#...O
|
|
||||||
.......OOO
|
|
||||||
#..OO###..
|
|
||||||
#.OOO#...O
|
|
||||||
|
|
||||||
After 3 cycles:
|
|
||||||
.....#....
|
|
||||||
....#...O#
|
|
||||||
.....##...
|
|
||||||
..O#......
|
|
||||||
.....OOO#.
|
|
||||||
.O#...O#.#
|
|
||||||
....O#...O
|
|
||||||
.......OOO
|
|
||||||
#...O###.O
|
|
||||||
#.OOO#...O
|
|
||||||
</code></pre>
|
|
||||||
<p>This process should work if you leave it running long enough, but you're still worried about the north support beams. To make sure they'll survive for a while, you need to calculate the <em>total load</em> on the north support beams after <code>1000000000</code> cycles.</p>
|
|
||||||
<p>In the above example, after <code>1000000000</code> cycles, the total load on the north support beams is <code><em>64</em></code>.</p>
|
|
||||||
<p>Run the spin cycle for <code>1000000000</code> cycles. Afterward, <em>what is the total load on the north support beams?</em></p>
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,135 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 15: Lens Library ---</h2><p>The newly-focused parabolic reflector dish is sending all of the collected light to a point on the side of yet another mountain - the largest mountain on Lava Island. As you approach the mountain, you find that the light is being collected by the wall of a large facility embedded in the mountainside.</p>
|
|
||||||
<p>You find a door under a large sign that says "Lava Production Facility" and next to a smaller sign that says "Danger - Personal Protective Equipment required beyond this point".</p>
|
|
||||||
<p>As you step inside, you are immediately greeted by a somewhat panicked <span title="do you like my hard hat">reindeer</span> wearing goggles and a loose-fitting <a href="https://en.wikipedia.org/wiki/Hard_hat" target="_blank">hard hat</a>. The reindeer leads you to a shelf of goggles and hard hats (you quickly find some that fit) and then further into the facility. At one point, you pass a button with a faint snout mark and the label "PUSH FOR HELP". No wonder you were loaded into that <a href="1">trebuchet</a> so quickly!</p>
|
|
||||||
<p>You pass through a final set of doors surrounded with even more warning signs and into what must be the room that collects all of the light from outside. As you admire the large assortment of lenses available to further focus the light, the reindeer brings you a book titled "Initialization Manual".</p>
|
|
||||||
<p>"Hello!", the book cheerfully begins, apparently unaware of the concerned reindeer reading over your shoulder. "This procedure will let you bring the Lava Production Facility online - all without burning or melting anything unintended!"</p>
|
|
||||||
<p>"Before you begin, please be prepared to use the Holiday ASCII String Helper algorithm (appendix 1A)." You turn to appendix 1A. The reindeer leans closer with interest.</p>
|
|
||||||
<p>The HASH algorithm is a way to turn any <a href="https://en.wikipedia.org/wiki/String_(computer_science)" target="_blank">string</a> of characters into a single <em>number</em> in the range 0 to 255. To run the HASH algorithm on a string, start with a <em>current value</em> of <code>0</code>. Then, for each character in the string starting from the beginning:</p>
|
|
||||||
<ul>
|
|
||||||
<li>Determine the <a href="https://en.wikipedia.org/wiki/ASCII#Printable_characters" target="_blank">ASCII code</a> for the current character of the string.</li>
|
|
||||||
<li>Increase the <em>current value</em> by the ASCII code you just determined.</li>
|
|
||||||
<li>Set the <em>current value</em> to itself multiplied by <code>17</code>.</li>
|
|
||||||
<li>Set the <em>current value</em> to the <a href="https://en.wikipedia.org/wiki/Modulo" target="_blank">remainder</a> of dividing itself by <code>256</code>.</li>
|
|
||||||
</ul>
|
|
||||||
<p>After following these steps for each character in the string in order, the <em>current value</em> is the output of the HASH algorithm.</p>
|
|
||||||
<p>So, to find the result of running the HASH algorithm on the string <code>HASH</code>:</p>
|
|
||||||
<ul>
|
|
||||||
<li>The <em>current value</em> starts at <code>0</code>.</li>
|
|
||||||
<li>The first character is <code>H</code>; its ASCII code is <code>72</code>.</li>
|
|
||||||
<li>The <em>current value</em> increases to <code>72</code>.</li>
|
|
||||||
<li>The <em>current value</em> is multiplied by <code>17</code> to become <code>1224</code>.</li>
|
|
||||||
<li>The <em>current value</em> becomes <code><em>200</em></code> (the remainder of <code>1224</code> divided by <code>256</code>).</li>
|
|
||||||
<li>The next character is <code>A</code>; its ASCII code is <code>65</code>.</li>
|
|
||||||
<li>The <em>current value</em> increases to <code>265</code>.</li>
|
|
||||||
<li>The <em>current value</em> is multiplied by <code>17</code> to become <code>4505</code>.</li>
|
|
||||||
<li>The <em>current value</em> becomes <code><em>153</em></code> (the remainder of <code>4505</code> divided by <code>256</code>).</li>
|
|
||||||
<li>The next character is <code>S</code>; its ASCII code is <code>83</code>.</li>
|
|
||||||
<li>The <em>current value</em> increases to <code>236</code>.</li>
|
|
||||||
<li>The <em>current value</em> is multiplied by <code>17</code> to become <code>4012</code>.</li>
|
|
||||||
<li>The <em>current value</em> becomes <code><em>172</em></code> (the remainder of <code>4012</code> divided by <code>256</code>).</li>
|
|
||||||
<li>The next character is <code>H</code>; its ASCII code is <code>72</code>.</li>
|
|
||||||
<li>The <em>current value</em> increases to <code>244</code>.</li>
|
|
||||||
<li>The <em>current value</em> is multiplied by <code>17</code> to become <code>4148</code>.</li>
|
|
||||||
<li>The <em>current value</em> becomes <code><em>52</em></code> (the remainder of <code>4148</code> divided by <code>256</code>).</li>
|
|
||||||
</ul>
|
|
||||||
<p>So, the result of running the HASH algorithm on the string <code>HASH</code> is <code><em>52</em></code>.</p>
|
|
||||||
<p>The <em>initialization sequence</em> (your puzzle input) is a comma-separated list of steps to start the Lava Production Facility. <em>Ignore newline characters</em> when parsing the initialization sequence. To verify that your HASH algorithm is working, the book offers the sum of the result of running the HASH algorithm on each step in the initialization sequence.</p>
|
|
||||||
<p>For example:</p>
|
|
||||||
<pre><code>rn=1,cm-,qp=3,cm=2,qp-,pc=4,ot=9,ab=5,pc-,pc=6,ot=7</code></pre>
|
|
||||||
<p>This initialization sequence specifies 11 individual steps; the result of running the HASH algorithm on each of the steps is as follows:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>rn=1</code> becomes <code><em>30</em></code>.</li>
|
|
||||||
<li><code>cm-</code> becomes <code><em>253</em></code>.</li>
|
|
||||||
<li><code>qp=3</code> becomes <code><em>97</em></code>.</li>
|
|
||||||
<li><code>cm=2</code> becomes <code><em>47</em></code>.</li>
|
|
||||||
<li><code>qp-</code> becomes <code><em>14</em></code>.</li>
|
|
||||||
<li><code>pc=4</code> becomes <code><em>180</em></code>.</li>
|
|
||||||
<li><code>ot=9</code> becomes <code><em>9</em></code>.</li>
|
|
||||||
<li><code>ab=5</code> becomes <code><em>197</em></code>.</li>
|
|
||||||
<li><code>pc-</code> becomes <code><em>48</em></code>.</li>
|
|
||||||
<li><code>pc=6</code> becomes <code><em>214</em></code>.</li>
|
|
||||||
<li><code>ot=7</code> becomes <code><em>231</em></code>.</li>
|
|
||||||
</ul>
|
|
||||||
<p>In this example, the sum of these results is <code><em>1320</em></code>. Unfortunately, the reindeer has stolen the page containing the expected verification number and is currently running around the facility with it excitedly.</p>
|
|
||||||
<p>Run the HASH algorithm on each step in the initialization sequence. <em>What is the sum of the results?</em> (The initialization sequence is one long line; be careful when copy-pasting it.)</p>
|
|
||||||
|
|
||||||
<p>Your puzzle answer was <code>497373</code>.</p><p class="day-success">The first half of this puzzle is complete! It provides one gold star: *</p>
|
|
||||||
<article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>You convince the reindeer to bring you the page; the page confirms that your HASH algorithm is working.</p>
|
|
||||||
<p>The book goes on to describe a series of 256 <em>boxes</em> numbered <code>0</code> through <code>255</code>. The boxes are arranged in a line starting from the point where light enters the facility. The boxes have holes that allow light to pass from one box to the next all the way down the line.</p>
|
|
||||||
<pre><code> +-----+ +-----+ +-----+
|
|
||||||
Light | Box | | Box | ... | Box |
|
|
||||||
----------------------------------------->
|
|
||||||
| 0 | | 1 | ... | 255 |
|
|
||||||
+-----+ +-----+ +-----+
|
|
||||||
</code></pre>
|
|
||||||
<p>Inside each box, there are several <em>lens slots</em> that will keep a lens correctly positioned to focus light passing through the box. The side of each box has a panel that opens to allow you to insert or remove lenses as necessary.</p>
|
|
||||||
<p>Along the wall running parallel to the boxes is a large library containing lenses organized by <em>focal length</em> ranging from <code>1</code> through <code>9</code>. The reindeer also brings you a small handheld <a href="https://en.wikipedia.org/wiki/Label_printer" target="_blank">label printer</a>.</p>
|
|
||||||
<p>The book goes on to explain how to perform each step in the initialization sequence, a process it calls the Holiday ASCII String Helper Manual Arrangement Procedure, or <em>HASHMAP</em> for short.</p>
|
|
||||||
<p>Each step begins with a sequence of letters that indicate the <em>label</em> of the lens on which the step operates. The result of running the HASH algorithm on the label indicates the correct box for that step.</p>
|
|
||||||
<p>The label will be immediately followed by a character that indicates the <em>operation</em> to perform: either an equals sign (<code>=</code>) or a dash (<code>-</code>).</p>
|
|
||||||
<p>If the operation character is a <em>dash</em> (<code>-</code>), go to the relevant box and remove the lens with the given label if it is present in the box. Then, move any remaining lenses as far forward in the box as they can go without changing their order, filling any space made by removing the indicated lens. (If no lens in that box has the given label, nothing happens.)</p>
|
|
||||||
<p>If the operation character is an <em>equals sign</em> (<code>=</code>), it will be followed by a number indicating the <em>focal length</em> of the lens that needs to go into the relevant box; be sure to use the label maker to mark the lens with the label given in the beginning of the step so you can find it later. There are two possible situations:</p>
|
|
||||||
<ul>
|
|
||||||
<li>If there is already a lens in the box with the same label, <em>replace the old lens</em> with the new lens: remove the old lens and put the new lens in its place, not moving any other lenses in the box.</li>
|
|
||||||
<li>If there is <em>not</em> already a lens in the box with the same label, add the lens to the box immediately behind any lenses already in the box. Don't move any of the other lenses when you do this. If there aren't any lenses in the box, the new lens goes all the way to the front of the box.</li>
|
|
||||||
</ul>
|
|
||||||
<p>Here is the contents of every box after each step in the example initialization sequence above:</p>
|
|
||||||
<pre><code>After "rn=1":
|
|
||||||
Box 0: [rn 1]
|
|
||||||
|
|
||||||
After "cm-":
|
|
||||||
Box 0: [rn 1]
|
|
||||||
|
|
||||||
After "qp=3":
|
|
||||||
Box 0: [rn 1]
|
|
||||||
Box 1: [qp 3]
|
|
||||||
|
|
||||||
After "cm=2":
|
|
||||||
Box 0: [rn 1] [cm 2]
|
|
||||||
Box 1: [qp 3]
|
|
||||||
|
|
||||||
After "qp-":
|
|
||||||
Box 0: [rn 1] [cm 2]
|
|
||||||
|
|
||||||
After "pc=4":
|
|
||||||
Box 0: [rn 1] [cm 2]
|
|
||||||
Box 3: [pc 4]
|
|
||||||
|
|
||||||
After "ot=9":
|
|
||||||
Box 0: [rn 1] [cm 2]
|
|
||||||
Box 3: [pc 4] [ot 9]
|
|
||||||
|
|
||||||
After "ab=5":
|
|
||||||
Box 0: [rn 1] [cm 2]
|
|
||||||
Box 3: [pc 4] [ot 9] [ab 5]
|
|
||||||
|
|
||||||
After "pc-":
|
|
||||||
Box 0: [rn 1] [cm 2]
|
|
||||||
Box 3: [ot 9] [ab 5]
|
|
||||||
|
|
||||||
After "pc=6":
|
|
||||||
Box 0: [rn 1] [cm 2]
|
|
||||||
Box 3: [ot 9] [ab 5] [pc 6]
|
|
||||||
|
|
||||||
After "ot=7":
|
|
||||||
Box 0: [rn 1] [cm 2]
|
|
||||||
Box 3: [ot 7] [ab 5] [pc 6]
|
|
||||||
</code></pre>
|
|
||||||
<p>All 256 boxes are always present; only the boxes that contain any lenses are shown here. Within each box, lenses are listed from front to back; each lens is shown as its label and focal length in square brackets.</p>
|
|
||||||
<p>To confirm that all of the lenses are installed correctly, add up the <em>focusing power</em> of all of the lenses. The focusing power of a single lens is the result of multiplying together:</p>
|
|
||||||
<ul>
|
|
||||||
<li>One plus the box number of the lens in question.</li>
|
|
||||||
<li>The slot number of the lens within the box: <code>1</code> for the first lens, <code>2</code> for the second lens, and so on.</li>
|
|
||||||
<li>The focal length of the lens.</li>
|
|
||||||
</ul>
|
|
||||||
<p>At the end of the above example, the focusing power of each lens is as follows:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>rn</code>: <code>1</code> (box 0) * <code>1</code> (first slot) * <code>1</code> (focal length) = <code><em>1</em></code></li>
|
|
||||||
<li><code>cm</code>: <code>1</code> (box 0) * <code>2</code> (second slot) * <code>2</code> (focal length) = <code><em>4</em></code></li>
|
|
||||||
<li><code>ot</code>: <code>4</code> (box 3) * <code>1</code> (first slot) * <code>7</code> (focal length) = <code><em>28</em></code></li>
|
|
||||||
<li><code>ab</code>: <code>4</code> (box 3) * <code>2</code> (second slot) * <code>5</code> (focal length) = <code><em>40</em></code></li>
|
|
||||||
<li><code>pc</code>: <code>4</code> (box 3) * <code>3</code> (third slot) * <code>6</code> (focal length) = <code><em>72</em></code></li>
|
|
||||||
</ul>
|
|
||||||
<p>So, the above example ends up with a total focusing power of <code><em>145</em></code>.</p>
|
|
||||||
<p>With the help of an over-enthusiastic reindeer in a hard hat, follow the initialization sequence. <em>What is the focusing power of the resulting lens configuration?</em></p>
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
\..../.....-...|........\.|...........-..........-......|....././..........\..|...............................
|
|
||||||
.../..|.......-............\...........-\|...............\.....|......-...........................-./.......|.
|
|
||||||
......../.-.-....\...\-.......................................|..........-.......\.....-.........|......|.....
|
|
||||||
....\........./..............|.............-..|.|.\.|.-......\........./..................|..........\........
|
|
||||||
...|/.|..........................-........................|............|-..|...../\................./.../.....
|
|
||||||
...|.|.......\...................|/..........\\....|....................-..................|..................
|
|
||||||
..................\-|..........|.\......|........\.....\...........................-..............\.....\.....
|
|
||||||
........./.-./..............................-..........|......|................/.............-......./...|./..
|
|
||||||
....-...\..........-......\...............-/.....................\.........-\.........|..........|.....|......
|
|
||||||
./............\......./..-......................../.|.-.|........................./.|......|...\.......-.-....
|
|
||||||
...........././.............|..........-....../..............-.....\.-......-.............................-..\
|
|
||||||
......................\.|.\..................-./.....\....|......................|..\...|.....................
|
|
||||||
...|.-...|.............../..//....-\...-.-...........|......-....\.|-.............\....-.|.............\......
|
|
||||||
......|.....\-....\.............|../..|......\....--................/....|..../|../.....-........../..........
|
|
||||||
.............|.........-.../.|....................\...........................................................
|
|
||||||
....\...\.-..-.....|.|...........-........./..../..........-.-....|....-..............-....|........|....../..
|
|
||||||
..........|..............\..|........../..........................|.....|\.-...........-......\....../........
|
|
||||||
...../.......|..../........-........|./\..\..\.\././.\.............--.......-..................\./......-.....
|
|
||||||
....................//...-..........-.............|................/............./.\....../...........-.......
|
|
||||||
.\-...|-/.......-........-...-...............\../...........................\/.....\...........\........|.....
|
|
||||||
.............................\-......|......\../......-..........|...........|.........-.....\..|......-......
|
|
||||||
./................/........-.......|..\..../|............................|...........|.-.|....................
|
|
||||||
.\.....|...............-\............|.................|...././.-...\..........|...........-...|...-.....\....
|
|
||||||
.......-..../.........\|.....................|....../..|/./|..........|.......|-.......\\./......-............
|
|
||||||
.....................\|......../-.............\...|...........................\.....\.\.......................
|
|
||||||
...|\.././...................|..................-.../\.-............\.-.........../............../.....\......
|
|
||||||
.......\..................\..|../...........................\....\....\..../...\..\\./.-....................|.
|
|
||||||
...............|./...\..........|...|....\........./......\...\.............\.\-......|......-...-........|..|
|
|
||||||
.........-...........................-...-............\...\.\.................................-....|./........
|
|
||||||
.-.|............-.....................-.................\..../......\....\....\....................|.......-..
|
|
||||||
.....\.|......|..../................|......|.....-...\|../................./...................//.............
|
|
||||||
.|.........\..../......-........-............--...................../........|.......\.....\..........-.......
|
|
||||||
../.....|.|............-.................|\.....|....||...-..-....|/......................|.|-..-..........||.
|
|
||||||
...-............|.-.............-.....................\.|.............\.\............\...|........|...../.\...
|
|
||||||
\...........................\.|................................................/.|......-.......\........../..
|
|
||||||
...................|....|.......|.-.............-..-\...-...............................|..................../
|
|
||||||
/...../.....\............../...........|..|./...-.../...............................\........../|.........\...
|
|
||||||
..-.......|.........../.......|......../.......\.............../..........-|..................................
|
|
||||||
...\.\........\............|......................\........|...\..............................................
|
|
||||||
../..........--........|....-..............\..\.............\...................-........./...../..-..........
|
|
||||||
..................|.................../\..-..|..................\....././..|......-.................../.......
|
|
||||||
-...\.............\..-..-.................../...|.|.........|../|./............/...../............../.........
|
|
||||||
.|\............................-....................|......./..............................|..-|...|.\........
|
|
||||||
-........../...-....-.......................|...\........|.......\................../.........................
|
|
||||||
........................................................././.|..|.........\................/|........\........
|
|
||||||
-.....\.........................|...........|..||..|......................................\...\....../.......|
|
|
||||||
....\...|........\.........................//...........|........-.........\..........\-.....\................
|
|
||||||
....|........|.........../........../....\........|......-../..............|...............|.........../......
|
|
||||||
......\................-...........|.................\...../........|................-........................
|
|
||||||
...............|......|...\............\............/.../.......-.-../............................\......|....
|
|
||||||
............-........-..../.......................\..-./.....\...................................-\.....|.....
|
|
||||||
...|...../......\...........\......\...\......./...........-../..|......................../...|...............
|
|
||||||
...........................-...../....-.....//................../..........-.......|.................|..-.....
|
|
||||||
................-...\.............\.../.../.\../...|.........-.\...../.................\.............../\...\.
|
|
||||||
.....-..................../......................................-...-............/...........|...-..........|
|
|
||||||
.........-..........\.\................-..\............................|...................-........./........
|
|
||||||
...............-....../.....\...|.........\.../\.......-......|............\-.................|...-..........\
|
|
||||||
.....\/......../../|......\......|.....--............|....../........-.../....-...-...........................
|
|
||||||
..../....\....|.............../..|........./............-.........................................../.........
|
|
||||||
.........../.................|....-..........................................................................\
|
|
||||||
...-.....-./....................\..../.\\.................-.....-....|..\.....-....|..........................
|
|
||||||
.....-..\..........|....|...........|.|....................................\.......-.../.../-.-........-.../..
|
|
||||||
............../......./...-.......-..|.......-|..........\..............-.-....|..............\...............
|
|
||||||
-........../.........|.......................\....-........../.........\.................../.............-....
|
|
||||||
.......-....\.....\..................\..../-.//.....-\..........|........................../....|.....\.......
|
|
||||||
..-./............./|..|........|...\\.........\...|......|.....\.........../.\......................\........\
|
|
||||||
...../|.......\............../....................|.............-...........|......|....../.........../....-..
|
|
||||||
.............-...-...|..\-.........................................|.......-.........|.........\..............
|
|
||||||
......|......|............/.........................|.............\.............../....................|..-...
|
|
||||||
../../|\......|..//....../......................................................./-...................../.....
|
|
||||||
.....-........-................-.............|.-./..............|...-...../......................../..../.....
|
|
||||||
...........\......|.............|....|.|.........../........|....................\.\......./..\.\..|..........
|
|
||||||
.\................/....................-..............................|...........\....\.......-....../.../...
|
|
||||||
...............|................-.....................................-..................\...............\....
|
|
||||||
..........|\..................../............................./...............-.....-....-..|................\
|
|
||||||
.................\.\...........................................-../......\.....-...............|...\..........
|
|
||||||
..|....\............................................./.........|...-\.........-...\..|..........\.............
|
|
||||||
..................................|...........-....-./-.\.-..................-............................./..
|
|
||||||
....................................\-.....\\...../..................-............-........../........-....\..
|
|
||||||
...........\......./...../|\..../-....|........|.|-.....-....|.....||.....|...........\..........\....|.-.....
|
|
||||||
...\..........\./..............-........................././..........\././...-...........-............-...../
|
|
||||||
\........\.....-..............................\................../.............-........................\..\..
|
|
||||||
.........../.\...............-.\...-.....\............\....\......--.....\...................................\
|
|
||||||
............\...............\.........\\....\....|......\.......-.................|...|....\.....\...\........
|
|
||||||
.....|.....-............../............-............../.............../...................-......\...........-
|
|
||||||
..........................-...|......\.....\.......\........-................./..........-......../.../...-/..
|
|
||||||
../........|....\........|..../...........|...-..|..........\............\..../........-................|.\...
|
|
||||||
..........-............./........................................-.......\.|/......./.................\.../.-.
|
|
||||||
......................\.........................../.../...../../.......|...................|............|.....
|
|
||||||
..............\..........-/........|/................................\...........................-............
|
|
||||||
........\....\....../.......|.-........\........-..\.................................|.....\-.................
|
|
||||||
........\......|.\.................-..-.../.............\..................|.../.-.............-/.............
|
|
||||||
.|/.............-.\.........................|...|./........-...........\../...............\./.......-......\..
|
|
||||||
..................-....|.....................-........|/.................\.........../..-.............../..\..
|
|
||||||
......-......-.........../......................-......./...../.../.|........\.../....../............\.....|..
|
|
||||||
...|../..................-.................\.....................\............-...........|.....|.|.........-|
|
|
||||||
..............................-...........|..-/.................|................................../..........
|
|
||||||
.../......../.............-./.............|...../......./...|...........\..............-..........-....|..-./.
|
|
||||||
/..\...|...........|...........................|/................../......./......................\.....\.....
|
|
||||||
..|.........-........|..|......-...................\.........|...........................-....................
|
|
||||||
../...-.....-.............../...|\...\.......|.................|.\.........-...................-\.........-./.
|
|
||||||
../..............................|.......|..............\...\......................\..........|...............
|
|
||||||
............/....|../....../.............-............................./......./.................\............
|
|
||||||
/.....\...../.........../.............../...-.../\.....|.....|............|....|..........\.....\..../........
|
|
||||||
....\....-/.........................|............-...........\........\...\.....\\................\........-/.
|
|
||||||
.....................-..-\...............././...........................\....-./......|..............\..-.....
|
|
||||||
................./........|.......-.-....................\.-.||...-.......\./.|./.....|...-.../......./.......
|
|
||||||
........-..-...../.......\.........................\.....././.\.../..|...../..................................
|
|
||||||
.............|...............--.........../.|\/.....\.........................|..|.....................-......
|
|
||||||
..........-...|.......\/...................|....../.-...-...|....................\..../.-...../..../..-.......
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 16: The Floor Will Be Lava ---</h2><p>With the beam of light completely focused <em>somewhere</em>, the reindeer leads you deeper still into the Lava Production Facility. At some point, you realize that the steel facility walls have been replaced with cave, and the doorways are just cave, and the floor is cave, and you're pretty sure this is actually just a giant cave.</p>
|
|
||||||
<p>Finally, as you approach what must be the heart of the mountain, you see a bright light in a cavern up ahead. There, you discover that the <span title="Not anymore, there's a blanket!">beam</span> of light you so carefully focused is emerging from the cavern wall closest to the facility and pouring all of its energy into a contraption on the opposite side.</p>
|
|
||||||
<p>Upon closer inspection, the contraption appears to be a flat, two-dimensional square grid containing <em>empty space</em> (<code>.</code>), <em>mirrors</em> (<code>/</code> and <code>\</code>), and <em>splitters</em> (<code>|</code> and <code>-</code>).</p>
|
|
||||||
<p>The contraption is aligned so that most of the beam bounces around the grid, but each tile on the grid converts some of the beam's light into <em>heat</em> to melt the rock in the cavern.</p>
|
|
||||||
<p>You note the layout of the contraption (your puzzle input). For example:</p>
|
|
||||||
<pre><code>.|...\....
|
|
||||||
|.-.\.....
|
|
||||||
.....|-...
|
|
||||||
........|.
|
|
||||||
..........
|
|
||||||
.........\
|
|
||||||
..../.\\..
|
|
||||||
.-.-/..|..
|
|
||||||
.|....-|.\
|
|
||||||
..//.|....
|
|
||||||
</code></pre>
|
|
||||||
<p>The beam enters in the top-left corner from the left and heading to the <em>right</em>. Then, its behavior depends on what it encounters as it moves:</p>
|
|
||||||
<ul>
|
|
||||||
<li>If the beam encounters <em>empty space</em> (<code>.</code>), it continues in the same direction.</li>
|
|
||||||
<li>If the beam encounters a <em>mirror</em> (<code>/</code> or <code>\</code>), the beam is <em>reflected</em> 90 degrees depending on the angle of the mirror. For instance, a rightward-moving beam that encounters a <code>/</code> mirror would continue <em>upward</em> in the mirror's column, while a rightward-moving beam that encounters a <code>\</code> mirror would continue <em>downward</em> from the mirror's column.</li>
|
|
||||||
<li>If the beam encounters the <em>pointy end of a splitter</em> (<code>|</code> or <code>-</code>), the beam passes through the splitter as if the splitter were <em>empty space</em>. For instance, a rightward-moving beam that encounters a <code>-</code> splitter would continue in the same direction.</li>
|
|
||||||
<li>If the beam encounters the <em>flat side of a splitter</em> (<code>|</code> or <code>-</code>), the beam is <em>split into two beams</em> going in each of the two directions the splitter's pointy ends are pointing. For instance, a rightward-moving beam that encounters a <code>|</code> splitter would split into two beams: one that continues <em>upward</em> from the splitter's column and one that continues <em>downward</em> from the splitter's column.</li>
|
|
||||||
</ul>
|
|
||||||
<p>Beams do not interact with other beams; a tile can have many beams passing through it at the same time. A tile is <em>energized</em> if that tile has at least one beam pass through it, reflect in it, or split in it.</p>
|
|
||||||
<p>In the above example, here is how the beam of light bounces around the contraption:</p>
|
|
||||||
<pre><code>>|<<<\....
|
|
||||||
|v-.\^....
|
|
||||||
.v...|->>>
|
|
||||||
.v...v^.|.
|
|
||||||
.v...v^...
|
|
||||||
.v...v^..\
|
|
||||||
.v../2\\..
|
|
||||||
<->-/vv|..
|
|
||||||
.|<<<2-|.\
|
|
||||||
.v//.|.v..
|
|
||||||
</code></pre>
|
|
||||||
<p>Beams are only shown on empty tiles; arrows indicate the direction of the beams. If a tile contains beams moving in multiple directions, the number of distinct directions is shown instead. Here is the same diagram but instead only showing whether a tile is <em>energized</em> (<code>#</code>) or not (<code>.</code>):</p>
|
|
||||||
<pre><code>######....
|
|
||||||
.#...#....
|
|
||||||
.#...#####
|
|
||||||
.#...##...
|
|
||||||
.#...##...
|
|
||||||
.#...##...
|
|
||||||
.#..####..
|
|
||||||
########..
|
|
||||||
.#######..
|
|
||||||
.#...#.#..
|
|
||||||
</code></pre>
|
|
||||||
<p>Ultimately, in this example, <code><em>46</em></code> tiles become <em>energized</em>.</p>
|
|
||||||
<p>The light isn't energizing enough tiles to produce lava; to debug the contraption, you need to start by analyzing the current situation. With the beam starting in the top-left heading right, <em>how many tiles end up being energized?</em></p>
|
|
||||||
|
|
||||||
<p>Your puzzle answer was <code>8901</code>.</p><p class="day-success">The first half of this puzzle is complete! It provides one gold star: *</p>
|
|
||||||
<article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>As you try to work out what might be wrong, the reindeer tugs on your shirt and leads you to a nearby control panel. There, a collection of buttons lets you align the contraption so that the beam enters from <em>any edge tile</em> and heading away from that edge. (You can choose either of two directions for the beam if it starts on a corner; for instance, if the beam starts in the bottom-right corner, it can start heading either left or upward.)</p>
|
|
||||||
<p>So, the beam could start on any tile in the top row (heading downward), any tile in the bottom row (heading upward), any tile in the leftmost column (heading right), or any tile in the rightmost column (heading left). To produce lava, you need to find the configuration that <em>energizes as many tiles as possible</em>.</p>
|
|
||||||
<p>In the above example, this can be achieved by starting the beam in the fourth tile from the left in the top row:</p>
|
|
||||||
<pre><code>.|<2<\....
|
|
||||||
|v-v\^....
|
|
||||||
.v.v.|->>>
|
|
||||||
.v.v.v^.|.
|
|
||||||
.v.v.v^...
|
|
||||||
.v.v.v^..\
|
|
||||||
.v.v/2\\..
|
|
||||||
<-2-/vv|..
|
|
||||||
.|<<<2-|.\
|
|
||||||
.v//.|.v..
|
|
||||||
</code></pre>
|
|
||||||
<p>Using this configuration, <code><em>51</em></code> tiles are energized:</p>
|
|
||||||
<pre><code>.#####....
|
|
||||||
.#.#.#....
|
|
||||||
.#.#.#####
|
|
||||||
.#.#.##...
|
|
||||||
.#.#.##...
|
|
||||||
.#.#.##...
|
|
||||||
.#.#####..
|
|
||||||
########..
|
|
||||||
.#######..
|
|
||||||
.#...#.#..
|
|
||||||
</code></pre>
|
|
||||||
<p>Find the initial beam configuration that energizes the largest number of tiles; <em>how many tiles are energized in that configuration?</em></p>
|
|
||||||
@@ -1,141 +0,0 @@
|
|||||||
545452221113224242466233542635423355626253426445443455757673665557347647355656433643746353634644662254525636256443646245624542442323123124434
|
|
||||||
423123553224156354662663652662565323453542525447336537477575644434676433736577536377777334455463373535224645325663632555343244432114515143455
|
|
||||||
412533154242243224353222366252356526355257367576363643744576774435663654744573466766563337774647645676664423643264353633522462246212343543534
|
|
||||||
312324515521642422652636445534644554523665356655534343537375547744446437364446564476574363354465364444335526246456466465534642522545221525355
|
|
||||||
431513132425342544645256323442532642676557544454577773477553376746647356735654457637736466555435447757676662446326565224355645426536544353433
|
|
||||||
152515313256642445666534554544332644373336536336456577474544746374336345737444775367547736546647553566343437636426552263525243344634253243155
|
|
||||||
135443325556463563643622655423352436666776776734633546375567453734754553445667477777766555547773656573443454755625255564266524452554644145234
|
|
||||||
241513543232556336524232462424435737746743746575776755464666467353446767477357654573667646735353777447336743456434254233635466225242632525121
|
|
||||||
442114466425542236636355532623577635665736777673573577436763575554353467744376756337466776666746547776573643366373454532562525346426364521212
|
|
||||||
541155622643423523354262433657364363646354575667566357546477534336746476674745444646634665776653773333473375747756253522266653336465444335443
|
|
||||||
315134623523366526522266354747643547566373676536336653534764337367777657666544734333553663574737675665473765764555363545425566323646362446212
|
|
||||||
353142355424432653444565325346456566644744764673467744633777464737845775474776766376767444574545433637456635633567664644636222333626546663624
|
|
||||||
315262562366632565525535545577665554665674353536337736534348577475484854557474447578374345363774654336434544754674634746633244226523442264433
|
|
||||||
335545645535423623266436675456635746457674747674657776647557877646646675874757745664876653556564444533753335375443577665252425255534456546245
|
|
||||||
553355652652264636363367377346645567667346557653434567688677545486848565546546665444456784473354343544647657374633433333555233425565253533356
|
|
||||||
243333363523322443663544336473347367764656335567475568787767645554484767666557847484654575478446467365374457346344653755573346552525256565322
|
|
||||||
666223435352636335653467647754757343776765635446446788867658547858868785684748487568855845688555756333373536554535476756744646434652424342333
|
|
||||||
645455232354462344243445636673564336664747664878865467785568865677886748754847884644784467558578757766455653753346354754754655533565264232532
|
|
||||||
466264662434546564673354575575444753656373744566465676768746765458687768457555786448878877475448775543545436357333657537436536626255346662656
|
|
||||||
654524643332325657443773473345666645437437457786476648665876645875844657466548548677668648768478465858346357657453545354733536252225236325324
|
|
||||||
245235543533534454757574456473757344733876884576864756557877774546778774555757444877858775558546876676464645537473477737556335324623665264554
|
|
||||||
552235662634536547455366376357656336444664848888574766754875756656755876868444465858655555676566668664686665663544655356774567736546326366635
|
|
||||||
353542423524446556643335547536347646576756685775676766655557774844768557867884484585678554847845646654865854437565545635345436754335643323263
|
|
||||||
326635253342553646346557637354574467764875575745775547574584574755667545768464448746656755546475444547874465334763664737345747437656333254563
|
|
||||||
653335566256277556643667467346775367576846755455468867867557557555887765578448878848456454866856764644668486873436476677765536767642445626356
|
|
||||||
353255366565746364356754435755657577566867745558644476548588748884548574488784666876485787774565875677468876756676547447547545755532634442565
|
|
||||||
526256464444756734475435756673776484768854466755657745844446568666657957857746556588454768855565754764675454455437656334744533657457623236224
|
|
||||||
345546363576475673635365446743587548544658648758765765475847775665595995997557889547584448655877685856876666444644644334674665743567346233266
|
|
||||||
533654332435774354776646364446474846575477447574584776856576779765587966968987698878988545587567868486876764888877575753575453556376745642566
|
|
||||||
633636424573637734764776635667487684676748668665568566866889869557556755989955889797856987487464457458644645786764873746476745365753365432463
|
|
||||||
436434525766744544555467765487678745586567856888558789667967898667788975588775596575969899765767668556484474454574865565553453736343757423566
|
|
||||||
562564353763677646656565447585778775865488767878759868968558979588977867688659588986697765665477854856584885664466675345566465573666456355365
|
|
||||||
232544366666336545573336765565884686888688676464687896586586865697669996659769557995958979656645555844656646558777648564373757645766465564263
|
|
||||||
325226433577434645734663776868484484574546847759659798668887755976978658579669665775876995696766765667567564857767757436736433534574356375464
|
|
||||||
233434647657566365675564855678657456764555868565669776899967977985978785677658977569987558877878886856748745484877655877536777645733565672553
|
|
||||||
346247373476565353376638555656666547878646777776699966987887775565755667655885557989588579667655656868844566557565885884763657647737363335464
|
|
||||||
532243475547755575777345844444764678745788878877675956599689759687889958677777568677756559957698788764847454855744856566777557736766676435464
|
|
||||||
262676537574457653774457566747874566475585789698955597778655878869799695678789958999766885657857566894858485757754485588476476734355556634663
|
|
||||||
554273745665445654454755465755788884874769777895865665659996575789596765989769785679566759565995579779754867476767446844747337344367377354722
|
|
||||||
223443465575665667345468464778664565646768567659578566988667856788688568878858975798856895758586987665776878777467678677846363447364466655752
|
|
||||||
356675376476767636478486488564575777675577587995586676557599976687578955896587568597887786867768768799584654454457787674446666776457355366334
|
|
||||||
446346746755447335376878747444548484767989866757676988577659767879598868996657877558889985695985588655575884455566754554678576776575736753747
|
|
||||||
554354566643337445757665664854558565869858866656857656695755689989897768888898967697656665688856899957759956444477448748884634353575536635376
|
|
||||||
534454344735356453685855755866568857866855877775658577698557768996777867979869796665786759779765759587979888785478444554847485657467766647545
|
|
||||||
443436776547774645468645577867656488896978758777798895598889679866888688869967986666655558857856758797976585648874675868764677345555644357543
|
|
||||||
257746743747434447467858858468464667666857679685959656776766788988696989987877767689978775665995977695959698477585465847875658656777474576447
|
|
||||||
645547747335346637656657768676586568997777755987596665968768787877997778697867879896899888669887779959895769844445545565666568367653644677547
|
|
||||||
553466736466736684746886666654678758976976679578775799668666689897777666887669787796967877596969796967796888966448555755588488566576673775433
|
|
||||||
776446577567576687686786446648658876958999656689977798667789899869887868779686996797769789857565999575769965795557567748557544647767643763474
|
|
||||||
445356637656674775556644475678659975969567657958685979868977878989668969687788668968878769775976789797698975665486687555884857456546534543563
|
|
||||||
463645333465775785746547746866865768899858897765787788669686689668888676768786776797687678987958668775876759975857585586487667853553464535457
|
|
||||||
564477673374747676645744768548578875768658857689997867667699686677789987896686787796899786989869758579587756857588556884768666757763734637656
|
|
||||||
753556345564735887488486654567965956577557956858677778979967788997886678979888678999679867786776689598666566999857586845478647775545436555553
|
|
||||||
345365637574455675565456864445579975865657859877896789776886696797878887676788766779699976687768989758796767975696688486546867688535773437576
|
|
||||||
563643757353635744777558764668598788688667657587699768679877688999788976678779987678888899988696779888988599798896845755458568487466666645664
|
|
||||||
543444466456568748754448767568587899956585778776877666796699889797797698667887698787866798988969666759756886776686778745884658447476754743675
|
|
||||||
775555364536476764685787847556888796868878858669787979898869969899798699976896877676666868866868676677787775667578585574574466774833577574646
|
|
||||||
634564673656787575774464768665888587665968667897896986988997878998889897878779887897997869989668679679957889756995447574784558575577733545643
|
|
||||||
577736376747365476448748478477796768757799598789868889798968776688779897897789868968889799788966888869898975668865987448565667558857736635643
|
|
||||||
466345746537546444778477645588885858759799788669769866667686687799778787887998988778696998968788686886759968759855878458545755745583464766353
|
|
||||||
367655547534675485475587886859656798596775967889999876777668999898997779779999977967889897689698666959958577896968754558887878487466364554457
|
|
||||||
653764635533546656444544748669777855769689666767996998967768787987877997777789877879797669966789688659586895965976884575646866457567553356675
|
|
||||||
446653547537785576645688746776557769889589679688779797969868988999887999799878887798996677697677978795956576655686964586475875475887577735776
|
|
||||||
344564775776467555666785757659665856977858698769987778997678797998997999999897899987886899987688889897695889685799576867746777467646546576365
|
|
||||||
654736333377688685576656654998969878958759867686996898766689989879877978777889778787868686788887869786797867597879898644784877645754354536375
|
|
||||||
767747647435455487886768675697877659896578787788669769779799998887879887889788888997789687686768666868776559656566955647588756888764347454776
|
|
||||||
774457766435866645686575458679965688767955998897969876799898877798778987778797797888997778868978867995859657556696594555667474878485536473347
|
|
||||||
366445576358856847557447789956599979755857769987889697967987878888879779878778977978986998889968887667768699579866588587785767748754376363554
|
|
||||||
766344743577475764568847579997598855976966669699688996999998987878789798788998777778898668697689869778596566556756677764576558674474576657474
|
|
||||||
736745557656466465485456767695967885795567669968688899788877778797997779788799999888779699767799986898695888998859665878677555646544465653554
|
|
||||||
577753734565685574848584466665798865998576787897887876898999799789897997898988879777977976686779986687656986997797786567785888786465457333447
|
|
||||||
543537356746774554476444747757978996777959898679879879898977897778987978898988989978978897768898866666796995878796566477765667684545335437676
|
|
||||||
437766576438547766556675687655968789988677789998678687769788997898888998987997777989979796877677699676678769556989886464447864567655446374465
|
|
||||||
774667644357778464657467446768777587599896669768898996799998899788777877898778789789886686796669799666668777585998986876745458765677776336474
|
|
||||||
673456737734575477884884555698977778886667898889798678889979888778788778978887888777789669779686678965957559675775777488875554667477337777664
|
|
||||||
665743475468848468864485465868588566687856668986879966888979797778988898997999899999898796978989787969699597586995555564868557476684777756734
|
|
||||||
646554756444674645545745554559686885658675878898988999988988999789988998987879997879776797879869887967979579868767585566467556584857466573677
|
|
||||||
364764647433677788866778744599756867979797699869867787666678777898999787898989797789767698987787689975759897675779695758585566676486736437565
|
|
||||||
535657367676788744488555688866567598959667976889768897689998888978878888799897997777877889778777976969959559979798875545858676548565476756446
|
|
||||||
633363763563454644784858847895797557969965876677987878976787878779988997777977799998877787677976867878977587865957557486665588466457543463635
|
|
||||||
375433566546784568846466745598558655679968776668798787899889779877878988779887997778797888678778996867596666657866874675645464786473443555447
|
|
||||||
434655743646446455646846467678988778555555686866869776667867788797877999888887888976676979997998988976998588698965984485774787566574577553376
|
|
||||||
757663464775848684556667686775675566755668979679877689867998687897999788888899797969769667797686789969697795968885567685786664865545733646333
|
|
||||||
436536333433585884585488446757557568878876857999666686869666787778897988977877887686867777689966698889899988598867685787566778656564477735445
|
|
||||||
436574534734348886888756757498889965758885899878987888866677979798879779777899977868767868996877788995778656675966566755867567565574633456555
|
|
||||||
564764653563688455554454885545886885979986956966688986677768987888887788888986967968696889979678777755778658995959858577865848685846647676536
|
|
||||||
774666566543587578854654454459798858796687579678788997996798879976879988877696966976978868687797675777579588669865747866555654646757563764356
|
|
||||||
334653746666747767874888446759658578686597896567669986768687786769869666679968799886689699667888658865797857988986544445767866746843445663555
|
|
||||||
775344654767678685848468464575877876687899677597996789798676698776979787769968688886967768966777857569696867798987665668774554657436543557567
|
|
||||||
766543343765565746568886858757686865568578796657979967896798688987979798966679878979878987979679598685776666567766775448885878555657665547357
|
|
||||||
636655364436434455888845888778685568678599896776668766887767676667867787968869876966876666689866987776969877858886687745584764557354464333464
|
|
||||||
675765663744534578545687478578698557858656798867678988867967999777996889699687796687898679786896785675995877868655448555846488877754667477734
|
|
||||||
376666657777454776866467685478859857875585897867777886776668979799679889766696977797676899977576857679985779975754888884877866665753763656567
|
|
||||||
553656636455355675644444444747459698859777767998579698866968997767787668988968899867897668767998695767758686979684446467848778567374445455366
|
|
||||||
754746745637544445664687865676568868689986785689987697689689969698679786996868877777898786786677866785998778985766777464665886563347736757447
|
|
||||||
744657466646636774744445554675666676868675955555767858786996667879668878978868776888798796869879978857865577996565788644766846855557536433763
|
|
||||||
446745655755373767857866885858587788668877866696695565989667697677966767697869689788978969797665869856666577584454657576664775376733565354756
|
|
||||||
654636755367566664586687484447778479787695578876796699778799789899898676987968866887987986956877768755999996846745684654755648755434654444754
|
|
||||||
635344556537573455855776668478688447578999955979699999695669968667779887688976668788756786965858995755576656777877658545555555647667534575366
|
|
||||||
435747556465374336665458878467447445675959779776975698666756899678787988689897869778795885896759756577958888884545566466868655534765435574357
|
|
||||||
437767766643564433747554467577668757587776755668689999998555765778667999677696988696955786556876667667988974746747864478454737537664677453677
|
|
||||||
664347635467563437656868568685484468455677569986876985879577699879986797878559965665568857786598876697898847446667476764656445454547563774635
|
|
||||||
335453357433477464545778558588687458646696878686798565588759596859598855679658897766897786687897896866587457546877768774845653576735343735752
|
|
||||||
655777543774646674548678844477675556474688567958786967887956958887675987768675555986588965589688887889886444888584878476586567343575354445663
|
|
||||||
235453363477465436646567678856678577655849767566798556879779898997989755658656559688876996696676858559457557464577456788673465676535365674745
|
|
||||||
653557535667556645354467867774587468586488865599677669989755886567678697988757889697878875858955878776457675775448445776473464477477767663723
|
|
||||||
423647457774664567367567688588786455886875877685666999576569666558878966575579888958887568875959897748876746485847657558833665657763667534445
|
|
||||||
642244736374347334553476484454457886864876777558556996776685999679967876675775769557785885758655565867454657858447768578474753663535574334625
|
|
||||||
336436733375445675473664646565856555648864767887656769899695675757975675565687699957587897798858758888587654455645575843733477364463637346554
|
|
||||||
335435534663443676666667487578676657684784777487588895569858889859686655956678559995599665976775765566474568674477774565755333637557456443362
|
|
||||||
544553574555543574737357456786577646746577857444859685759965869665959565775665768787565556566764745674557877684464784337435554455363447424542
|
|
||||||
532466367673434664644354657754588778676755775886768666885868799568878785557855988668678578786766445778646767754547786674353344647665577622636
|
|
||||||
254546266574455447676333746874647468845746684454766755965578588856776657996755995866665756584754744857764888446555686474747766466477373363255
|
|
||||||
266564352377575777574547445766866788765476854777647777755855596796559556988877659996958566787777584545576775754474473767554467654656553554332
|
|
||||||
522256355666446675564456747738664767486874667675476687786478896698989959668656659687968467645876545646468576457566664435353565756335325455423
|
|
||||||
444323436545645543755363664545566464457866856586678787858786757778956969568579798946747584467867878657848746487767644665534735673753556344635
|
|
||||||
323454432324636457364755566663657568465848475587778876786656855775678985985658687848774858847777567884787865845753573673347657574545444662333
|
|
||||||
634265532422373635667776375763433576454587888546578776578558775467647857865566478665585765455686464585664454657577753367736355637473456622255
|
|
||||||
622652422623346667557377766536775386775555647476757786588468585876875775475874454678454778445754858785856648473657737554774554374752234543644
|
|
||||||
626444363465537553657447547553534338748756846655465484858676444775654756856447485566556646575845685575686466474566556633663543776752343555663
|
|
||||||
535442263436653363546357777754675735775658785476758746846756747484788667788686756847555568587746787644556655745755367533554735377434563655355
|
|
||||||
554342625636334436643667447345746337765466846668685587767846687654478458468576565878864858748845754784458634476773434474546454344452263624345
|
|
||||||
565345336254245667667673464644643655375486646848574888844888558867884754554747767566586664467557686445654336335375474476363464323325434436625
|
|
||||||
332442354652352554553756635666445463456537777656657588588744485464885685786874588448866685887758677684775654736344634537577646434553463233633
|
|
||||||
264423644454226544363333743363353543453764748557767447766744574745865865746448687884547865745856555847664474444567466455356545323344624233336
|
|
||||||
624364424324325525254434475736744543756757746455757545887885684854876555585578764754564576867554753746356355666473343373737424256554255423523
|
|
||||||
662433222232665256245775334733557673537364464544457667464687655758776565487564647678487555685857676544475746676457447467754565543233223432355
|
|
||||||
335526225663422356565753436745336336337473673334447858766557576685575848668868544646668474687675476677666534474734376777532524234366425532456
|
|
||||||
224434544223322234353647375646454645545464356533655787476846747488548474786866778666778547634433667755755733766475767655364426634454342243225
|
|
||||||
115343665234633546565263376447534744657646576367346453768575867668478755786458868487856743347563663553647377756353665654344434266256634336435
|
|
||||||
542522653445666245465264554744743545554757337454635474734676576664554868545884455857744457443343774776545543664436646636526654445346625264641
|
|
||||||
212345454243326345366432525643537663566453477653467557566745535745888465744676443367676664343457436353346547364465644462456633524632446434245
|
|
||||||
152256444334346664644636266764544353565677537647674477765463657665645367433374777437633774465675755553674563647647452223353432253226324623542
|
|
||||||
543314543643455255443324653447436466475546347473733756375574455574647736546663676737753633747536667644363433373577625266565562536523653263531
|
|
||||||
323324156556533366424334223663556664354675665737455445654473743546365645433344367436563477354677564675374746774552632626523436564364436333125
|
|
||||||
235252143234364223446642636543224575373637463676356753733454753456563336535346777535556775743565435544465673644434525462634226464524365541444
|
|
||||||
132152313563645443345466655333626644763757433545675545554636757343657777557575474647543744454353557547677667745433252345352224344346244251442
|
|
||||||
145324252553642322332363652223266265665333337557545545565467373344435373577653536363764744455463574577733745442455342654643644622632454545141
|
|
||||||
532551554325522544422365464343624222657554543453736435733353775644654357356557335773453777745644576533447446326624326254632635265444511254421
|
|
||||||
231415354245432533366263463246653334334533336463333665345436677477356745734756355353637773745467756534536353223454622442252244524633251135155
|
|
||||||
115313455335154364554632663442562633255536347755433457547673466773633747543655343555654635633737643533463222323433222456626424343225333455422
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 17: Clumsy Crucible ---</h2><p>The lava starts flowing rapidly once the Lava Production Facility is operational. As you <span title="see you soon?">leave</span>, the reindeer offers you a parachute, allowing you to quickly reach Gear Island.</p>
|
|
||||||
<p>As you descend, your bird's-eye view of Gear Island reveals why you had trouble finding anyone on your way up: half of Gear Island is empty, but the half below you is a giant factory city!</p>
|
|
||||||
<p>You land near the gradually-filling pool of lava at the base of your new <em>lavafall</em>. Lavaducts will eventually carry the lava throughout the city, but to make use of it immediately, Elves are loading it into large <a href="https://en.wikipedia.org/wiki/Crucible" target="_blank">crucibles</a> on wheels.</p>
|
|
||||||
<p>The crucibles are top-heavy and pushed by hand. Unfortunately, the crucibles become very difficult to steer at high speeds, and so it can be hard to go in a straight line for very long.</p>
|
|
||||||
<p>To get Desert Island the machine parts it needs as soon as possible, you'll need to find the best way to get the crucible <em>from the lava pool to the machine parts factory</em>. To do this, you need to minimize <em>heat loss</em> while choosing a route that doesn't require the crucible to go in a <em>straight line</em> for too long.</p>
|
|
||||||
<p>Fortunately, the Elves here have a map (your puzzle input) that uses traffic patterns, ambient temperature, and hundreds of other parameters to calculate exactly how much heat loss can be expected for a crucible entering any particular city block.</p>
|
|
||||||
<p>For example:</p>
|
|
||||||
<pre><code>2413432311323
|
|
||||||
3215453535623
|
|
||||||
3255245654254
|
|
||||||
3446585845452
|
|
||||||
4546657867536
|
|
||||||
1438598798454
|
|
||||||
4457876987766
|
|
||||||
3637877979653
|
|
||||||
4654967986887
|
|
||||||
4564679986453
|
|
||||||
1224686865563
|
|
||||||
2546548887735
|
|
||||||
4322674655533
|
|
||||||
</code></pre>
|
|
||||||
<p>Each city block is marked by a single digit that represents the <em>amount of heat loss if the crucible enters that block</em>. The starting point, the lava pool, is the top-left city block; the destination, the machine parts factory, is the bottom-right city block. (Because you already start in the top-left block, you don't incur that block's heat loss unless you leave that block and then return to it.)</p>
|
|
||||||
<p>Because it is difficult to keep the top-heavy crucible going in a straight line for very long, it can move <em>at most three blocks</em> in a single direction before it must turn 90 degrees left or right. The crucible also can't reverse direction; after entering each city block, it may only turn left, continue straight, or turn right.</p>
|
|
||||||
<p>One way to <em>minimize heat loss</em> is this path:</p>
|
|
||||||
<pre><code>2<em>></em><em>></em>34<em>^</em><em>></em><em>></em><em>></em>1323
|
|
||||||
32<em>v</em><em>></em><em>></em><em>></em>35<em>v</em>5623
|
|
||||||
32552456<em>v</em><em>></em><em>></em>54
|
|
||||||
3446585845<em>v</em>52
|
|
||||||
4546657867<em>v</em><em>></em>6
|
|
||||||
14385987984<em>v</em>4
|
|
||||||
44578769877<em>v</em>6
|
|
||||||
36378779796<em>v</em><em>></em>
|
|
||||||
465496798688<em>v</em>
|
|
||||||
456467998645<em>v</em>
|
|
||||||
12246868655<em><</em><em>v</em>
|
|
||||||
25465488877<em>v</em>5
|
|
||||||
43226746555<em>v</em><em>></em>
|
|
||||||
</code></pre>
|
|
||||||
<p>This path never moves more than three consecutive blocks in the same direction and incurs a heat loss of only <code><em>102</em></code>.</p>
|
|
||||||
<p>Directing the crucible from the lava pool to the machine parts factory, but not moving more than three consecutive blocks in the same direction, <em>what is the least heat loss it can incur?</em></p>
|
|
||||||
|
|
||||||
<p>Your puzzle answer was <code>1246</code>.</p><p class="day-success">The first half of this puzzle is complete! It provides one gold star: *</p>
|
|
||||||
<article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>The crucibles of lava simply aren't large enough to provide an adequate supply of lava to the machine parts factory. Instead, the Elves are going to upgrade to <em>ultra crucibles</em>.</p>
|
|
||||||
<p>Ultra crucibles are even more difficult to steer than normal crucibles. Not only do they have trouble going in a straight line, but they also have trouble turning!</p>
|
|
||||||
<p>Once an ultra crucible starts moving in a direction, it needs to move <em>a minimum of four blocks</em> in that direction before it can turn (or even before it can stop at the end). However, it will eventually start to get wobbly: an ultra crucible can move a maximum of <em>ten consecutive blocks</em> without turning.</p>
|
|
||||||
<p>In the above example, an ultra crucible could follow this path to minimize heat loss:</p>
|
|
||||||
<pre><code>2<em>></em><em>></em><em>></em><em>></em><em>></em><em>></em><em>></em><em>></em>1323
|
|
||||||
32154535<em>v</em>5623
|
|
||||||
32552456<em>v</em>4254
|
|
||||||
34465858<em>v</em>5452
|
|
||||||
45466578<em>v</em><em>></em><em>></em><em>></em><em>></em>
|
|
||||||
143859879845<em>v</em>
|
|
||||||
445787698776<em>v</em>
|
|
||||||
363787797965<em>v</em>
|
|
||||||
465496798688<em>v</em>
|
|
||||||
456467998645<em>v</em>
|
|
||||||
122468686556<em>v</em>
|
|
||||||
254654888773<em>v</em>
|
|
||||||
432267465553<em>v</em>
|
|
||||||
</code></pre>
|
|
||||||
<p>In the above example, an ultra crucible would incur the minimum possible heat loss of <code><em>94</em></code>.</p>
|
|
||||||
<p>Here's another example:</p>
|
|
||||||
<pre><code>111111111111
|
|
||||||
999999999991
|
|
||||||
999999999991
|
|
||||||
999999999991
|
|
||||||
999999999991
|
|
||||||
</code></pre>
|
|
||||||
<p>Sadly, an ultra crucible would need to take an unfortunate path like this one:</p>
|
|
||||||
<pre><code>1<em>></em><em>></em><em>></em><em>></em><em>></em><em>></em><em>></em>1111
|
|
||||||
9999999<em>v</em>9991
|
|
||||||
9999999<em>v</em>9991
|
|
||||||
9999999<em>v</em>9991
|
|
||||||
9999999<em>v</em><em>></em><em>></em><em>></em><em>></em>
|
|
||||||
</code></pre>
|
|
||||||
<p>This route causes the ultra crucible to incur the minimum possible heat loss of <code><em>71</em></code>.</p>
|
|
||||||
<p>Directing the <em>ultra crucible</em> from the lava pool to the machine parts factory, <em>what is the least heat loss it can incur?</em></p>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Paste any inputs into this file.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
# Day 18 Puzzle Text.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Paste any inputs into this file.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
# Day 19 Puzzle Text.
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
Game 1: 3 blue, 7 green, 10 red; 4 green, 4 red; 1 green, 7 blue, 5 red; 8 blue, 10 red; 7 blue, 19 red, 1 green
|
|
||||||
Game 2: 6 red, 10 green; 11 green, 4 red; 16 green, 2 blue; 7 green, 5 blue, 4 red; 17 green, 1 red, 1 blue
|
|
||||||
Game 3: 5 red, 9 blue, 1 green; 5 red; 11 red, 2 green, 8 blue; 2 green, 6 blue
|
|
||||||
Game 4: 2 red, 5 green; 2 blue, 3 red, 3 green; 3 red, 2 blue; 8 green, 2 red
|
|
||||||
Game 5: 12 red, 13 blue; 13 blue, 2 green, 9 red; 9 blue, 1 red; 2 green, 12 blue; 1 green, 1 red, 11 blue
|
|
||||||
Game 6: 4 blue, 11 red; 4 red; 1 green, 7 red; 1 green, 1 blue; 8 blue, 10 red; 1 green, 2 blue, 8 red
|
|
||||||
Game 7: 7 blue, 15 red, 1 green; 5 green, 17 red, 7 blue; 5 blue, 1 green; 11 blue, 2 green, 17 red; 14 green, 9 red, 2 blue; 6 blue, 19 red
|
|
||||||
Game 8: 13 green; 5 green; 3 blue, 9 green, 1 red; 4 red, 11 green, 4 blue
|
|
||||||
Game 9: 4 green, 1 red, 1 blue; 4 green, 7 blue, 7 red; 9 blue, 4 red; 2 blue, 8 red, 5 green; 6 blue, 2 green; 5 red, 5 green, 10 blue
|
|
||||||
Game 10: 1 green, 5 blue, 3 red; 4 green, 9 red, 3 blue; 11 red, 2 green, 5 blue; 3 green, 1 blue, 2 red; 6 red, 2 blue
|
|
||||||
Game 11: 2 red, 6 green, 12 blue; 2 red, 9 blue, 1 green; 12 green, 3 blue
|
|
||||||
Game 12: 1 red, 1 blue, 12 green; 6 green, 2 red, 1 blue; 6 red, 6 green, 1 blue; 3 green, 6 red
|
|
||||||
Game 13: 5 red, 19 green, 3 blue; 6 red, 7 blue, 11 green; 8 blue, 6 red; 3 blue, 4 green, 4 red; 8 red, 15 green, 5 blue; 5 blue, 2 red, 10 green
|
|
||||||
Game 14: 5 blue, 9 green; 4 green, 6 blue; 14 green, 1 red, 4 blue; 3 blue, 3 green; 2 green; 5 blue, 7 green, 1 red
|
|
||||||
Game 15: 5 red, 8 blue; 9 blue, 3 red; 5 red, 1 green, 16 blue; 1 blue, 3 red, 2 green; 5 red, 2 green, 10 blue
|
|
||||||
Game 16: 6 blue, 9 green, 10 red; 8 blue, 9 red, 14 green; 7 green, 1 blue, 1 red; 8 red, 5 green, 8 blue; 10 red, 5 blue, 14 green; 7 blue, 11 red, 3 green
|
|
||||||
Game 17: 12 blue, 12 red, 6 green; 14 green, 17 blue, 4 red; 11 blue, 1 red, 13 green
|
|
||||||
Game 18: 7 blue, 2 green, 4 red; 1 blue, 2 green, 4 red; 2 red, 17 blue
|
|
||||||
Game 19: 3 red, 9 green; 8 red, 2 blue, 2 green; 3 blue, 15 green, 11 red; 18 green, 3 red, 1 blue
|
|
||||||
Game 20: 5 green, 5 red, 16 blue; 8 blue, 6 green, 4 red; 10 red, 11 blue; 5 red, 5 blue, 5 green
|
|
||||||
Game 21: 1 red, 3 blue, 14 green; 6 red, 6 blue, 17 green; 12 green, 17 blue, 3 red; 15 green, 1 red, 19 blue; 3 red, 18 blue, 4 green
|
|
||||||
Game 22: 15 blue; 11 blue, 2 red, 1 green; 1 green, 7 red; 1 red, 18 blue, 1 green; 16 blue; 3 red, 6 blue
|
|
||||||
Game 23: 11 blue, 6 green, 4 red; 9 green, 11 red, 8 blue; 5 green, 5 red, 2 blue; 11 green, 4 blue, 11 red; 3 green, 9 blue, 2 red
|
|
||||||
Game 24: 7 green, 2 red; 8 red, 1 blue, 15 green; 3 red, 6 green, 6 blue
|
|
||||||
Game 25: 9 blue, 9 green; 3 green, 7 blue, 1 red; 6 green, 1 red, 1 blue; 6 green, 1 red, 1 blue
|
|
||||||
Game 26: 1 green, 15 blue, 1 red; 1 red, 12 blue, 1 green; 16 blue; 5 red, 11 green, 14 blue; 6 green, 4 red, 14 blue
|
|
||||||
Game 27: 14 red, 9 green; 11 red, 5 green, 6 blue; 1 red, 6 blue, 9 green
|
|
||||||
Game 28: 6 green, 1 blue, 9 red; 1 green, 9 red; 7 red; 11 red, 1 blue, 2 green; 8 red, 10 green; 6 green, 1 blue, 5 red
|
|
||||||
Game 29: 1 red, 19 blue, 3 green; 9 blue, 1 red; 8 green, 17 blue; 11 blue, 4 green
|
|
||||||
Game 30: 7 blue; 5 blue, 1 red, 1 green; 3 blue, 1 red
|
|
||||||
Game 31: 9 red, 2 green, 1 blue; 5 red, 1 green, 3 blue; 2 green, 7 red; 2 green, 12 red
|
|
||||||
Game 32: 1 red, 1 blue, 17 green; 14 blue, 10 green, 6 red; 12 green, 11 blue, 3 red
|
|
||||||
Game 33: 2 red, 1 green, 3 blue; 7 blue, 4 green; 1 red, 3 green, 5 blue
|
|
||||||
Game 34: 9 blue, 1 green, 9 red; 12 blue, 2 green, 12 red; 3 blue, 12 red; 2 green, 14 blue, 11 red; 10 red, 12 blue
|
|
||||||
Game 35: 6 blue, 2 red; 5 blue; 6 green, 9 blue, 3 red; 3 green, 1 red, 2 blue
|
|
||||||
Game 36: 9 blue, 4 green, 6 red; 2 red, 4 green; 7 red, 3 green; 6 green, 2 blue; 3 red, 4 blue, 3 green; 3 green, 4 red, 16 blue
|
|
||||||
Game 37: 2 green, 8 red, 4 blue; 3 red, 4 blue, 2 green; 5 blue, 3 green; 9 blue, 15 green; 5 red, 11 green, 7 blue
|
|
||||||
Game 38: 12 red, 1 blue; 10 red, 3 green, 2 blue; 7 blue, 3 green, 8 red; 14 red, 2 green
|
|
||||||
Game 39: 16 green, 2 red, 17 blue; 6 red, 4 green, 13 blue; 7 blue, 1 green, 4 red; 2 green, 3 blue; 12 green, 6 red, 17 blue; 5 red, 2 blue, 6 green
|
|
||||||
Game 40: 3 green, 4 blue, 2 red; 2 green, 3 red; 6 blue, 2 red, 6 green; 5 green; 3 blue, 1 red, 5 green
|
|
||||||
Game 41: 13 green, 11 red; 3 green, 2 red, 1 blue; 1 blue, 3 green, 9 red; 12 red, 11 green; 9 red, 1 green; 9 green, 4 red
|
|
||||||
Game 42: 4 green, 2 blue; 6 blue, 10 green; 13 blue, 3 red, 6 green; 11 blue, 17 green; 8 blue, 5 red
|
|
||||||
Game 43: 10 green, 2 blue, 10 red; 3 red, 3 blue, 5 green; 10 green, 11 red, 4 blue; 5 green; 7 green, 13 red, 2 blue
|
|
||||||
Game 44: 4 red, 1 blue, 5 green; 1 blue, 8 red, 3 green; 11 red, 1 green, 1 blue; 2 green, 12 red, 1 blue; 1 blue, 12 red; 14 red, 3 green
|
|
||||||
Game 45: 4 green, 5 red, 7 blue; 10 red, 8 green, 3 blue; 12 blue, 1 green, 13 red; 1 red, 3 blue, 7 green
|
|
||||||
Game 46: 5 blue, 13 red; 15 red, 3 green, 17 blue; 8 red, 2 green, 1 blue; 1 green, 7 red, 16 blue; 4 blue, 10 red
|
|
||||||
Game 47: 2 red, 3 green; 2 blue, 9 red, 15 green; 7 green, 4 red; 3 blue, 13 red, 9 green
|
|
||||||
Game 48: 11 green, 4 red, 9 blue; 1 blue, 7 green; 4 blue, 4 red; 4 red, 4 blue, 2 green; 9 green, 2 blue, 2 red
|
|
||||||
Game 49: 10 green, 6 blue; 2 blue, 5 green, 1 red; 5 green, 4 blue; 11 green, 3 red, 3 blue
|
|
||||||
Game 50: 2 red, 15 green, 1 blue; 8 green, 7 blue; 4 blue, 8 green; 7 blue, 17 green; 5 blue, 6 green, 2 red; 16 green, 2 red, 1 blue
|
|
||||||
Game 51: 3 green, 5 blue, 1 red; 11 red, 9 blue, 8 green; 3 red, 8 green, 7 blue; 1 red, 9 blue, 6 green; 4 green, 1 red, 3 blue; 8 green, 7 red
|
|
||||||
Game 52: 1 green, 2 blue, 10 red; 8 green, 1 blue, 2 red; 7 red, 8 green
|
|
||||||
Game 53: 2 red, 6 green; 1 green, 4 blue; 12 green, 19 blue; 11 blue, 1 green; 4 green, 20 blue; 7 blue, 9 green, 1 red
|
|
||||||
Game 54: 2 blue, 2 green, 2 red; 13 red, 1 green, 6 blue; 9 blue, 1 green, 18 red; 11 red, 16 blue; 15 red, 3 green, 13 blue
|
|
||||||
Game 55: 5 green, 5 blue, 9 red; 8 red, 11 blue, 7 green; 6 green, 2 red, 10 blue; 6 red, 6 blue, 9 green; 11 green, 14 blue, 4 red
|
|
||||||
Game 56: 8 blue, 14 green; 3 red, 8 green, 3 blue; 14 green, 1 red, 13 blue; 8 green, 3 red; 8 blue, 11 green, 1 red; 8 blue, 10 green, 2 red
|
|
||||||
Game 57: 7 blue, 7 red; 11 green, 5 blue, 2 red; 14 green, 8 blue; 5 blue, 2 red, 17 green; 12 green, 3 red; 7 red, 7 blue, 9 green
|
|
||||||
Game 58: 3 blue, 4 red, 1 green; 2 green, 3 red; 1 red, 2 green, 4 blue; 4 green, 4 red, 2 blue
|
|
||||||
Game 59: 6 red, 4 blue, 5 green; 6 blue, 6 red; 1 red; 8 blue, 1 red
|
|
||||||
Game 60: 4 blue, 9 green, 11 red; 12 green, 3 red, 9 blue; 7 green, 1 blue; 14 green, 11 blue, 11 red
|
|
||||||
Game 61: 12 green; 9 green, 9 red; 12 red, 18 blue, 8 green; 16 red, 10 blue, 3 green; 6 green, 15 red, 3 blue; 13 green
|
|
||||||
Game 62: 2 green, 3 red, 12 blue; 12 blue, 12 green, 12 red; 1 red, 12 blue, 5 green; 7 red, 9 blue, 13 green; 1 blue, 3 red, 10 green; 2 blue, 8 red, 17 green
|
|
||||||
Game 63: 10 green, 7 blue, 4 red; 3 blue, 6 green, 2 red; 4 green, 10 red, 6 blue; 16 blue, 5 red, 4 green
|
|
||||||
Game 64: 11 red, 1 green, 6 blue; 12 red, 3 green; 6 green, 5 blue, 2 red; 4 green, 9 blue, 11 red; 5 blue, 8 green, 8 red; 9 green, 11 blue
|
|
||||||
Game 65: 4 blue, 12 red; 1 green, 3 blue, 12 red; 1 green, 3 blue, 13 red; 2 red; 12 red
|
|
||||||
Game 66: 4 red, 3 green, 3 blue; 2 blue, 4 red; 10 red, 6 blue, 3 green
|
|
||||||
Game 67: 7 red, 2 blue, 5 green; 3 green, 5 red, 18 blue; 16 red, 5 green, 13 blue; 16 red, 5 blue, 2 green
|
|
||||||
Game 68: 11 blue, 2 red; 1 green, 3 blue, 8 red; 16 red, 1 green, 17 blue; 4 red, 1 green, 11 blue; 3 red
|
|
||||||
Game 69: 1 green, 9 red, 12 blue; 12 red; 11 blue; 1 green
|
|
||||||
Game 70: 1 green, 18 blue, 16 red; 3 green, 15 red, 7 blue; 3 blue, 3 green, 10 red; 1 blue, 3 green, 10 red
|
|
||||||
Game 71: 3 red, 12 blue, 8 green; 18 green, 12 blue, 5 red; 2 blue, 7 red; 11 blue, 9 green; 5 blue, 7 red, 19 green; 2 red, 1 blue, 13 green
|
|
||||||
Game 72: 8 red, 6 blue, 3 green; 2 green, 13 blue, 15 red; 5 green, 8 blue, 2 red; 5 red, 12 blue, 3 green
|
|
||||||
Game 73: 3 blue, 13 green; 7 red, 3 green; 10 red, 2 blue, 1 green
|
|
||||||
Game 74: 3 red; 2 red, 1 blue, 7 green; 10 green, 3 blue, 1 red; 6 green, 1 blue; 11 green, 4 blue
|
|
||||||
Game 75: 8 blue, 2 green, 4 red; 19 blue, 2 green; 1 red, 18 blue, 3 green; 3 red, 5 green, 18 blue
|
|
||||||
Game 76: 3 green, 2 red, 2 blue; 3 blue, 6 green, 1 red; 1 green, 3 blue; 1 blue, 1 green
|
|
||||||
Game 77: 4 green, 7 red, 13 blue; 18 blue; 4 blue, 9 red, 1 green; 2 green, 16 blue, 9 red
|
|
||||||
Game 78: 2 green, 5 blue, 11 red; 2 blue, 3 red, 1 green; 4 green, 6 blue, 6 red
|
|
||||||
Game 79: 9 blue, 1 green, 3 red; 1 green, 2 red, 4 blue; 5 red, 4 green, 10 blue; 1 red, 9 blue, 4 green
|
|
||||||
Game 80: 8 red, 5 green, 7 blue; 15 red, 6 blue, 8 green; 8 blue, 14 red, 7 green; 3 blue, 2 green, 20 red; 10 red, 8 blue, 1 green; 7 green, 11 red, 9 blue
|
|
||||||
Game 81: 7 red, 1 blue, 5 green; 5 green, 10 blue, 9 red; 8 blue, 2 green, 7 red
|
|
||||||
Game 82: 1 green, 6 blue, 14 red; 7 blue, 2 green; 7 blue, 17 red, 3 green
|
|
||||||
Game 83: 2 red, 19 blue, 2 green; 5 red, 5 blue, 2 green; 2 red, 4 blue, 1 green
|
|
||||||
Game 84: 1 blue, 1 red, 12 green; 11 blue, 6 red, 13 green; 10 red, 8 blue, 8 green; 14 blue, 15 red; 19 blue, 10 green, 17 red; 11 red, 7 green
|
|
||||||
Game 85: 16 blue, 12 red, 8 green; 13 red, 3 green; 1 red, 16 blue, 10 green
|
|
||||||
Game 86: 5 green, 8 blue, 3 red; 8 green, 9 red, 13 blue; 4 green, 1 red, 12 blue; 13 red, 15 blue, 5 green
|
|
||||||
Game 87: 1 green, 16 red; 10 red, 2 green, 2 blue; 16 red, 5 blue; 1 blue, 2 green
|
|
||||||
Game 88: 3 blue, 1 green; 1 red, 2 green, 13 blue; 5 blue, 2 green, 1 red
|
|
||||||
Game 89: 9 blue, 2 red, 1 green; 10 blue; 5 blue, 1 green
|
|
||||||
Game 90: 8 red, 2 blue, 5 green; 2 red, 2 green, 2 blue; 1 blue, 8 green, 10 red; 11 green, 1 blue; 10 green, 4 red, 3 blue
|
|
||||||
Game 91: 14 blue, 9 red; 5 green, 5 red, 11 blue; 7 green, 4 blue, 12 red; 8 red, 6 green, 10 blue
|
|
||||||
Game 92: 2 green, 2 blue, 12 red; 2 green, 1 blue, 14 red; 14 red, 2 blue, 6 green; 11 red, 6 green, 2 blue; 11 green, 12 red, 2 blue
|
|
||||||
Game 93: 4 green, 7 blue, 3 red; 1 green, 12 blue, 1 red; 8 blue, 7 green, 2 red; 3 red, 9 blue, 2 green
|
|
||||||
Game 94: 13 green, 9 blue; 9 blue, 1 red, 8 green; 12 green, 1 red, 8 blue; 1 red, 9 green; 1 red, 5 blue, 14 green
|
|
||||||
Game 95: 7 blue, 14 red; 9 blue, 17 red; 2 blue, 1 green, 4 red
|
|
||||||
Game 96: 11 blue, 2 green, 3 red; 3 blue, 12 red, 3 green; 4 green, 11 red, 1 blue
|
|
||||||
Game 97: 9 red, 5 green, 2 blue; 12 red, 1 blue, 11 green; 7 green, 4 red, 2 blue; 1 blue, 6 red, 10 green
|
|
||||||
Game 98: 5 green, 5 red, 11 blue; 1 red, 10 blue, 7 green; 8 red, 1 blue, 7 green; 8 green, 11 red, 2 blue; 4 red, 5 blue, 2 green; 10 green, 5 red, 9 blue
|
|
||||||
Game 99: 3 green, 7 red, 4 blue; 9 red, 13 blue, 2 green; 3 red, 2 green, 11 blue; 5 red, 6 blue, 3 green; 8 blue, 5 green, 6 red; 6 green, 13 red, 1 blue
|
|
||||||
Game 100: 9 green, 7 blue; 1 green, 3 red, 4 blue; 15 red, 9 green; 3 blue, 6 red, 13 green; 2 red, 11 blue, 12 green
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
# Day 2 Puzzle Text.
|
|
||||||
|
|
||||||
--- Day 2: Cube Conundrum ---
|
|
||||||
You're launched high into the atmosphere! The apex of your trajectory just barely reaches the surface of a large island floating in the sky. You gently land in a fluffy pile of leaves. It's quite cold, but you don't see much snow. An Elf runs over to greet you.
|
|
||||||
|
|
||||||
The Elf explains that you've arrived at Snow Island and apologizes for the lack of snow. He'll be happy to explain the situation, but it's a bit of a walk, so you have some time. They don't get many visitors up here; would you like to play a game in the meantime?
|
|
||||||
|
|
||||||
As you walk, the Elf shows you a small bag and some cubes which are either red, green, or blue. Each time you play this game, he will hide a secret number of cubes of each color in the bag, and your goal is to figure out information about the number of cubes.
|
|
||||||
|
|
||||||
To get information, once a bag has been loaded with cubes, the Elf will reach into the bag, grab a handful of random cubes, show them to you, and then put them back in the bag. He'll do this a few times per game.
|
|
||||||
|
|
||||||
You play several games and record the information from each game (your puzzle input). Each game is listed with its ID number (like the 11 in Game 11: ...) followed by a semicolon-separated list of subsets of cubes that were revealed from the bag (like 3 red, 5 green, 4 blue).
|
|
||||||
|
|
||||||
For example, the record of a few games might look like this:
|
|
||||||
```
|
|
||||||
Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green
|
|
||||||
Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue
|
|
||||||
Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red
|
|
||||||
Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red
|
|
||||||
Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green
|
|
||||||
```
|
|
||||||
In game 1, three sets of cubes are revealed from the bag (and then put back again). The first set is 3 blue cubes and 4 red cubes; the second set is 1 red cube, 2 green cubes, and 6 blue cubes; the third set is only 2 green cubes.
|
|
||||||
|
|
||||||
The Elf would first like to know which games would have been possible if the bag contained only 12 red cubes, 13 green cubes, and 14 blue cubes?
|
|
||||||
|
|
||||||
In the example above, games 1, 2, and 5 would have been possible if the bag had been loaded with that configuration. However, game 3 would have been impossible because at one point the Elf showed you 20 red cubes at once; similarly, game 4 would also have been impossible because the Elf showed you 15 blue cubes at once. If you add up the IDs of the games that would have been possible, you get 8.
|
|
||||||
|
|
||||||
Determine which games would have been possible if the bag had been loaded with only 12 red cubes, 13 green cubes, and 14 blue cubes. What is the sum of the IDs of those games?
|
|
||||||
|
|
||||||
--- Part Two ---
|
|
||||||
The Elf says they've stopped producing snow because they aren't getting any water! He isn't sure why the water stopped; however, he can show you how to get to the water source to check it out for yourself. It's just up ahead!
|
|
||||||
|
|
||||||
As you continue your walk, the Elf poses a second question: in each game you played, what is the fewest number of cubes of each color that could have been in the bag to make the game possible?
|
|
||||||
|
|
||||||
Again consider the example games from earlier:
|
|
||||||
```
|
|
||||||
Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green
|
|
||||||
Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue
|
|
||||||
Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red
|
|
||||||
Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red
|
|
||||||
Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green
|
|
||||||
```
|
|
||||||
In game 1, the game could have been played with as few as 4 red, 2 green, and 6 blue cubes. If any color had even one fewer cube, the game would have been impossible.
|
|
||||||
Game 2 could have been played with a minimum of 1 red, 3 green, and 4 blue cubes.
|
|
||||||
Game 3 must have been played with at least 20 red, 13 green, and 6 blue cubes.
|
|
||||||
Game 4 required at least 14 red, 3 green, and 15 blue cubes.
|
|
||||||
Game 5 needed no fewer than 6 red, 3 green, and 2 blue cubes in the bag.
|
|
||||||
The power of a set of cubes is equal to the numbers of red, green, and blue cubes multiplied together. The power of the minimum set of cubes in game 1 is 48. In games 2-5 it was 12, 1560, 630, and 36, respectively. Adding up these five powers produces the sum 2286.
|
|
||||||
|
|
||||||
For each game, find the minimum set of cubes that must have been present. What is the sum of the power of these sets?
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Paste any inputs into this file.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
# Day 20 Puzzle Text.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Paste any inputs into this file.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
# Day 21 Puzzle Text.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Paste any inputs into this file.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
# Day 22 Puzzle Text.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Paste any inputs into this file.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
# Day 23 Puzzle Text.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Paste any inputs into this file.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
# Day 24 Puzzle Text.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Paste any inputs into this file.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
# Day 25 Puzzle Text.
|
|
||||||
@@ -1,140 +0,0 @@
|
|||||||
.679.....662....71............................805..........862.680...................................................................687....
|
|
||||||
............*....-..811..........846..855......*.............*..$........230.92@............................=.....................92........
|
|
||||||
..........360..........#....664.....=.*...881...677...934.780.......426.*..........8......654.....*959.....539..........21.........*........
|
|
||||||
.....................+.........*......379..*.........*.........=.........969........*........*.976..............872....*....../....579......
|
|
||||||
.......566......652...809....482.394......492..303.650..../...38....%...............106...385..................#.....793..484.865...........
|
|
||||||
......*...........*................*..347.......*.........220.....349...691...392*..................18..797.......................+.........
|
|
||||||
.....11......890........870.......156............733.................../..........921.....................*......*.............203..........
|
|
||||||
.............#...238.....*...........................188......294./58........408...............677.......778....104.903............%........
|
|
||||||
.411+...828.......*.....706.....249..=.....638...848*...........%...............*948............*.....+......+...........917.......817...346
|
|
||||||
................69.................*..310.*....@..........118*......428=..785...................931...217.....934....475...@.145........*...
|
|
||||||
...844.885.........#66...........587.......74...773...........194......../.........&107................................%...............375..
|
|
||||||
......*....826.190.......498........................960............24........212............................398...........474*925...........
|
|
||||||
...........*...*......../......949.-...213./353.................................@...........853......33*164....+....998...............325...
|
|
||||||
........640..823....957........&...746..*........*777.............134.......264.......904+..=........................*......./........%.....
|
|
||||||
....43...............*....457............325..390...........618.........265....*670............=...#165........909..634.......810...........
|
|
||||||
.....................503.*.....438..904*.............+.........*..563..*............345@......597.........758.*...................*154......
|
|
||||||
...941...................612...@........691.....&...336.......837..*....489...............................*...462.689....995...106..........
|
|
||||||
......*383..824...................911........*..467.................44....../.........&445...$...765.647..464.............&..........226....
|
|
||||||
......................151.....116*........249..................929*.......500..140.........18.......*.........823.....454............*......
|
|
||||||
..................968..@..........................118*.....300.................*....762.........541......59...*....35....*..........8.......
|
|
||||||
.....304.........*.......620..@...573.878................................@...@.273.*......572...............661........527.971*.......259...
|
|
||||||
....*.............83.....%...983.*......*.32..603.....201..............492.166.....339.....*...978$..............373...........340.....*....
|
|
||||||
.761..758...934..................550.148.................................................25......................*.....*236.............624.
|
|
||||||
........&......*...393..62*.................167/..716........$........910.767.......380............873*812.362.115..537......48.............
|
|
||||||
.....#........697..*.......159.....................*.........522..............41.....*.........+............*...........812......13.........
|
|
||||||
....529.............374......../...%.............................143...........*......109.......365..........952...........*....*...........
|
|
||||||
...........122*...............555.937......674....................../...529.774..371.................#.38.........../.......304.750....715..
|
|
||||||
..................873*....819..........165....*..928*345........................*..........77......478..*...440...743...................*...
|
|
||||||
964...........417.....802..*......230..-....509..................573...........219...675....-.865.......13............25.62*4...980..145....
|
|
||||||
....*556........&.............278*.................957.....85#.....*................*............=....#.....442........$.......*............
|
|
||||||
.972.....................541...........91*614..485...............680..792...+........541.325..........486......&..653....#.....247..778.....
|
|
||||||
.......680.................*.980*710............*...494...............*......88...........................825........#.629.............$....
|
|
||||||
.399...*......439.........89...........430*....401.....*660....693......407&...........#883....#265......*.....438..........................
|
|
||||||
........390....*.....388.........21........861............................................................798.-....#........................
|
|
||||||
..417&.......551.102.$..............332............/804.....463*649..188.........992.....754.203....912..........732.490....................
|
|
||||||
...................*................*......214.134......................*805.%.....*.....*....*.....#.....*..........*....302.....934..=....
|
|
||||||
....835.........622..............8...541...*....*..861....442....874..........458...955...985..172.....497.310........341......$....*...644.
|
|
||||||
....*......246......909....320.............893.150....*.....*....*........717................................................833.178........
|
|
||||||
...622....*....309.+.........*.........681..........414......612..678....*...........336.................+.....715..........................
|
|
||||||
...........407.......611.....42...........*159........................................*..97..............355...*..........*954..............
|
|
||||||
.......967.....120..=...............................................................519....+.....382............974...................651...
|
|
||||||
739.......*.....*........155.....539................132*.....702......@....923...............905*.........................971...............
|
|
||||||
....453...149...717.400............*.........618........295.....#..644.......-...786....................*...287...........$.................
|
|
||||||
...#..................*.............810........*.908$............................*......+........168...903.....*.....&.......@..............
|
|
||||||
.................306...483..750.108..........570...................934......523..736..#..889......*.........557.......913....107.852..241...
|
|
||||||
...............................*.......................899............*974..%........42............268...........807..............-...@.....
|
|
||||||
..958.......610............/......................894.........................242.........300...........$............941..150...............
|
|
||||||
...........#....131.907.....924...529.267............=.....-./.....692*505...*......265%............$...95.....538........#.................
|
|
||||||
....137...............$...........*...*.........219.....347..268.............753....................12.....351.................955....875...
|
|
||||||
......*....258.................854..253...15........................506....#.................559........&................&........*.........
|
|
||||||
.....376...*.....892.466..160............*.......$................*....*..593.............../............682....721...750..10......187...540
|
|
||||||
...........866...=..................$...437....994......730....404...703................507...&...........................*....126......@...
|
|
||||||
....300...............301....@...315.....................*......................572........-...793.......309.518.437..182.310.*.....&.......
|
|
||||||
...=.....-176.129*........882............................256...............249..*.....+.....................*.....%..+.........71...76..586.
|
|
||||||
......54..........910............*......734....*..............-.......445.....@.....807.....75.907....477%..................................
|
|
||||||
.....*........................247.855....%...647.....@.....558...407....#....................%...*................................447..129..
|
|
||||||
......322..235.......821..............*...........767...............*35..........824.338.55....232...814................546*582.......*.....
|
|
||||||
..............*........./...........509......270.......-33...673................/.......*..............*......-.....................257.....
|
|
||||||
....793*831....805.871.....701..........503.....$............%.............710......37..../.........897...-....516.....330...371............
|
|
||||||
....................*..324*............$............875........293.........*.........@..510..............332..............*..*....2*558.....
|
|
||||||
.........../......147........373..........%926.........@......-......426...142...............%.......184.........#.....746..................
|
|
||||||
.......589..755.......285............221+.................$.........*.................571.....539......*.....60...644.............333.......
|
|
||||||
258....................*.....499............$.107......510.......257..........583.......@...........408.............................*.......
|
|
||||||
.....................396......*.../..../..493.........................489*380....*........908.711............772..........561......24..559..
|
|
||||||
.............................548.769.630..........504*........893................605.........*.........*..10................*..653.....*....
|
|
||||||
........=418..........*576................-..............815.....*.389......481.........*.......859.180....................137..+....275....
|
|
||||||
..77...........551.901.....535............683.............../.638............./......671.908.....@......360.....611....136..................
|
|
||||||
...&...........*.......722...........................702.............514............................520.$.........*...&.....$315...#...147..
|
|
||||||
.......830............*.............#377........39.....%.......384..*.........748..265......271.............885..882...............45...+...
|
|
||||||
..329.-...........787.311.........................*........115...@..840.........&...*.......*......513..695..........515....................
|
|
||||||
....*......666...*..............256*999......897.651.......*............457.........34..&...933...*......*......................156.........
|
|
||||||
..627.......*....24...........@.........................177...22........*...775........668......685...947.....110................*..........
|
|
||||||
.........172..........295*....540.856..76......................+...337.343.=.............................................18....914..449.....
|
|
||||||
.............239..........163.........*......770....594.........../..............200.....824*513..........146............*..........-.......
|
|
||||||
..............#................841...199......=............317..........97.*..........-.............165.....................................
|
|
||||||
...570...../......................*.......122.......179#..*......138........647......376........65..............735.........................
|
|
||||||
.....@.221..50..350...@....757.....88........*582.........893.....*.....230.................403...$......................865...927....892...
|
|
||||||
..........*........#...130..*......................232.........709....&...........105......*..............926=.......966.*.......*...$......
|
|
||||||
....200...884..............338....*155....822*609....&..84.........935..............#.....481...968.64................+..337.....152...254..
|
|
||||||
.......*.........203............70......................%...................../................*....*........................627............
|
|
||||||
.......491........*......321.......$...-.......282............................512.282........564.625........746*825..#..........*361........
|
|
||||||
...................908...$........335.332.509$....*..../..........216.....-.......*...................617.............896...................
|
|
||||||
......946...299............657..................255...724..../......*.....830..122..........487.........*.....645.................56.66.....
|
|
||||||
..984..@...........@....15*.............*858...............150.....91..................498.........654..969.......+............&.....*......
|
|
||||||
.........104.870.281.........$.......796.......................................................................853.............316..984.....
|
|
||||||
.........*.....#......=...288.............86......376.804...515...............405..265*................................%....................
|
|
||||||
.336....152..........671............545.....&......*.....*..............549...*........37.....-....313.#......110.....578..414*.............
|
|
||||||
..............496.....................*...........536..20........471...*.......397..........437.....*..996...&....18...........200..........
|
|
||||||
.................=..........308.....147...319.12................*.....465..............$992........71..............@........................
|
|
||||||
............712.......*123.=..............#.....*629.......%..............................................#..........153..945...........36..
|
|
||||||
.....+340.....-....850................922...%............812..259*577...#452...-........620.567-.784....985.934.427...@..*.........280......
|
|
||||||
216............................394......*..589.........-.....................191....622./..........*........*.............124........*......
|
|
||||||
......764......................*......663...............165...318.....................*....200.83...896..856................................
|
|
||||||
.....*.......705........751..46...............................-....698....132.......-..81...........................264.....................
|
|
||||||
...538.......*......170....*..............808........166..........+......$........130........428............852.......*.................902.
|
|
||||||
..............803...........938..51....66.*...514.......*430..................................*......@..............=............/469.......
|
|
||||||
.........26@.........90...................473..../..273..............13......656.......242$..829......682...........594...968...............
|
|
||||||
...180............+.........872..131....................176...781...-.......*.....294.............990.............#..........=.@...../......
|
|
||||||
....@..344.........184..........*.............................*.........42..153..#.................*.....577......32...........303..334.....
|
|
||||||
........&..620..................821....172....32.....470....698..........%....................397..301.......................*..........569.
|
|
||||||
.../........./.........325.@.............*...*.........*........$.....*....+......124...200......*.......827....*861........857.876.........
|
|
||||||
..808.................*.....581..............644...3..190.607.175..76.712..724.......$........16.358......*...31.......270.........*915.....
|
|
||||||
...............894...453...............845..........#.......*.....................#......................793..............*...914*..........
|
|
||||||
..................&......................+...............99.596..597*813...958.831......261*95.....922..........&.......537.......302.414...
|
|
||||||
...931*.................................................+..........................394......................65.679..........%.........*.....
|
|
||||||
.......839....644......./262......461...424.....682........................954.............43*.............*.......778..*....464......822...
|
|
||||||
.............#.......................=..*...........706....289*.....459......*..........-.....234........11..$.......@..373.................
|
|
||||||
.............../620...536+....100*......907.....159..+.........998.*..........832.....806...........695.....516....................126......
|
|
||||||
..................................268.............*....893.........12.86.................................................*..................
|
|
||||||
......+....355.........998..630..............$.....815...*..............*.....168...554...........735............+......861....490..........
|
|
||||||
.....176...*....513....%....*.................120......568....*314.404+.325..........*..662...855.....495.........467..........*............
|
|
||||||
..........132......*......677..708.................424.....715.....................520..*..................................36.410...........
|
|
||||||
..419...........454..............#...730...401&....*.....#............696..............267.=802...................761......*................
|
|
||||||
............394.........................*........650...637....695......*.....................................586....-...735..154.....423*344
|
|
||||||
........458..%.....*...728..+..........488.435......................241........795.552.....9.&...............................#..............
|
|
||||||
...........*....86.981....*..633.........../................762.700.....70*.........../....*.837......-.........20..................%.......
|
|
||||||
.519...+.652...*........614.......+....................924....*............663..591......192.....952.25.........*....600....#.*239..381.....
|
|
||||||
...*.366.......845.512......@...200...-....280............*...207............................297...*......828...249.*.....408...............
|
|
||||||
.189......5........*.....353........245.......#...153..680..............295..50...............+....296.../...........906.............+......
|
|
||||||
......741*.........466....................710....=.........561*........*..............831............................................909....
|
|
||||||
...........+.................421............*..........+.......661..103...............................922..752..................431.........
|
|
||||||
181......218.707....*....273....*..130.$273.980.........656..............517..712..578.......&.524.....@....*.....996..............*....#709
|
|
||||||
.................442.432..*....64.*......................................../..*....#.......534....*........498.............727.....434......
|
|
||||||
233*559....................869.....316../..........&.....502..+...884.731.....503................239...499.....94..........*................
|
|
||||||
........352.......231...................340.....177..584.....922.....*....57...........................*.........*349...222...212&...433.520
|
|
||||||
...........-.........*981..479..637.....................*969.....*.........=..$.........601...=826...312....................................
|
|
||||||
..............205.................*../...@.....213.............41.64..........80....889*.............................@....76.=702...........
|
|
||||||
....353.......*..................114..97.867...*.....542.........................................721...395............816..............*112.
|
|
||||||
....*.......367.*............478.............42..../..........947.................................*......@......956...........+...883.......
|
|
||||||
.....870........460............*...................26...........*...........960......212...479....422...........*.......780..595..*.........
|
|
||||||
....................978*368....921..760=..................416...665..$.........$.381*.......*............933.744....=..*...........792......
|
|
||||||
....52..........300..........................................*........293.162%........................@...*........259..283.................
|
|
||||||
......%..........%........119.......575.......#..%......./.748......................945...212&.....595.....248.286...........839..106/......
|
|
||||||
..940........$...........%............%....880....539.659.............*.........353*.....................=.....*................*.......188.
|
|
||||||
.....*....254...............794..550...............................701.797............500#................34..475...507..........763........
|
|
||||||
..649............58..691&.....%............................................386..............@.$44.101.....................997..*............
|
|
||||||
.........255............................376....732....-..............869......$...........473........*376....220.........@.....721...443....
|
|
||||||
...........@.913.....168....=909..431......=......@..976.......+.......*..........155............................620.......250......@.......
|
|
||||||
......806.....*....................*...........@................45.....475...724..*......&45.........+202..-576.....*.........*.............
|
|
||||||
...............383...........................372..................................474...................................432.471......729....
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
# Day 3 Puzzle Text.
|
|
||||||
--- Day 3: Gear Ratios ---
|
|
||||||
You and the Elf eventually reach a gondola lift station; he says the gondola lift will take you up to the water source, but this is as far as he can bring you. You go inside.
|
|
||||||
|
|
||||||
It doesn't take long to find the gondolas, but there seems to be a problem: they're not moving.
|
|
||||||
|
|
||||||
"Aaah!"
|
|
||||||
|
|
||||||
You turn around to see a slightly-greasy Elf with a wrench and a look of surprise. "Sorry, I wasn't expecting anyone! The gondola lift isn't working right now; it'll still be a while before I can fix it." You offer to help.
|
|
||||||
|
|
||||||
The engineer explains that an engine part seems to be missing from the engine, but nobody can figure out which one. If you can add up all the part numbers in the engine schematic, it should be easy to work out which part is missing.
|
|
||||||
|
|
||||||
The engine schematic (your puzzle input) consists of a visual representation of the engine. There are lots of numbers and symbols you don't really understand, but apparently any number adjacent to a symbol, even diagonally, is a "part number" and should be included in your sum. (Periods (.) do not count as a symbol.)
|
|
||||||
|
|
||||||
Here is an example engine schematic:
|
|
||||||
```
|
|
||||||
467..114..
|
|
||||||
...*......
|
|
||||||
..35..633.
|
|
||||||
......#...
|
|
||||||
617*......
|
|
||||||
.....+.58.
|
|
||||||
..592.....
|
|
||||||
......755.
|
|
||||||
...$.*....
|
|
||||||
.664.598..
|
|
||||||
```
|
|
||||||
In this schematic, two numbers are not part numbers because they are not adjacent to a symbol: 114 (top right) and 58 (middle right). Every other number is adjacent to a symbol and so is a part number; their sum is 4361.
|
|
||||||
|
|
||||||
Of course, the actual engine schematic is much larger. What is the sum of all of the part numbers in the engine schematic?
|
|
||||||
|
|
||||||
--- Part Two ---
|
|
||||||
The engineer finds the missing part and installs it in the engine! As the engine springs to life, you jump in the closest gondola, finally ready to ascend to the water source.
|
|
||||||
|
|
||||||
You don't seem to be going very fast, though. Maybe something is still wrong? Fortunately, the gondola has a phone labeled "help", so you pick it up and the engineer answers.
|
|
||||||
|
|
||||||
Before you can explain the situation, she suggests that you look out the window. There stands the engineer, holding a phone in one hand and waving with the other. You're going so slowly that you haven't even left the station. You exit the gondola.
|
|
||||||
|
|
||||||
The missing part wasn't the only issue - one of the gears in the engine is wrong. A gear is any * symbol that is adjacent to exactly two part numbers. Its gear ratio is the result of multiplying those two numbers together.
|
|
||||||
|
|
||||||
This time, you need to find the gear ratio of every gear and add them all up so that the engineer can figure out which gear needs to be replaced.
|
|
||||||
|
|
||||||
Consider the same engine schematic again:
|
|
||||||
```
|
|
||||||
467..114..
|
|
||||||
...*......
|
|
||||||
..35..633.
|
|
||||||
......#...
|
|
||||||
617*......
|
|
||||||
.....+.58.
|
|
||||||
..592.....
|
|
||||||
......755.
|
|
||||||
...$.*....
|
|
||||||
.664.598..
|
|
||||||
```
|
|
||||||
In this schematic, there are two gears. The first is in the top left; it has part numbers 467 and 35, so its gear ratio is 16345. The second gear is in the lower right; its gear ratio is 451490. (The * adjacent to 617 is not a gear because it is only adjacent to one part number.) Adding up all of the gear ratios produces 467835.
|
|
||||||
|
|
||||||
What is the sum of all of the gear ratios in your engine schematic?
|
|
||||||
@@ -1,209 +0,0 @@
|
|||||||
Card 1: 99 46 62 92 60 37 52 56 41 31 | 83 40 31 33 46 3 10 39 82 8 64 35 5 63 60 72 48 87 11 81 95 34 97 37 99
|
|
||||||
Card 2: 98 96 50 60 7 40 83 93 55 26 | 45 38 47 98 32 50 55 35 93 11 97 53 74 83 99 60 73 56 40 58 96 66 90 26 7
|
|
||||||
Card 3: 82 8 12 15 53 23 29 61 5 21 | 21 73 5 65 44 29 61 97 15 4 90 76 53 91 13 27 9 11 2 75 22 92 95 82 86
|
|
||||||
Card 4: 68 22 77 52 23 60 57 31 74 38 | 22 38 68 79 52 23 40 57 10 74 31 83 24 60 95 17 78 89 39 37 87 26 77 63 54
|
|
||||||
Card 5: 94 23 38 14 31 47 8 15 19 79 | 94 45 21 70 43 95 79 38 19 67 24 62 71 84 14 87 63 47 36 26 8 66 31 15 23
|
|
||||||
Card 6: 37 56 14 26 46 19 58 99 41 55 | 95 25 39 19 26 99 21 11 56 46 3 53 33 36 4 15 55 28 58 37 14 50 94 49 44
|
|
||||||
Card 7: 68 13 44 81 92 43 9 78 85 62 | 19 8 91 71 76 54 72 87 68 16 46 94 92 63 62 67 28 84 18 88 24 14 37 30 81
|
|
||||||
Card 8: 73 86 24 66 38 95 71 90 88 22 | 44 88 30 24 97 34 99 66 94 26 86 90 52 55 84 7 78 40 71 73 50 95 61 38 22
|
|
||||||
Card 9: 98 71 24 85 11 74 22 35 65 59 | 18 43 54 36 71 86 22 7 85 78 46 6 77 62 38 98 83 65 88 37 84 70 72 59 23
|
|
||||||
Card 10: 5 87 77 60 62 86 42 33 43 76 | 86 19 26 77 5 60 21 34 44 76 33 85 78 67 79 13 18 42 87 59 54 43 62 65 16
|
|
||||||
Card 11: 55 61 40 88 59 58 62 42 9 71 | 83 97 25 49 30 76 82 39 98 5 91 58 38 44 6 90 55 14 62 16 93 15 68 42 70
|
|
||||||
Card 12: 15 25 80 89 26 44 17 56 82 70 | 29 25 15 33 95 89 85 98 82 66 62 38 97 71 26 70 49 64 57 17 35 56 44 46 72
|
|
||||||
Card 13: 72 99 42 47 10 66 17 53 49 57 | 66 89 64 88 1 95 42 53 72 57 83 12 49 21 44 17 24 79 73 10 90 47 82 87 99
|
|
||||||
Card 14: 36 26 75 45 39 10 73 4 52 97 | 17 72 26 4 90 30 10 43 59 64 14 41 34 82 37 25 27 99 32 73 45 75 36 39 93
|
|
||||||
Card 15: 79 15 53 44 50 57 99 55 61 59 | 5 39 6 15 41 4 94 85 13 58 60 24 36 46 57 33 8 30 25 51 22 38 92 79 16
|
|
||||||
Card 16: 1 46 37 33 53 23 83 40 95 57 | 12 60 26 36 22 69 68 86 83 42 53 70 63 5 84 29 75 19 61 55 74 9 32 44 73
|
|
||||||
Card 17: 33 17 50 35 39 95 22 67 76 47 | 44 55 21 3 2 5 51 26 89 39 98 92 29 93 78 42 66 19 28 31 97 81 53 52 86
|
|
||||||
Card 18: 64 15 40 93 58 22 2 53 30 92 | 64 42 72 39 60 29 10 80 70 91 78 79 37 2 48 3 47 32 30 76 84 11 96 18 23
|
|
||||||
Card 19: 97 95 42 67 18 69 54 94 10 5 | 22 45 23 35 92 2 75 21 9 68 51 59 25 27 84 28 89 61 76 63 65 14 43 8 13
|
|
||||||
Card 20: 69 87 4 30 13 63 74 23 83 14 | 26 19 32 64 88 39 25 53 16 48 41 89 22 14 15 83 20 43 59 92 90 5 75 38 37
|
|
||||||
Card 21: 67 33 16 11 42 10 27 46 72 37 | 52 87 92 8 91 66 38 80 86 35 54 6 72 4 99 25 70 16 55 75 57 30 44 69 45
|
|
||||||
Card 22: 27 82 94 86 50 91 21 70 14 76 | 10 60 59 35 51 71 34 44 93 28 46 27 12 84 75 74 1 39 79 53 86 37 4 99 8
|
|
||||||
Card 23: 95 97 54 38 34 16 15 2 64 6 | 96 74 69 62 35 28 88 30 48 84 99 73 43 21 89 24 1 13 58 71 5 19 72 47 12
|
|
||||||
Card 24: 96 44 79 9 73 3 52 17 63 98 | 61 46 10 24 29 62 55 51 19 83 8 70 26 59 76 48 25 69 2 97 43 22 42 53 54
|
|
||||||
Card 25: 41 19 88 60 86 50 18 95 24 4 | 41 88 16 33 49 50 95 53 76 35 4 24 45 94 55 9 51 99 60 18 40 93 78 86 19
|
|
||||||
Card 26: 5 21 3 15 92 96 62 55 41 40 | 63 77 40 15 65 3 96 78 37 4 97 8 33 6 73 11 7 92 55 5 62 72 27 18 47
|
|
||||||
Card 27: 71 24 54 64 30 27 26 57 55 85 | 35 47 59 71 54 55 37 60 69 77 82 65 21 57 5 24 46 4 49 95 15 3 18 27 64
|
|
||||||
Card 28: 98 39 92 41 97 71 91 43 40 56 | 39 71 63 44 62 75 97 82 2 92 28 56 20 67 98 69 13 40 86 66 81 60 43 41 91
|
|
||||||
Card 29: 36 94 22 10 41 40 78 70 95 89 | 37 30 9 72 27 84 2 21 92 38 19 83 31 47 3 12 5 61 16 98 75 57 94 93 4
|
|
||||||
Card 30: 78 88 77 79 61 56 98 39 68 35 | 78 59 56 49 39 63 90 26 77 40 60 16 14 98 66 79 95 41 35 34 44 73 43 57 5
|
|
||||||
Card 31: 34 73 75 54 99 27 70 89 62 45 | 90 5 40 18 21 98 70 96 50 81 68 37 74 77 80 43 34 73 39 45 2 82 9 10 8
|
|
||||||
Card 32: 96 26 4 32 12 6 64 2 58 60 | 18 96 20 23 85 6 12 49 58 54 2 48 98 60 70 59 69 45 99 74 13 4 21 28 64
|
|
||||||
Card 33: 78 81 10 46 32 16 12 95 53 27 | 61 55 6 63 91 37 34 88 56 80 77 21 38 85 32 92 8 9 28 89 99 94 14 57 46
|
|
||||||
Card 34: 23 80 22 10 30 50 89 8 21 16 | 45 69 42 28 54 93 85 30 62 21 66 39 72 6 11 8 16 53 59 18 98 29 27 49 73
|
|
||||||
Card 35: 51 86 59 85 23 42 41 88 83 63 | 5 78 48 35 27 62 82 60 49 33 23 79 91 88 2 11 54 12 8 15 9 67 31 4 47
|
|
||||||
Card 36: 56 60 49 10 35 38 28 75 21 40 | 5 37 93 17 92 41 66 38 34 47 56 89 35 48 84 76 65 25 8 51 53 16 54 72 52
|
|
||||||
Card 37: 54 81 13 1 52 34 98 91 65 49 | 36 5 56 18 31 46 59 21 23 25 33 69 51 24 78 39 40 29 52 93 77 13 71 32 97
|
|
||||||
Card 38: 1 78 73 52 53 64 66 47 96 77 | 94 63 31 3 11 14 97 32 85 45 8 98 82 62 88 28 60 41 84 69 20 75 30 33 44
|
|
||||||
Card 39: 98 71 74 50 62 59 58 35 49 60 | 89 16 49 11 74 48 30 23 51 65 24 1 38 46 52 84 73 26 96 88 56 18 85 68 14
|
|
||||||
Card 40: 4 31 39 27 97 41 98 6 43 54 | 32 70 23 34 73 66 52 88 81 71 10 27 14 24 77 59 65 15 78 8 21 30 79 7 50
|
|
||||||
Card 41: 28 21 88 19 33 36 30 70 64 81 | 9 40 3 91 4 59 41 35 50 95 55 57 52 26 18 12 92 98 44 32 80 68 85 97 61
|
|
||||||
Card 42: 4 93 74 66 18 27 25 20 32 65 | 54 21 32 4 73 87 27 40 10 64 57 56 74 20 34 92 25 93 88 36 18 66 37 65 67
|
|
||||||
Card 43: 95 94 41 18 65 93 13 25 12 34 | 93 4 12 43 97 64 82 87 65 16 29 34 67 11 32 57 15 17 14 61 37 13 18 60 98
|
|
||||||
Card 44: 61 49 74 81 5 91 37 52 6 53 | 15 73 3 66 93 35 33 51 20 74 92 48 72 61 60 27 36 91 97 47 12 75 49 52 53
|
|
||||||
Card 45: 30 1 29 37 64 4 72 14 78 83 | 64 27 59 3 61 15 71 60 84 29 39 7 2 70 45 36 14 19 33 56 54 95 9 69 11
|
|
||||||
Card 46: 80 61 25 90 50 5 11 30 35 37 | 90 17 1 80 27 15 30 45 52 39 76 92 60 93 23 89 58 21 18 25 46 61 36 44 88
|
|
||||||
Card 47: 29 72 76 45 58 2 55 73 12 90 | 88 13 44 25 40 24 84 70 16 66 12 18 10 61 55 29 65 35 93 7 77 82 83 87 90
|
|
||||||
Card 48: 76 4 75 31 14 41 48 58 51 69 | 27 48 76 4 38 41 68 90 92 5 84 10 31 75 67 58 69 71 14 93 80 24 91 39 51
|
|
||||||
Card 49: 81 35 86 29 85 28 16 8 18 15 | 29 12 35 45 82 14 9 55 8 64 52 96 48 56 60 66 16 92 72 86 36 23 69 70 37
|
|
||||||
Card 50: 74 5 11 36 71 92 54 3 26 35 | 16 2 92 11 7 76 8 87 48 54 34 82 3 68 26 5 71 74 97 36 38 28 35 80 53
|
|
||||||
Card 51: 58 18 51 75 22 48 53 52 77 24 | 72 84 19 62 73 51 11 24 50 92 57 81 36 64 95 1 87 71 25 86 16 54 53 85 45
|
|
||||||
Card 52: 22 83 45 29 47 18 89 38 5 63 | 71 28 21 2 10 30 59 31 67 12 61 51 87 46 97 75 19 91 8 43 62 27 99 88 72
|
|
||||||
Card 53: 33 97 73 45 14 56 21 18 17 83 | 17 54 33 39 73 82 83 57 34 45 99 50 21 87 68 8 81 97 76 42 14 18 94 51 31
|
|
||||||
Card 54: 54 38 17 78 1 59 32 5 41 75 | 79 80 18 36 26 89 66 40 11 1 87 63 14 3 5 48 75 43 13 38 81 72 59 82 54
|
|
||||||
Card 55: 75 42 62 53 35 84 6 20 40 10 | 22 36 74 30 57 16 1 64 46 58 9 3 45 33 25 60 8 59 41 28 76 15 75 79 37
|
|
||||||
Card 56: 31 79 49 20 8 56 78 38 96 64 | 59 71 8 79 31 51 88 78 46 20 64 35 27 53 75 21 70 92 28 42 56 33 76 96 99
|
|
||||||
Card 57: 85 37 76 51 7 60 16 56 27 71 | 68 9 27 14 10 12 19 63 56 67 36 35 71 52 57 51 92 85 75 97 18 23 11 76 5
|
|
||||||
Card 58: 79 82 21 48 89 88 65 49 30 68 | 2 28 94 49 21 6 60 30 9 64 89 91 97 75 88 12 79 51 36 67 65 82 11 55 26
|
|
||||||
Card 59: 31 83 87 62 28 76 94 89 22 46 | 14 9 79 63 74 89 83 62 84 37 49 31 99 76 96 7 39 3 18 59 85 28 60 94 29
|
|
||||||
Card 60: 23 34 26 59 94 24 88 68 77 30 | 52 43 30 81 33 17 73 41 38 3 96 90 65 68 55 64 84 20 85 12 36 79 32 18 8
|
|
||||||
Card 61: 17 46 97 52 55 51 81 75 4 14 | 12 52 26 13 93 71 33 53 8 38 70 29 66 24 81 51 75 20 54 73 35 32 16 64 11
|
|
||||||
Card 62: 97 52 29 36 93 3 77 84 45 41 | 61 58 47 10 69 8 6 63 57 51 85 1 53 78 76 40 67 9 62 35 48 95 72 86 12
|
|
||||||
Card 63: 9 74 61 5 66 95 59 56 51 19 | 52 96 82 3 15 42 69 90 43 10 8 44 86 85 63 18 48 16 34 94 6 38 58 55 35
|
|
||||||
Card 64: 97 25 57 38 14 15 51 75 16 68 | 48 91 34 16 9 86 42 81 24 98 50 32 80 57 4 93 46 53 73 60 26 7 65 45 5
|
|
||||||
Card 65: 74 42 66 63 84 41 76 78 8 95 | 21 34 93 27 17 16 78 36 37 67 38 46 31 64 26 72 58 80 6 59 65 19 45 4 86
|
|
||||||
Card 66: 53 10 22 55 68 30 44 64 38 51 | 26 11 16 70 29 43 35 96 80 6 52 27 71 72 28 13 58 36 76 50 12 4 92 88 57
|
|
||||||
Card 67: 30 40 95 71 85 2 10 54 58 78 | 20 35 37 5 84 93 2 58 43 21 14 1 25 27 85 13 71 88 78 67 10 68 97 54 32
|
|
||||||
Card 68: 26 32 31 3 25 65 55 29 24 99 | 97 10 13 61 23 40 19 71 15 72 63 96 8 81 21 33 66 51 85 62 7 44 36 42 49
|
|
||||||
Card 69: 96 29 40 52 39 73 38 72 90 22 | 50 79 62 52 71 51 22 43 96 29 47 90 19 72 75 58 95 83 61 42 9 59 73 39 49
|
|
||||||
Card 70: 37 66 45 2 98 67 18 35 61 48 | 45 27 66 2 35 31 44 71 22 37 15 1 61 48 95 91 90 41 18 77 67 70 32 30 98
|
|
||||||
Card 71: 52 48 91 95 9 55 37 56 34 39 | 45 56 49 39 65 55 32 9 68 88 3 28 34 17 26 30 91 10 42 20 59 18 48 41 44
|
|
||||||
Card 72: 43 15 49 52 69 77 40 46 78 75 | 55 50 4 12 92 8 89 59 65 37 77 45 36 97 43 28 3 93 22 94 95 20 35 1 13
|
|
||||||
Card 73: 21 39 86 8 13 66 61 67 96 28 | 20 17 24 48 46 43 19 16 23 95 77 57 60 38 90 14 94 3 71 58 30 93 26 5 52
|
|
||||||
Card 74: 60 70 73 38 71 16 34 46 6 96 | 72 41 21 96 16 90 42 27 60 51 46 48 24 20 71 55 91 29 4 38 59 23 62 25 68
|
|
||||||
Card 75: 61 86 47 54 72 37 30 18 39 80 | 29 45 73 84 54 66 37 59 13 39 2 30 63 56 15 18 81 80 9 92 17 53 79 77 83
|
|
||||||
Card 76: 90 9 82 52 93 51 26 44 33 96 | 57 93 70 48 95 84 25 6 28 59 30 18 47 96 64 55 9 15 31 68 73 36 98 51 79
|
|
||||||
Card 77: 66 31 11 90 97 12 85 10 87 52 | 60 9 8 88 15 11 2 87 46 21 31 1 40 97 6 30 84 93 91 82 57 96 26 3 78
|
|
||||||
Card 78: 44 25 92 80 8 73 21 20 83 82 | 88 48 87 18 12 40 19 70 64 53 97 89 7 11 78 68 52 4 99 43 42 67 25 54 60
|
|
||||||
Card 79: 92 22 37 1 9 98 42 70 71 13 | 51 25 69 53 35 57 21 71 24 86 37 85 88 75 8 64 18 12 13 34 32 95 29 70 91
|
|
||||||
Card 80: 77 81 91 15 6 22 5 79 98 33 | 77 29 49 62 17 71 78 34 68 21 43 48 99 15 30 22 87 7 94 37 76 13 63 32 65
|
|
||||||
Card 81: 5 66 94 92 59 42 6 53 60 80 | 35 90 27 22 26 72 30 87 95 10 11 62 74 97 58 39 13 51 50 93 75 34 88 81 19
|
|
||||||
Card 82: 2 77 93 21 3 51 65 23 83 45 | 13 51 32 48 17 98 33 91 99 30 31 61 8 70 74 6 53 85 50 26 47 71 16 82 73
|
|
||||||
Card 83: 51 80 73 74 21 64 26 45 46 79 | 3 70 69 35 15 84 30 99 88 28 76 33 53 98 32 12 49 42 58 16 62 27 89 78 52
|
|
||||||
Card 84: 85 89 20 90 44 38 87 88 55 3 | 85 55 26 87 1 35 5 20 10 43 88 11 89 54 68 38 6 3 44 63 90 31 8 13 93
|
|
||||||
Card 85: 87 73 32 1 85 92 65 41 93 48 | 42 12 48 26 85 63 20 78 67 65 7 50 62 57 31 72 28 97 36 45 5 27 86 71 77
|
|
||||||
Card 86: 98 28 76 61 50 97 45 59 57 71 | 73 53 56 61 34 46 72 57 11 9 86 71 33 76 21 3 67 78 36 89 28 91 60 50 59
|
|
||||||
Card 87: 8 39 56 10 33 91 93 23 79 17 | 18 62 52 45 56 9 33 37 79 10 91 23 36 8 39 29 14 17 86 93 43 94 6 5 61
|
|
||||||
Card 88: 29 60 20 31 50 38 96 97 54 35 | 66 35 2 20 65 96 56 54 52 84 85 38 43 26 29 72 62 70 31 60 74 50 80 97 94
|
|
||||||
Card 89: 20 85 33 84 23 24 19 77 68 26 | 85 68 33 77 48 24 5 32 49 45 55 51 23 62 11 80 30 35 61 28 36 81 9 17 86
|
|
||||||
Card 90: 43 48 92 89 56 12 54 78 9 14 | 39 89 9 12 15 64 83 41 44 65 40 48 79 2 78 16 92 84 76 88 27 54 66 56 49
|
|
||||||
Card 91: 43 7 86 10 47 66 33 62 8 87 | 87 97 46 25 83 92 23 15 17 42 45 78 1 59 60 67 74 86 9 76 85 55 3 2 53
|
|
||||||
Card 92: 71 19 66 35 77 74 56 15 8 75 | 69 41 57 14 89 71 40 77 26 12 91 17 38 62 80 60 5 68 93 35 66 39 2 8 21
|
|
||||||
Card 93: 11 98 2 60 92 77 70 75 53 65 | 65 70 67 75 98 59 2 34 60 62 92 43 11 77 68 1 26 82 76 19 57 28 46 53 86
|
|
||||||
Card 94: 38 59 82 85 65 51 5 72 37 75 | 47 25 67 79 7 16 44 33 95 52 97 88 89 99 96 53 27 21 71 86 68 55 62 30 70
|
|
||||||
Card 95: 44 26 1 60 71 88 50 38 27 69 | 88 58 69 60 91 90 26 45 92 33 97 48 99 71 1 78 44 54 2 27 50 83 56 79 38
|
|
||||||
Card 96: 62 97 57 99 48 91 50 35 78 26 | 60 10 55 4 58 1 7 65 90 44 57 68 89 36 50 17 2 28 37 92 84 82 96 53 74
|
|
||||||
Card 97: 39 82 45 56 86 88 63 95 52 27 | 24 55 81 67 12 71 57 74 17 3 6 46 21 53 59 27 31 16 43 19 99 79 35 80 4
|
|
||||||
Card 98: 16 3 72 97 64 68 58 15 37 89 | 44 74 6 75 78 68 38 52 61 23 58 72 21 3 84 46 7 16 62 89 18 85 64 43 19
|
|
||||||
Card 99: 41 90 11 70 13 92 4 87 6 12 | 9 87 29 57 84 54 80 61 37 18 85 24 78 49 25 43 52 27 50 6 16 99 2 13 88
|
|
||||||
Card 100: 33 84 70 12 63 95 57 83 66 94 | 89 96 50 99 90 42 27 68 95 15 60 36 92 35 54 98 28 34 6 53 48 37 88 56 17
|
|
||||||
Card 101: 42 89 68 72 14 20 50 22 71 10 | 45 47 67 13 94 81 52 37 76 48 77 34 70 18 41 87 3 53 49 35 19 30 58 95 11
|
|
||||||
Card 102: 95 38 4 55 94 50 68 11 56 17 | 75 46 61 54 62 98 59 77 31 97 76 33 80 55 96 66 94 26 41 60 86 73 84 14 50
|
|
||||||
Card 103: 78 75 96 32 68 33 37 39 28 73 | 64 56 72 18 91 10 25 62 65 86 43 7 9 81 4 5 11 99 27 88 29 36 76 38 24
|
|
||||||
Card 104: 88 99 34 79 12 14 97 35 75 29 | 55 42 19 2 8 16 51 32 4 50 11 3 38 64 57 86 26 7 56 27 70 74 49 5 46
|
|
||||||
Card 105: 98 8 99 61 88 84 1 41 31 10 | 97 58 3 74 21 63 48 87 75 7 45 15 46 30 57 40 90 9 35 65 29 23 71 94 16
|
|
||||||
Card 106: 67 35 98 56 14 24 75 90 83 34 | 55 33 18 8 12 87 6 26 29 66 37 22 21 13 46 86 76 81 59 69 51 11 20 28 50
|
|
||||||
Card 107: 59 77 79 71 8 73 93 46 18 87 | 20 24 66 10 4 68 59 80 77 49 93 38 18 46 83 71 85 30 87 52 53 69 79 8 73
|
|
||||||
Card 108: 65 42 53 83 52 28 2 50 17 49 | 17 55 7 42 49 48 26 68 82 43 46 19 5 2 65 94 36 66 25 69 15 76 51 62 52
|
|
||||||
Card 109: 9 97 46 11 23 91 10 30 58 90 | 79 58 90 91 16 30 60 43 80 51 9 65 13 46 67 8 66 97 10 94 7 2 6 11 23
|
|
||||||
Card 110: 38 89 44 8 10 61 18 11 47 36 | 8 32 61 93 3 38 74 80 63 67 18 22 13 47 14 59 94 55 86 79 36 44 23 40 53
|
|
||||||
Card 111: 1 3 62 17 70 69 18 71 90 5 | 5 93 2 13 70 27 88 90 79 65 71 62 46 73 96 74 48 31 83 18 63 1 56 10 28
|
|
||||||
Card 112: 3 19 30 2 1 23 14 6 95 82 | 33 32 27 67 50 30 68 82 2 77 1 34 36 19 65 64 54 95 47 3 4 91 15 23 51
|
|
||||||
Card 113: 23 10 40 84 65 76 64 38 74 45 | 44 52 56 59 45 40 12 66 16 64 78 97 72 23 84 74 85 65 27 76 38 10 82 86 48
|
|
||||||
Card 114: 11 98 33 35 31 14 28 91 81 85 | 9 66 54 65 48 77 7 6 45 38 31 30 8 75 86 93 52 95 76 44 35 17 68 63 1
|
|
||||||
Card 115: 19 72 36 87 84 13 81 3 90 94 | 84 37 94 40 18 81 13 69 11 2 35 19 42 36 3 5 56 99 24 80 28 4 92 31 83
|
|
||||||
Card 116: 13 75 5 29 67 65 74 82 8 53 | 89 29 88 94 3 22 41 53 28 27 16 49 90 13 95 85 37 58 86 68 11 67 69 75 73
|
|
||||||
Card 117: 94 24 87 15 76 70 98 68 41 25 | 67 66 12 37 13 2 5 84 95 69 79 70 1 15 97 39 23 14 41 52 65 83 30 3 45
|
|
||||||
Card 118: 72 28 73 30 33 36 42 66 4 74 | 28 98 72 46 2 12 25 74 40 37 34 48 43 30 42 79 67 13 57 44 45 16 53 68 70
|
|
||||||
Card 119: 5 37 38 60 76 78 80 29 34 88 | 63 53 81 38 29 80 83 2 85 5 48 86 21 79 60 37 42 10 55 46 34 96 17 71 33
|
|
||||||
Card 120: 9 41 14 88 34 28 77 96 42 23 | 49 14 78 91 95 74 45 16 38 61 98 53 51 79 27 88 34 9 90 40 28 21 26 93 20
|
|
||||||
Card 121: 14 17 97 68 9 18 32 2 46 56 | 18 64 9 86 56 10 79 17 57 87 26 88 46 27 83 84 15 59 65 21 11 85 66 3 2
|
|
||||||
Card 122: 91 51 99 50 90 60 81 61 94 18 | 44 70 65 9 88 2 48 51 59 82 77 7 75 34 8 17 52 39 57 86 99 1 14 13 25
|
|
||||||
Card 123: 91 85 26 99 53 10 25 97 76 16 | 47 81 86 58 11 63 82 98 79 12 27 6 85 94 53 40 19 13 48 18 24 74 44 80 3
|
|
||||||
Card 124: 97 64 48 61 35 45 12 39 89 33 | 93 73 58 11 30 71 82 16 35 53 52 50 59 18 1 39 78 41 63 42 3 12 43 79 49
|
|
||||||
Card 125: 63 16 92 55 1 61 86 99 21 48 | 76 73 25 74 43 10 21 64 66 6 78 33 56 30 57 69 13 12 50 86 93 31 90 36 27
|
|
||||||
Card 126: 97 73 82 26 3 33 54 10 29 30 | 14 87 1 38 51 11 36 43 25 5 62 20 95 79 18 57 71 50 37 32 84 7 69 33 45
|
|
||||||
Card 127: 54 24 8 45 47 88 86 6 35 75 | 60 32 43 76 63 12 56 1 79 44 7 70 42 46 68 51 64 62 31 34 33 99 19 36 53
|
|
||||||
Card 128: 94 11 73 52 24 36 76 80 93 92 | 10 74 85 62 43 67 18 11 93 40 60 39 96 80 73 92 76 77 35 48 36 66 57 52 24
|
|
||||||
Card 129: 47 26 37 60 90 93 16 69 52 64 | 63 83 37 19 90 26 67 2 35 96 1 62 98 71 3 7 41 34 64 93 16 48 60 47 94
|
|
||||||
Card 130: 55 62 26 32 39 38 48 98 52 16 | 77 32 95 80 39 52 98 99 60 79 16 26 19 46 8 97 10 25 92 54 42 62 71 65 48
|
|
||||||
Card 131: 24 44 79 83 89 39 57 70 92 29 | 61 11 70 10 83 54 97 80 57 39 50 22 58 62 28 92 29 44 79 24 89 45 15 8 14
|
|
||||||
Card 132: 8 1 2 72 30 68 23 84 49 39 | 2 23 64 49 56 62 72 41 1 30 86 60 75 8 38 53 97 39 14 85 27 45 68 84 67
|
|
||||||
Card 133: 76 28 92 6 54 2 46 37 59 61 | 31 42 48 82 15 65 37 52 13 78 81 98 38 34 3 28 10 49 61 92 47 41 46 59 70
|
|
||||||
Card 134: 69 73 87 26 2 63 1 41 88 96 | 13 1 19 97 72 37 80 89 39 23 95 66 69 98 25 74 46 38 67 43 68 40 91 10 36
|
|
||||||
Card 135: 76 99 25 95 57 93 83 33 62 44 | 9 49 88 45 64 50 87 56 5 24 57 60 96 67 61 26 75 23 18 19 16 81 46 54 32
|
|
||||||
Card 136: 78 40 11 33 70 76 67 50 56 59 | 18 29 75 99 76 32 56 30 33 70 87 60 78 14 50 80 21 40 65 11 91 67 53 97 59
|
|
||||||
Card 137: 90 76 40 18 64 17 13 41 27 34 | 58 3 50 94 10 74 79 69 6 33 78 29 28 96 49 38 60 2 62 72 83 43 54 92 93
|
|
||||||
Card 138: 55 50 90 4 58 12 61 60 99 43 | 64 46 75 41 8 53 24 77 51 11 74 91 32 62 93 35 38 1 14 47 48 67 96 49 22
|
|
||||||
Card 139: 85 43 37 22 62 2 39 34 38 4 | 87 1 97 23 15 99 78 5 9 47 94 30 85 8 86 92 21 91 27 69 11 13 84 32 79
|
|
||||||
Card 140: 83 71 63 22 39 91 54 93 66 44 | 96 56 92 64 80 31 85 70 88 7 39 59 65 27 2 6 93 54 62 52 44 10 22 32 79
|
|
||||||
Card 141: 57 50 28 29 97 79 64 54 43 35 | 98 40 62 42 20 83 33 82 30 91 80 10 99 41 87 66 92 14 7 67 85 22 8 97 51
|
|
||||||
Card 142: 70 38 32 83 21 44 71 36 56 3 | 84 47 62 20 22 86 41 30 38 67 77 49 61 50 8 90 2 88 69 24 53 4 80 73 52
|
|
||||||
Card 143: 61 49 17 60 20 69 2 9 13 1 | 54 10 18 89 26 52 27 73 63 71 48 60 1 17 4 84 66 45 13 3 8 72 29 37 50
|
|
||||||
Card 144: 95 58 31 44 62 5 6 9 69 3 | 55 88 13 28 62 36 35 54 23 24 46 49 53 69 97 1 20 74 30 95 72 29 66 78 39
|
|
||||||
Card 145: 10 25 94 63 11 96 55 61 9 8 | 32 48 37 85 82 72 63 26 24 91 43 17 15 65 8 23 93 70 51 58 76 77 53 31 61
|
|
||||||
Card 146: 8 55 37 91 72 20 53 76 60 39 | 70 75 89 46 92 45 10 79 16 82 61 19 21 7 13 22 54 1 81 50 98 15 85 33 2
|
|
||||||
Card 147: 15 72 61 77 66 10 31 26 59 75 | 4 3 7 32 54 73 30 21 60 77 55 63 23 29 40 97 62 10 76 14 80 51 18 70 49
|
|
||||||
Card 148: 14 11 9 38 16 51 18 32 97 46 | 58 52 25 37 29 57 1 22 93 94 81 95 27 73 72 13 49 33 20 31 42 62 3 76 77
|
|
||||||
Card 149: 16 17 18 31 63 39 57 73 8 34 | 55 99 20 84 76 97 46 81 52 26 5 29 96 25 9 12 66 72 10 89 1 15 70 60 75
|
|
||||||
Card 150: 75 51 17 56 61 52 27 12 18 4 | 10 5 20 28 53 82 22 69 79 89 31 32 14 39 72 2 58 97 54 83 91 70 15 74 65
|
|
||||||
Card 151: 7 43 8 44 58 93 36 13 69 11 | 48 93 42 4 56 11 71 52 72 36 25 14 55 58 67 28 97 82 62 31 79 53 2 51 69
|
|
||||||
Card 152: 67 4 77 16 31 97 41 40 39 23 | 52 9 16 45 31 47 41 4 5 50 39 51 66 69 53 37 67 83 97 77 75 23 29 25 42
|
|
||||||
Card 153: 7 80 4 25 94 99 83 34 37 69 | 10 67 82 39 8 65 89 57 45 9 59 43 29 61 88 74 11 90 70 1 92 19 78 77 41
|
|
||||||
Card 154: 46 8 45 40 5 72 21 11 27 73 | 83 98 46 33 91 71 61 85 27 45 24 12 21 36 11 54 75 8 76 73 69 40 34 70 10
|
|
||||||
Card 155: 5 68 92 86 58 19 93 45 3 38 | 40 13 71 96 80 25 41 73 92 82 21 43 42 24 3 39 4 99 29 20 55 35 12 75 59
|
|
||||||
Card 156: 4 44 95 99 28 65 66 89 85 59 | 69 60 13 58 66 40 18 30 92 86 71 85 90 65 44 2 59 89 55 94 4 26 99 95 28
|
|
||||||
Card 157: 5 67 81 91 85 20 75 37 12 16 | 94 98 22 90 99 18 38 95 23 69 6 16 96 35 3 86 9 56 26 48 79 24 34 54 91
|
|
||||||
Card 158: 90 23 70 11 94 36 31 61 13 19 | 7 45 36 11 81 47 50 69 21 2 18 67 27 72 61 8 24 38 13 52 75 9 79 65 19
|
|
||||||
Card 159: 98 5 17 32 20 22 72 86 26 81 | 76 80 33 35 45 70 86 63 88 87 91 53 64 51 74 29 75 27 42 4 34 90 31 18 14
|
|
||||||
Card 160: 76 11 61 84 56 31 42 26 3 85 | 62 85 48 47 61 82 42 36 43 58 91 93 5 16 87 18 37 15 39 29 49 86 22 84 17
|
|
||||||
Card 161: 14 88 6 50 59 86 57 94 10 60 | 33 60 87 49 23 64 42 54 71 56 65 50 39 10 16 13 80 69 22 83 9 85 17 47 88
|
|
||||||
Card 162: 83 92 59 68 33 17 26 46 99 22 | 5 78 85 26 62 53 48 38 51 57 73 75 60 99 84 89 17 54 59 18 23 9 87 14 21
|
|
||||||
Card 163: 15 88 91 71 26 12 49 63 97 45 | 1 61 93 32 14 53 56 84 29 25 89 44 27 35 13 80 75 54 49 70 36 65 86 78 46
|
|
||||||
Card 164: 50 77 98 33 3 42 91 78 53 36 | 54 87 70 6 49 43 8 68 89 84 3 97 36 40 34 16 55 66 44 93 10 51 38 74 76
|
|
||||||
Card 165: 66 98 52 64 26 45 12 83 57 70 | 9 32 51 73 48 94 68 46 24 87 63 78 27 86 45 79 52 54 65 53 37 75 41 97 89
|
|
||||||
Card 166: 43 8 23 29 84 19 92 58 73 32 | 65 15 88 62 90 1 36 71 68 57 66 39 91 53 10 35 16 50 85 49 25 46 74 34 13
|
|
||||||
Card 167: 35 39 75 42 54 60 40 58 79 32 | 36 94 10 1 49 51 15 62 19 65 5 45 17 85 30 73 20 37 26 67 64 97 16 50 89
|
|
||||||
Card 168: 48 55 26 40 15 64 58 77 1 16 | 28 85 92 25 56 69 46 88 10 98 73 84 70 79 72 63 74 27 68 87 76 78 21 83 97
|
|
||||||
Card 169: 38 34 64 41 11 37 48 24 14 94 | 62 98 75 40 46 12 48 34 64 14 94 42 33 86 35 37 24 38 73 30 45 11 3 6 41
|
|
||||||
Card 170: 56 31 25 98 94 49 9 42 18 2 | 38 58 71 57 49 98 9 18 80 20 46 44 54 56 40 92 25 31 2 72 30 42 4 73 94
|
|
||||||
Card 171: 40 79 27 54 30 43 23 4 76 42 | 4 18 47 29 31 79 59 9 98 23 57 75 85 21 1 61 14 53 54 28 68 77 44 66 80
|
|
||||||
Card 172: 40 93 79 51 16 39 1 61 80 73 | 96 87 49 90 17 12 3 69 34 62 7 55 52 57 23 72 20 86 22 74 46 42 5 2 8
|
|
||||||
Card 173: 50 45 56 47 13 89 59 32 40 92 | 49 36 2 13 52 11 35 41 96 68 89 12 60 82 86 56 40 58 37 16 32 39 45 27 92
|
|
||||||
Card 174: 99 38 67 55 93 51 36 88 63 78 | 27 38 70 95 56 58 86 55 66 79 60 52 30 88 26 39 99 97 67 31 17 61 44 43 53
|
|
||||||
Card 175: 93 6 27 45 14 49 11 8 12 90 | 3 93 36 33 44 45 56 98 24 14 27 13 12 90 85 49 5 11 70 47 69 20 52 8 6
|
|
||||||
Card 176: 80 97 64 46 53 76 65 73 18 95 | 54 73 57 4 43 32 95 60 65 21 31 29 37 23 45 82 72 79 56 34 50 97 87 9 25
|
|
||||||
Card 177: 8 3 62 40 90 23 45 93 27 73 | 3 59 1 92 67 71 62 37 2 29 93 27 90 68 72 12 35 51 44 16 95 96 48 21 8
|
|
||||||
Card 178: 22 50 59 56 36 8 62 74 52 68 | 28 97 36 74 50 93 20 98 33 90 79 11 39 22 14 35 52 63 21 34 56 17 47 59 8
|
|
||||||
Card 179: 68 81 47 3 82 89 17 90 49 5 | 68 2 9 76 44 80 17 86 59 49 12 3 81 89 5 84 87 18 66 82 38 14 37 24 48
|
|
||||||
Card 180: 82 91 64 68 39 21 97 1 84 99 | 2 8 97 71 60 68 40 75 84 82 42 1 9 3 59 38 67 52 17 72 61 27 53 76 70
|
|
||||||
Card 181: 15 63 14 90 65 33 20 4 86 88 | 12 77 91 46 27 1 10 76 55 59 56 2 40 51 9 62 34 20 74 71 49 30 54 4 86
|
|
||||||
Card 182: 67 87 26 58 15 13 99 6 70 62 | 21 56 77 11 75 10 2 91 64 35 27 4 8 38 45 72 51 7 65 49 54 39 82 88 83
|
|
||||||
Card 183: 69 84 68 67 65 45 25 9 15 91 | 79 68 15 69 66 50 84 76 56 45 42 35 52 17 90 71 1 10 3 7 98 65 9 64 27
|
|
||||||
Card 184: 40 99 5 33 95 72 64 25 2 47 | 5 38 37 98 6 42 56 8 43 24 58 86 44 63 26 72 67 33 95 2 25 85 66 55 48
|
|
||||||
Card 185: 89 31 98 23 68 79 25 2 10 97 | 54 47 36 8 86 40 33 28 26 55 66 99 31 25 3 97 89 13 60 74 58 51 80 84 68
|
|
||||||
Card 186: 60 91 49 61 78 93 24 82 16 3 | 46 50 17 96 12 59 11 26 32 41 38 53 19 99 81 25 20 58 52 13 87 14 80 74 34
|
|
||||||
Card 187: 73 79 8 83 16 62 5 36 77 15 | 32 48 39 64 38 85 50 49 84 19 58 7 86 24 21 30 56 61 72 11 80 68 23 66 34
|
|
||||||
Card 188: 25 24 6 89 90 55 83 69 58 95 | 9 82 40 96 37 3 91 11 77 7 74 93 51 73 5 19 98 75 54 18 28 10 70 36 30
|
|
||||||
Card 189: 19 40 78 79 20 99 59 41 89 84 | 30 20 67 16 93 42 22 47 95 25 50 71 62 35 85 70 46 74 7 52 75 24 66 61 28
|
|
||||||
Card 190: 46 23 88 70 14 62 28 78 74 27 | 67 10 42 9 11 6 75 87 73 54 68 76 39 83 95 49 18 5 20 19 13 97 63 37 12
|
|
||||||
Card 191: 90 35 49 38 70 92 58 86 2 93 | 67 87 39 9 64 62 54 75 37 6 56 72 42 96 48 84 18 99 33 19 3 76 11 23 74
|
|
||||||
Card 192: 5 2 17 72 34 86 78 25 67 75 | 7 34 99 91 36 5 14 86 65 75 16 47 25 62 60 98 67 2 22 64 72 74 17 41 78
|
|
||||||
Card 193: 56 53 16 30 13 21 78 7 45 68 | 78 7 13 20 1 81 69 76 53 71 68 86 58 27 90 30 45 80 16 95 49 21 56 31 8
|
|
||||||
Card 194: 20 81 99 68 19 43 34 48 24 13 | 99 23 72 20 47 88 90 48 14 78 59 81 43 68 44 32 49 57 19 24 39 61 13 95 34
|
|
||||||
Card 195: 38 21 8 62 68 50 32 31 92 11 | 32 30 62 38 1 28 21 92 61 73 19 50 49 86 66 60 68 43 31 11 57 82 6 47 8
|
|
||||||
Card 196: 94 60 26 40 86 38 34 63 88 62 | 3 20 69 49 16 65 4 12 19 2 13 86 6 75 38 50 22 17 28 64 29 88 72 98 52
|
|
||||||
Card 197: 10 95 30 68 35 36 84 48 57 41 | 70 74 76 56 77 31 25 86 54 91 55 2 57 97 26 44 12 23 15 13 50 10 82 65 98
|
|
||||||
Card 198: 75 36 27 87 31 34 77 74 95 69 | 75 11 36 70 69 34 45 16 43 61 95 27 81 85 77 29 74 31 87 8 49 94 37 40 3
|
|
||||||
Card 199: 16 63 44 31 14 38 46 81 64 94 | 48 78 83 19 52 91 96 51 11 1 66 45 14 61 8 16 5 99 55 54 79 4 71 41 60
|
|
||||||
Card 200: 6 38 13 5 89 32 29 52 48 58 | 29 1 86 79 55 28 98 44 89 4 21 84 3 20 71 48 95 72 14 69 31 39 6 33 13
|
|
||||||
Card 201: 93 62 78 75 26 45 90 92 7 9 | 58 57 32 56 45 52 26 99 28 30 35 2 24 33 8 67 97 65 60 21 15 98 78 23 38
|
|
||||||
Card 202: 11 72 93 47 60 35 85 78 26 20 | 64 76 9 13 31 3 4 90 33 73 63 70 25 30 29 98 7 71 92 68 99 74 52 43 62
|
|
||||||
Card 203: 88 3 9 18 73 10 87 65 17 42 | 33 80 20 61 44 96 6 88 10 47 72 99 71 50 95 21 87 17 34 81 51 2 65 19 36
|
|
||||||
Card 204: 28 8 64 35 68 84 51 1 58 53 | 68 76 79 75 18 89 90 69 25 72 58 71 83 56 82 32 93 99 16 53 64 6 84 86 98
|
|
||||||
Card 205: 45 41 57 2 55 54 96 19 46 89 | 13 64 57 20 72 27 21 81 40 75 22 61 46 99 68 89 82 42 67 55 70 39 78 88 15
|
|
||||||
Card 206: 42 38 95 66 18 93 79 45 49 37 | 80 61 43 70 31 17 13 16 49 73 20 44 90 5 39 97 82 15 68 14 57 21 72 35 79
|
|
||||||
Card 207: 91 28 69 89 54 6 60 19 44 77 | 27 94 51 47 46 84 99 31 16 58 92 80 67 95 73 5 12 88 40 18 41 72 24 93 39
|
|
||||||
Card 208: 9 37 78 74 26 99 76 48 16 54 | 98 46 20 92 83 52 1 44 84 41 61 66 74 70 69 71 18 68 77 24 49 31 6 25 50
|
|
||||||
Card 209: 2 10 11 47 25 81 75 61 27 4 | 79 45 43 29 55 16 91 68 88 52 90 21 13 37 59 31 5 1 14 17 86 84 64 60 70
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
# Day 4 Puzzle Text.
|
|
||||||
|
|
||||||
--- Day 4: Scratchcards ---
|
|
||||||
The gondola takes you up. Strangely, though, the ground doesn't seem to be coming with you; you're not climbing a mountain. As the circle of Snow Island recedes below you, an entire new landmass suddenly appears above you! The gondola carries you to the surface of the new island and lurches into the station.
|
|
||||||
|
|
||||||
As you exit the gondola, the first thing you notice is that the air here is much warmer than it was on Snow Island. It's also quite humid. Is this where the water source is?
|
|
||||||
|
|
||||||
The next thing you notice is an Elf sitting on the floor across the station in what seems to be a pile of colorful square cards.
|
|
||||||
|
|
||||||
"Oh! Hello!" The Elf excitedly runs over to you. "How may I be of service?" You ask about water sources.
|
|
||||||
|
|
||||||
"I'm not sure; I just operate the gondola lift. That does sound like something we'd have, though - this is Island Island, after all! I bet the gardener would know. He's on a different island, though - er, the small kind surrounded by water, not the floating kind. We really need to come up with a better naming scheme. Tell you what: if you can help me with something quick, I'll let you borrow my boat and you can go visit the gardener. I got all these scratchcards as a gift, but I can't figure out what I've won."
|
|
||||||
|
|
||||||
The Elf leads you over to the pile of colorful cards. There, you discover dozens of scratchcards, all with their opaque covering already scratched off. Picking one up, it looks like each card has two lists of numbers separated by a vertical bar (|): a list of winning numbers and then a list of numbers you have. You organize the information into a table (your puzzle input).
|
|
||||||
|
|
||||||
As far as the Elf has been able to figure out, you have to figure out which of the numbers you have appear in the list of winning numbers. The first match makes the card worth one point and each match after the first doubles the point value of that card.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
```
|
|
||||||
Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53
|
|
||||||
Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19
|
|
||||||
Card 3: 1 21 53 59 44 | 69 82 63 72 16 21 14 1
|
|
||||||
Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83
|
|
||||||
Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36
|
|
||||||
Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11
|
|
||||||
```
|
|
||||||
In the above example, card 1 has five winning numbers (41, 48, 83, 86, and 17) and eight numbers you have (83, 86, 6, 31, 17, 9, 48, and 53). Of the numbers you have, four of them (48, 83, 17, and 86) are winning numbers! That means card 1 is worth 8 points (1 for the first match, then doubled three times for each of the three matches after the first).
|
|
||||||
|
|
||||||
Card 2 has two winning numbers (32 and 61), so it is worth 2 points.
|
|
||||||
Card 3 has two winning numbers (1 and 21), so it is worth 2 points.
|
|
||||||
Card 4 has one winning number (84), so it is worth 1 point.
|
|
||||||
Card 5 has no winning numbers, so it is worth no points.
|
|
||||||
Card 6 has no winning numbers, so it is worth no points.
|
|
||||||
So, in this example, the Elf's pile of scratchcards is worth 13 points.
|
|
||||||
|
|
||||||
Take a seat in the large pile of colorful cards. How many points are they worth in total?
|
|
||||||
|
|
||||||
--- Part Two ---
|
|
||||||
Just as you're about to report your findings to the Elf, one of you realizes that the rules have actually been printed on the back of every card this whole time.
|
|
||||||
|
|
||||||
There's no such thing as "points". Instead, scratchcards only cause you to win more scratchcards equal to the number of winning numbers you have.
|
|
||||||
|
|
||||||
Specifically, you win copies of the scratchcards below the winning card equal to the number of matches. So, if card 10 were to have 5 matching numbers, you would win one copy each of cards 11, 12, 13, 14, and 15.
|
|
||||||
|
|
||||||
Copies of scratchcards are scored like normal scratchcards and have the same card number as the card they copied. So, if you win a copy of card 10 and it has 5 matching numbers, it would then win a copy of the same cards that the original card 10 won: cards 11, 12, 13, 14, and 15. This process repeats until none of the copies cause you to win any more cards. (Cards will never make you copy a card past the end of the table.)
|
|
||||||
|
|
||||||
This time, the above example goes differently:
|
|
||||||
```
|
|
||||||
Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53
|
|
||||||
Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19
|
|
||||||
Card 3: 1 21 53 59 44 | 69 82 63 72 16 21 14 1
|
|
||||||
Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83
|
|
||||||
Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36
|
|
||||||
Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11
|
|
||||||
```
|
|
||||||
Card 1 has four matching numbers, so you win one copy each of the next four cards: cards 2, 3, 4, and 5.
|
|
||||||
Your original card 2 has two matching numbers, so you win one copy each of cards 3 and 4.
|
|
||||||
Your copy of card 2 also wins one copy each of cards 3 and 4.
|
|
||||||
Your four instances of card 3 (one original and three copies) have two matching numbers, so you win four copies each of cards 4 and 5.
|
|
||||||
Your eight instances of card 4 (one original and seven copies) have one matching number, so you win eight copies of card 5.
|
|
||||||
Your fourteen instances of card 5 (one original and thirteen copies) have no matching numbers and win no more cards.
|
|
||||||
Your one instance of card 6 (one original) has no matching numbers and wins no more cards.
|
|
||||||
Once all of the originals and copies have been processed, you end up with 1 instance of card 1, 2 instances of card 2, 4 instances of card 3, 8 instances of card 4, 14 instances of card 5, and 1 instance of card 6. In total, this example pile of scratchcards causes you to ultimately have 30 scratchcards!
|
|
||||||
|
|
||||||
Process all of the original and copied scratchcards until no more scratchcards are won. Including the original set of scratchcards, how many total scratchcards do you end up with?
|
|
||||||
@@ -1,207 +0,0 @@
|
|||||||
seeds: 104847962 3583832 1212568077 114894281 3890048781 333451605 1520059863 217361990 310308287 12785610 3492562455 292968049 1901414562 516150861 2474299950 152867148 3394639029 59690410 862612782 176128197
|
|
||||||
|
|
||||||
seed-to-soil map:
|
|
||||||
2023441036 2044296880 396074363
|
|
||||||
2419515399 3839972576 454994720
|
|
||||||
274688417 699823315 258919718
|
|
||||||
533608135 0 431744151
|
|
||||||
965352286 431744151 161125324
|
|
||||||
3391658630 2936663910 903308666
|
|
||||||
200749950 1177785526 73938467
|
|
||||||
2874510119 1440389999 315892137
|
|
||||||
1916089471 2440371243 20593195
|
|
||||||
0 977035576 200749950
|
|
||||||
1936682666 1957538510 86758370
|
|
||||||
1440389999 2902130623 34533287
|
|
||||||
1126477610 592869475 106953840
|
|
||||||
3190402256 1756282136 201256374
|
|
||||||
1474923286 2460964438 441166185
|
|
||||||
1233431450 958743033 18292543
|
|
||||||
|
|
||||||
soil-to-fertilizer map:
|
|
||||||
1479837493 1486696129 480988794
|
|
||||||
3637384566 3730606485 267472485
|
|
||||||
70483107 174821741 921411492
|
|
||||||
3586173142 3071290434 51211424
|
|
||||||
1960826287 1166716340 319979789
|
|
||||||
3952751562 3398939385 283772589
|
|
||||||
0 1096233233 70483107
|
|
||||||
1166716340 1967684923 313121153
|
|
||||||
3904857051 3682711974 47894511
|
|
||||||
2902018973 3122501858 276437527
|
|
||||||
991894599 0 174821741
|
|
||||||
3416901681 2902018973 169271461
|
|
||||||
3178456500 3998078970 238445181
|
|
||||||
|
|
||||||
fertilizer-to-water map:
|
|
||||||
4274676882 2765984054 20290414
|
|
||||||
3642266392 2324011621 382224743
|
|
||||||
3159410287 4157769177 137198119
|
|
||||||
3437898965 2786274468 204367427
|
|
||||||
2136710407 1497332580 94233249
|
|
||||||
4121681656 2706236364 59747690
|
|
||||||
2362529584 1912615374 411396247
|
|
||||||
4181429346 3961317447 93247536
|
|
||||||
270199336 152334204 473273308
|
|
||||||
1977000445 3853228854 108088593
|
|
||||||
2085089038 1304420652 51621369
|
|
||||||
1407624846 2990641895 345516575
|
|
||||||
908901118 638701782 307729932
|
|
||||||
3296608406 1356042021 141290559
|
|
||||||
743472644 625607512 13094270
|
|
||||||
2230943656 3721642926 131585928
|
|
||||||
0 946431714 270199336
|
|
||||||
2773925831 3336158470 385484456
|
|
||||||
4024491135 1815424853 97190521
|
|
||||||
756566914 0 152334204
|
|
||||||
1304420652 4054564983 103204194
|
|
||||||
1753141421 1591565829 223859024
|
|
||||||
|
|
||||||
water-to-light map:
|
|
||||||
139728365 0 27290780
|
|
||||||
4161521920 2345099742 65970280
|
|
||||||
3549264451 2411070022 15588060
|
|
||||||
846553766 4012820620 62155872
|
|
||||||
3276913175 3215861697 30588309
|
|
||||||
7256118 139495191 27523954
|
|
||||||
3653026602 3908255344 104565276
|
|
||||||
2007806695 3246450006 21131889
|
|
||||||
426542603 2677155019 292403006
|
|
||||||
3265259672 4167732422 11653503
|
|
||||||
2959802238 3267581895 77570040
|
|
||||||
2766290955 2562319792 114835227
|
|
||||||
779480399 3352881787 3460872
|
|
||||||
718945609 995514267 33385697
|
|
||||||
908709638 1675494216 164534584
|
|
||||||
1547970680 1643941067 31553149
|
|
||||||
1579523829 2009572806 335526936
|
|
||||||
782941271 2969558025 63612495
|
|
||||||
752331306 465171569 27149093
|
|
||||||
237284175 1454682639 189258428
|
|
||||||
3757591878 3724399189 59699158
|
|
||||||
2881126182 3784098347 78676056
|
|
||||||
1520219770 2426658082 27750910
|
|
||||||
3564852511 1366508548 88174091
|
|
||||||
2383999106 3681454004 42945185
|
|
||||||
4287237444 3345151935 7729852
|
|
||||||
2242562254 3649815914 31638090
|
|
||||||
3307501484 753751300 241762967
|
|
||||||
34780072 27290780 104948293
|
|
||||||
2028938584 3033170520 182691177
|
|
||||||
3037372278 237284175 227887394
|
|
||||||
3817291036 3356342659 5821939
|
|
||||||
0 132239073 7256118
|
|
||||||
1360895538 1266240382 51601463
|
|
||||||
3823112975 492320662 230498145
|
|
||||||
2274200344 1840028800 109798762
|
|
||||||
4053611120 2454408992 107910800
|
|
||||||
2426944291 1317841845 48666703
|
|
||||||
1073244222 3362164598 287651316
|
|
||||||
1457977942 1203998554 62241828
|
|
||||||
2591192365 1028899964 175098590
|
|
||||||
1412497001 3862774403 45480941
|
|
||||||
2475610994 4179385925 115581371
|
|
||||||
4227492200 1949827562 59745244
|
|
||||||
1915050765 4074976492 92755930
|
|
||||||
2211629761 722818807 30932493
|
|
||||||
|
|
||||||
light-to-temperature map:
|
|
||||||
3741602262 2758947303 142653736
|
|
||||||
628739598 2901601039 50811783
|
|
||||||
1842260329 1084521599 145122645
|
|
||||||
2990409993 3493390513 390865485
|
|
||||||
4190333929 4159289690 83510514
|
|
||||||
984282519 2952412822 202948629
|
|
||||||
1826968660 3155361451 15291669
|
|
||||||
1329953386 2288178120 328046945
|
|
||||||
830513455 3304469747 74190775
|
|
||||||
1187231148 2616225065 142722238
|
|
||||||
2705943734 836690664 247830935
|
|
||||||
3381275478 1332397059 281233458
|
|
||||||
679551381 605080109 150962074
|
|
||||||
1987382974 756042183 44013157
|
|
||||||
4159289690 4263923057 31044239
|
|
||||||
1772730322 3250231409 54238338
|
|
||||||
2549609472 2131843858 156334262
|
|
||||||
1658000331 3378660522 114729991
|
|
||||||
298584178 195831363 330155420
|
|
||||||
3662508936 525986783 79093326
|
|
||||||
4273844443 4242800204 21122853
|
|
||||||
2953774669 800055340 36635324
|
|
||||||
2031396131 1613630517 518213341
|
|
||||||
265644560 162891745 32939618
|
|
||||||
162891745 1229644244 102752815
|
|
||||||
904704230 3170653120 79578289
|
|
||||||
|
|
||||||
temperature-to-humidity map:
|
|
||||||
671484955 1144907174 532089323
|
|
||||||
1414132335 1960778188 125717021
|
|
||||||
2631474761 2586973888 1058655511
|
|
||||||
1991131055 744338927 221864400
|
|
||||||
2212995455 192320896 28611061
|
|
||||||
192320896 2186552402 224875394
|
|
||||||
2241895588 966203327 169532208
|
|
||||||
1744764149 431490014 67442815
|
|
||||||
1812206964 2106058626 80493776
|
|
||||||
516655377 1135735535 9171639
|
|
||||||
1559412773 1775426812 185351376
|
|
||||||
2622156499 2577655626 9318262
|
|
||||||
1203574278 220931957 210558057
|
|
||||||
3690130272 4094120212 156346211
|
|
||||||
3946017132 3645629399 348950164
|
|
||||||
525827016 598680988 145657939
|
|
||||||
1892700740 1676996497 98430315
|
|
||||||
3846476483 3994579563 99540649
|
|
||||||
2577655626 4250466423 44500873
|
|
||||||
1539849356 2086495209 19563417
|
|
||||||
2241606516 598391916 289072
|
|
||||||
417196290 498932829 99459087
|
|
||||||
|
|
||||||
humidity-to-location map:
|
|
||||||
547577859 2546258172 54451455
|
|
||||||
2564186976 3913248498 28610653
|
|
||||||
2460249359 129990669 103937617
|
|
||||||
257798579 3257354132 21143365
|
|
||||||
511274864 3365252234 24536388
|
|
||||||
412475023 3389788622 98799841
|
|
||||||
2843712442 3615348771 251219053
|
|
||||||
0 2984989380 24111266
|
|
||||||
1074541266 4051128852 126947592
|
|
||||||
3109497668 265707418 9056683
|
|
||||||
3268495430 1450483293 18654108
|
|
||||||
1298820860 954974424 392849235
|
|
||||||
1691670095 1469137401 93027519
|
|
||||||
3886041222 2131196811 39611681
|
|
||||||
2797706800 1347823659 46005642
|
|
||||||
3767841776 233928286 19835810
|
|
||||||
743957513 253764096 11943322
|
|
||||||
4068806743 3941859151 109269701
|
|
||||||
2754107115 1910801576 16288912
|
|
||||||
1223331059 2244121482 75489801
|
|
||||||
3118554351 1393829301 56653992
|
|
||||||
3094931495 3009100646 14566173
|
|
||||||
3991994741 893524279 61450145
|
|
||||||
692486724 2192650693 51470789
|
|
||||||
1008564686 2952439802 32549578
|
|
||||||
535811252 3603582164 11766607
|
|
||||||
1784697614 2698363640 44335967
|
|
||||||
755900835 2353038285 193219887
|
|
||||||
278941944 1777268497 133533079
|
|
||||||
3925652903 3488588463 66341838
|
|
||||||
3558101581 2742699607 209740195
|
|
||||||
949120722 3305808270 59443964
|
|
||||||
2624116446 0 129990669
|
|
||||||
1939852817 274764101 520396542
|
|
||||||
3175208343 2037909724 93287087
|
|
||||||
3287149538 2600709627 97654013
|
|
||||||
650681177 1562164920 41805547
|
|
||||||
3787677586 795160643 98363636
|
|
||||||
1829033581 1927090488 110819236
|
|
||||||
4053444886 3897886641 15361857
|
|
||||||
1201488858 2170808492 21842201
|
|
||||||
3384803551 1603970467 173298030
|
|
||||||
2770396027 3278497497 27310773
|
|
||||||
1041114264 2319611283 33427002
|
|
||||||
602029314 3554930301 48651863
|
|
||||||
2592797629 3866567824 31318817
|
|
||||||
24111266 3023666819 233687313
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
# Day 5 Puzzle Text.
|
|
||||||
--- Day 5: If You Give A Seed A Fertilizer ---
|
|
||||||
You take the boat and find the gardener right where you were told he would be: managing a giant "garden" that looks more to you like a farm.
|
|
||||||
|
|
||||||
"A water source? Island Island is the water source!" You point out that Snow Island isn't receiving any water.
|
|
||||||
|
|
||||||
"Oh, we had to stop the water because we ran out of sand to filter it with! Can't make snow with dirty water. Don't worry, I'm sure we'll get more sand soon; we only turned off the water a few days... weeks... oh no." His face sinks into a look of horrified realization.
|
|
||||||
|
|
||||||
"I've been so busy making sure everyone here has food that I completely forgot to check why we stopped getting more sand! There's a ferry leaving soon that is headed over in that direction - it's much faster than your boat. Could you please go check it out?"
|
|
||||||
|
|
||||||
You barely have time to agree to this request when he brings up another. "While you wait for the ferry, maybe you can help us with our food production problem. The latest Island Island Almanac just arrived and we're having trouble making sense of it."
|
|
||||||
|
|
||||||
The almanac (your puzzle input) lists all of the seeds that need to be planted. It also lists what type of soil to use with each kind of seed, what type of fertilizer to use with each kind of soil, what type of water to use with each kind of fertilizer, and so on. Every type of seed, soil, fertilizer and so on is identified with a number, but numbers are reused by each category - that is, soil 123 and fertilizer 123 aren't necessarily related to each other.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
```
|
|
||||||
seeds: 79 14 55 13
|
|
||||||
|
|
||||||
seed-to-soil map:
|
|
||||||
50 98 2
|
|
||||||
52 50 48
|
|
||||||
|
|
||||||
soil-to-fertilizer map:
|
|
||||||
0 15 37
|
|
||||||
37 52 2
|
|
||||||
39 0 15
|
|
||||||
|
|
||||||
fertilizer-to-water map:
|
|
||||||
49 53 8
|
|
||||||
0 11 42
|
|
||||||
42 0 7
|
|
||||||
57 7 4
|
|
||||||
|
|
||||||
water-to-light map:
|
|
||||||
88 18 7
|
|
||||||
18 25 70
|
|
||||||
|
|
||||||
light-to-temperature map:
|
|
||||||
45 77 23
|
|
||||||
81 45 19
|
|
||||||
68 64 13
|
|
||||||
|
|
||||||
temperature-to-humidity map:
|
|
||||||
0 69 1
|
|
||||||
1 0 69
|
|
||||||
|
|
||||||
humidity-to-location map:
|
|
||||||
60 56 37
|
|
||||||
56 93 4
|
|
||||||
```
|
|
||||||
The almanac starts by listing which seeds need to be planted: seeds 79, 14, 55, and 13.
|
|
||||||
|
|
||||||
The rest of the almanac contains a list of maps which describe how to convert numbers from a source category into numbers in a destination category. That is, the section that starts with seed-to-soil map: describes how to convert a seed number (the source) to a soil number (the destination). This lets the gardener and his team know which soil to use with which seeds, which water to use with which fertilizer, and so on.
|
|
||||||
|
|
||||||
Rather than list every source number and its corresponding destination number one by one, the maps describe entire ranges of numbers that can be converted. Each line within a map contains three numbers: the destination range start, the source range start, and the range length.
|
|
||||||
|
|
||||||
Consider again the example seed-to-soil map:
|
|
||||||
```
|
|
||||||
50 98 2
|
|
||||||
52 50 48
|
|
||||||
```
|
|
||||||
The first line has a destination range start of 50, a source range start of 98, and a range length of 2. This line means that the source range starts at 98 and contains two values: 98 and 99. The destination range is the same length, but it starts at 50, so its two values are 50 and 51. With this information, you know that seed number 98 corresponds to soil number 50 and that seed number 99 corresponds to soil number 51.
|
|
||||||
|
|
||||||
The second line means that the source range starts at 50 and contains 48 values: 50, 51, ..., 96, 97. This corresponds to a destination range starting at 52 and also containing 48 values: 52, 53, ..., 98, 99. So, seed number 53 corresponds to soil number 55.
|
|
||||||
|
|
||||||
Any source numbers that aren't mapped correspond to the same destination number. So, seed number 10 corresponds to soil number 10.
|
|
||||||
|
|
||||||
So, the entire list of seed numbers and their corresponding soil numbers looks like this:
|
|
||||||
```
|
|
||||||
seed soil
|
|
||||||
0 0
|
|
||||||
1 1
|
|
||||||
... ...
|
|
||||||
48 48
|
|
||||||
49 49
|
|
||||||
50 52
|
|
||||||
51 53
|
|
||||||
... ...
|
|
||||||
96 98
|
|
||||||
97 99
|
|
||||||
98 50
|
|
||||||
99 51
|
|
||||||
```
|
|
||||||
With this map, you can look up the soil number required for each initial seed number:
|
|
||||||
```
|
|
||||||
Seed number 79 corresponds to soil number 81.
|
|
||||||
Seed number 14 corresponds to soil number 14.
|
|
||||||
Seed number 55 corresponds to soil number 57.
|
|
||||||
Seed number 13 corresponds to soil number 13.
|
|
||||||
```
|
|
||||||
The gardener and his team want to get started as soon as possible, so they'd like to know the closest location that needs a seed. Using these maps, find the lowest location number that corresponds to any of the initial seeds. To do this, you'll need to convert each seed number through other categories until you can find its corresponding location number. In this example, the corresponding types are:
|
|
||||||
```
|
|
||||||
Seed 79, soil 81, fertilizer 81, water 81, light 74, temperature 78, humidity 78, location 82.
|
|
||||||
Seed 14, soil 14, fertilizer 53, water 49, light 42, temperature 42, humidity 43, location 43.
|
|
||||||
Seed 55, soil 57, fertilizer 57, water 53, light 46, temperature 82, humidity 82, location 86.
|
|
||||||
Seed 13, soil 13, fertilizer 52, water 41, light 34, temperature 34, humidity 35, location 35.
|
|
||||||
```
|
|
||||||
So, the lowest location number in this example is 35.
|
|
||||||
|
|
||||||
What is the lowest location number that corresponds to any of the initial seed numbers?
|
|
||||||
|
|
||||||
|
|
||||||
--- Part Two ---
|
|
||||||
Everyone will starve if you only plant such a small number of seeds. Re-reading the almanac, it looks like the seeds: line actually describes ranges of seed numbers.
|
|
||||||
|
|
||||||
The values on the initial seeds: line come in pairs. Within each pair, the first value is the start of the range and the second value is the length of the range. So, in the first line of the example above:
|
|
||||||
```
|
|
||||||
seeds: 79 14 55 13
|
|
||||||
```
|
|
||||||
This line describes two ranges of seed numbers to be planted in the garden. The first range starts with seed number 79 and contains 14 values: 79, 80, ..., 91, 92. The second range starts with seed number 55 and contains 13 values: 55, 56, ..., 66, 67.
|
|
||||||
|
|
||||||
Now, rather than considering four seed numbers, you need to consider a total of 27 seed numbers.
|
|
||||||
|
|
||||||
In the above example, the lowest location number can be obtained from seed number 82, which corresponds to soil 84, fertilizer 84, water 84, light 77, temperature 45, humidity 46, and location 46. So, the lowest location number is 46.
|
|
||||||
|
|
||||||
Consider all of the initial seed numbers listed in the ranges on the first line of the almanac. What is the lowest location number that corresponds to any of the initial seed numbers?
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Time: 44 82 69 81
|
|
||||||
Distance: 202 1076 1138 1458
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
# Day 6 Puzzle Text.
|
|
||||||
|
|
||||||
--- Day 6: Wait For It ---
|
|
||||||
The ferry quickly brings you across Island Island. After asking around, you discover that there is indeed normally a large pile of sand somewhere near here, but you don't see anything besides lots of water and the small island where the ferry has docked.
|
|
||||||
|
|
||||||
As you try to figure out what to do next, you notice a poster on a wall near the ferry dock. "Boat races! Open to the public! Grand prize is an all-expenses-paid trip to Desert Island!" That must be where the sand comes from! Best of all, the boat races are starting in just a few minutes.
|
|
||||||
|
|
||||||
You manage to sign up as a competitor in the boat races just in time. The organizer explains that it's not really a traditional race - instead, you will get a fixed amount of time during which your boat has to travel as far as it can, and you win if your boat goes the farthest.
|
|
||||||
|
|
||||||
As part of signing up, you get a sheet of paper (your puzzle input) that lists the time allowed for each race and also the best distance ever recorded in that race. To guarantee you win the grand prize, you need to make sure you go farther in each race than the current record holder.
|
|
||||||
|
|
||||||
The organizer brings you over to the area where the boat races are held. The boats are much smaller than you expected - they're actually toy boats, each with a big button on top. Holding down the button charges the boat, and releasing the button allows the boat to move. Boats move faster if their button was held longer, but time spent holding the button counts against the total race time. You can only hold the button at the start of the race, and boats don't move until the button is released.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
```
|
|
||||||
Time: 7 15 30
|
|
||||||
Distance: 9 40 200
|
|
||||||
```
|
|
||||||
This document describes three races:
|
|
||||||
|
|
||||||
- The first race lasts 7 milliseconds. The record distance in this race is 9 millimeters.
|
|
||||||
- The second race lasts 15 milliseconds. The record distance in this race is 40 millimeters.
|
|
||||||
- The third race lasts 30 milliseconds. The record distance in this race is 200 millimeters.
|
|
||||||
Your toy boat has a starting speed of zero millimeters per millisecond. For each whole millisecond you spend at the beginning of the race holding down the button, the boat's speed increases by one millimeter per millisecond.
|
|
||||||
|
|
||||||
So, because the first race lasts 7 milliseconds, you only have a few options:
|
|
||||||
|
|
||||||
Don't hold the button at all (that is, hold it for 0 milliseconds) at the start of the race. The boat won't move; it will have traveled 0 millimeters by the end of the race.
|
|
||||||
Hold the button for 1 millisecond at the start of the race. Then, the boat will travel at a speed of 1 millimeter per millisecond for 6 milliseconds, reaching a total distance traveled of 6 millimeters.
|
|
||||||
- Hold the button for 2 milliseconds, giving the boat a speed of 2 millimeters per millisecond. It will then get 5 milliseconds to move, reaching a total distance of 10 millimeters.
|
|
||||||
- Hold the button for 3 milliseconds. After its remaining 4 milliseconds of travel time, the boat will have gone 12 millimeters.
|
|
||||||
- Hold the button for 4 milliseconds. After its remaining 3 milliseconds of travel time, the boat will have gone 12 millimeters.
|
|
||||||
- Hold the button for 5 milliseconds, causing the boat to travel a total of 10 millimeters.
|
|
||||||
- Hold the button for 6 milliseconds, causing the boat to travel a total of 6 millimeters.
|
|
||||||
- Hold the button for 7 milliseconds. That's the entire duration of the race. You never let go of the button. The boat can't move until you let go of the button. Please make sure you let go of the button so the boat gets to move. 0 millimeters.
|
|
||||||
Since the current record for this race is 9 millimeters, there are actually 4 different ways you could win: you could hold the button for 2, 3, 4, or 5 milliseconds at the start of the race.
|
|
||||||
|
|
||||||
In the second race, you could hold the button for at least 4 milliseconds and at most 11 milliseconds and beat the record, a total of 8 different ways to win.
|
|
||||||
|
|
||||||
In the third race, you could hold the button for at least 11 milliseconds and no more than 19 milliseconds and still beat the record, a total of 9 ways you could win.
|
|
||||||
|
|
||||||
To see how much margin of error you have, determine the number of ways you can beat the record in each race; in this example, if you multiply these values together, you get 288 (4 * 8 * 9).
|
|
||||||
|
|
||||||
Determine the number of ways you could beat the record in each race. What do you get if you multiply these numbers together?
|
|
||||||
|
|
||||||
|
|
||||||
--- Part Two ---
|
|
||||||
As the race is about to start, you realize the piece of paper with race times and record distances you got earlier actually just has very bad kerning. There's really only one race - ignore the spaces between the numbers on each line.
|
|
||||||
|
|
||||||
So, the example from before:
|
|
||||||
|
|
||||||
Time: 7 15 30
|
|
||||||
Distance: 9 40 200
|
|
||||||
...now instead means this:
|
|
||||||
|
|
||||||
Time: 71530
|
|
||||||
Distance: 940200
|
|
||||||
Now, you have to figure out how many ways there are to win this single race. In this example, the race lasts for 71530 milliseconds and the record distance you need to beat is 940200 millimeters. You could hold the button anywhere from 14 to 71516 milliseconds and beat the record, a total of 71503 ways!
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,56 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 7: Camel Cards ---</h2><p>Your all-expenses-paid trip turns out to be a one-way, five-minute ride in an <a href="https://en.wikipedia.org/wiki/Airship" target="_blank">airship</a>. (At least it's a <span title="Please only read this sentence while listening to 'The Airship Blackjack' from the Final Fantasy 6 soundtrack."><em>cool</em> airship</span>!) It drops you off at the edge of a vast desert and descends back to Island Island.</p>
|
|
||||||
<p>"Did you bring the parts?"</p>
|
|
||||||
<p>You turn around to see an Elf completely covered in white clothing, wearing goggles, and riding a large <a href="https://en.wikipedia.org/wiki/Dromedary" target="_blank">camel</a>.</p>
|
|
||||||
<p>"Did you bring the parts?" she asks again, louder this time. You aren't sure what parts she's looking for; you're here to figure out why the sand stopped.</p>
|
|
||||||
<p>"The parts! For the sand, yes! Come with me; I will show you." She beckons you onto the camel.</p>
|
|
||||||
<p>After riding a bit across the sands of Desert Island, you can see what look like very large rocks covering half of the horizon. The Elf explains that the rocks are all along the part of Desert Island that is directly above Island Island, making it hard to even get there. Normally, they use big machines to move the rocks and filter the sand, but the machines have broken down because Desert Island recently stopped receiving the <em>parts</em> they need to fix the machines.</p>
|
|
||||||
<p>You've already assumed it'll be your job to figure out why the parts stopped when she asks if you can help. You agree automatically.</p>
|
|
||||||
<p>Because the journey will take a few days, she offers to teach you the game of <em>Camel Cards</em>. Camel Cards is sort of similar to <a href="https://en.wikipedia.org/wiki/List_of_poker_hands" target="_blank">poker</a> except it's designed to be easier to play while riding a camel.</p>
|
|
||||||
<p>In Camel Cards, you get a list of <em>hands</em>, and your goal is to order them based on the <em>strength</em> of each hand. A hand consists of <em>five cards</em> labeled one of <code>A</code>, <code>K</code>, <code>Q</code>, <code>J</code>, <code>T</code>, <code>9</code>, <code>8</code>, <code>7</code>, <code>6</code>, <code>5</code>, <code>4</code>, <code>3</code>, or <code>2</code>. The relative strength of each card follows this order, where <code>A</code> is the highest and <code>2</code> is the lowest.</p>
|
|
||||||
<p>Every hand is exactly one <em>type</em>. From strongest to weakest, they are:</p>
|
|
||||||
<ul>
|
|
||||||
<li><em>Five of a kind</em>, where all five cards have the same label: <code>AAAAA</code></li>
|
|
||||||
<li><em>Four of a kind</em>, where four cards have the same label and one card has a different label: <code>AA8AA</code></li>
|
|
||||||
<li><em>Full house</em>, where three cards have the same label, and the remaining two cards share a different label: <code>23332</code></li>
|
|
||||||
<li><em>Three of a kind</em>, where three cards have the same label, and the remaining two cards are each different from any other card in the hand: <code>TTT98</code></li>
|
|
||||||
<li><em>Two pair</em>, where two cards share one label, two other cards share a second label, and the remaining card has a third label: <code>23432</code></li>
|
|
||||||
<li><em>One pair</em>, where two cards share one label, and the other three cards have a different label from the pair and each other: <code>A23A4</code></li>
|
|
||||||
<li><em>High card</em>, where all cards' labels are distinct: <code>23456</code></li>
|
|
||||||
</ul>
|
|
||||||
<p>Hands are primarily ordered based on type; for example, every <em>full house</em> is stronger than any <em>three of a kind</em>.</p>
|
|
||||||
<p>If two hands have the same type, a second ordering rule takes effect. Start by comparing the <em>first card in each hand</em>. If these cards are different, the hand with the stronger first card is considered stronger. If the first card in each hand have the <em>same label</em>, however, then move on to considering the <em>second card in each hand</em>. If they differ, the hand with the higher second card wins; otherwise, continue with the third card in each hand, then the fourth, then the fifth.</p>
|
|
||||||
<p>So, <code>33332</code> and <code>2AAAA</code> are both <em>four of a kind</em> hands, but <code>33332</code> is stronger because its first card is stronger. Similarly, <code>77888</code> and <code>77788</code> are both a <em>full house</em>, but <code>77888</code> is stronger because its third card is stronger (and both hands have the same first and second card).</p>
|
|
||||||
<p>To play Camel Cards, you are given a list of hands and their corresponding <em>bid</em> (your puzzle input). For example:</p>
|
|
||||||
<pre><code>32T3K 765
|
|
||||||
T55J5 684
|
|
||||||
KK677 28
|
|
||||||
KTJJT 220
|
|
||||||
QQQJA 483
|
|
||||||
</code></pre>
|
|
||||||
<p>This example shows five hands; each hand is followed by its <em>bid</em> amount. Each hand wins an amount equal to its bid multiplied by its <em>rank</em>, where the weakest hand gets rank 1, the second-weakest hand gets rank 2, and so on up to the strongest hand. Because there are five hands in this example, the strongest hand will have rank 5 and its bid will be multiplied by 5.</p>
|
|
||||||
<p>So, the first step is to put the hands in order of strength:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>32T3K</code> is the only <em>one pair</em> and the other hands are all a stronger type, so it gets rank <em>1</em>.</li>
|
|
||||||
<li><code>KK677</code> and <code>KTJJT</code> are both <em>two pair</em>. Their first cards both have the same label, but the second card of <code>KK677</code> is stronger (<code>K</code> vs <code>T</code>), so <code>KTJJT</code> gets rank <em>2</em> and <code>KK677</code> gets rank <em>3</em>.</li>
|
|
||||||
<li><code>T55J5</code> and <code>QQQJA</code> are both <em>three of a kind</em>. <code>QQQJA</code> has a stronger first card, so it gets rank <em>5</em> and <code>T55J5</code> gets rank <em>4</em>.</li>
|
|
||||||
</ul>
|
|
||||||
<p>Now, you can determine the total winnings of this set of hands by adding up the result of multiplying each hand's bid with its rank (<code>765</code> * 1 + <code>220</code> * 2 + <code>28</code> * 3 + <code>684</code> * 4 + <code>483</code> * 5). So the <em>total winnings</em> in this example are <code><em>6440</em></code>.</p>
|
|
||||||
<p>Find the rank of every hand in your set. <em>What are the total winnings?</em></p>
|
|
||||||
<article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>To make things a little more interesting, the Elf introduces one additional rule. Now, <code>J</code> cards are <a href="https://en.wikipedia.org/wiki/Joker_(playing_card)" target="_blank">jokers</a> - wildcards that can act like whatever card would make the hand the strongest type possible.</p>
|
|
||||||
<p>To balance this, <em><code>J</code> cards are now the weakest</em> individual cards, weaker even than <code>2</code>. The other cards stay in the same order: <code>A</code>, <code>K</code>, <code>Q</code>, <code>T</code>, <code>9</code>, <code>8</code>, <code>7</code>, <code>6</code>, <code>5</code>, <code>4</code>, <code>3</code>, <code>2</code>, <code>J</code>.</p>
|
|
||||||
<p><code>J</code> cards can pretend to be whatever card is best for the purpose of determining hand type; for example, <code>QJJQ2</code> is now considered <em>four of a kind</em>. However, for the purpose of breaking ties between two hands of the same type, <code>J</code> is always treated as <code>J</code>, not the card it's pretending to be: <code>JKKK2</code> is weaker than <code>QQQQ2</code> because <code>J</code> is weaker than <code>Q</code>.</p>
|
|
||||||
<p>Now, the above example goes very differently:</p>
|
|
||||||
<pre><code>32T3K 765
|
|
||||||
T55J5 684
|
|
||||||
KK677 28
|
|
||||||
KTJJT 220
|
|
||||||
QQQJA 483
|
|
||||||
</code></pre>
|
|
||||||
<ul>
|
|
||||||
<li><code>32T3K</code> is still the only <em>one pair</em>; it doesn't contain any jokers, so its strength doesn't increase.</li>
|
|
||||||
<li><code>KK677</code> is now the only <em>two pair</em>, making it the second-weakest hand.</li>
|
|
||||||
<li><code>T55J5</code>, <code>KTJJT</code>, and <code>QQQJA</code> are now all <em>four of a kind</em>! <code>T55J5</code> gets rank 3, <code>QQQJA</code> gets rank 4, and <code>KTJJT</code> gets rank 5.</li>
|
|
||||||
</ul>
|
|
||||||
<p>With the new joker rule, the total winnings in this example are <code><em>5905</em></code>.</p>
|
|
||||||
<p>Using the new joker rule, find the rank of every hand in your set. <em>What are the new total winnings?</em></p>
|
|
||||||
@@ -1,748 +0,0 @@
|
|||||||
LLLRLRLRLLRRRLRRRLRRRLLLRLRLLRRLLRRLRLRLLRLRLRRLLRRRLRLLRRLRRRLRRLLLRRRLRRRLRRRLLLLRRLRRRLRLRRRLRRLLRLRLRRRLRRRLRRLRRRLLLLLLRLRRRLLLLRLRRRLRRRLRLRRLRLRLRLRLRRRLLRRLRLRRLRRLRRLLRLLLRRLRLLRRLRLRRLRRRLRRLLRLRLRLRRLLRLLRRLLLRLRLRRRLRRLLRRRLRLRLRRLLRLRLRLRRLRLRLRRLRRLLRRLRRRLRRRLLLRRRR
|
|
||||||
|
|
||||||
MQF = (DDG, LSH)
|
|
||||||
QJP = (PCT, XKJ)
|
|
||||||
JXF = (PMG, NBN)
|
|
||||||
JCK = (QCD, NRG)
|
|
||||||
LPD = (NTM, NTM)
|
|
||||||
DLN = (TXM, QRG)
|
|
||||||
MTG = (KGC, DMM)
|
|
||||||
KFV = (FXH, QLX)
|
|
||||||
SCJ = (HQH, XSD)
|
|
||||||
JKJ = (PMX, MHH)
|
|
||||||
SJK = (JXM, GRQ)
|
|
||||||
CJZ = (DPF, RMT)
|
|
||||||
QXM = (HGC, SMX)
|
|
||||||
XJS = (NRV, CCL)
|
|
||||||
QLB = (RCH, QVQ)
|
|
||||||
KDB = (QKT, BJB)
|
|
||||||
FCX = (DXG, SGQ)
|
|
||||||
PCT = (DXR, PTS)
|
|
||||||
MGJ = (FKF, HNG)
|
|
||||||
VBN = (RBK, JPL)
|
|
||||||
TRH = (SRT, VJV)
|
|
||||||
PGK = (SNP, QLP)
|
|
||||||
XVK = (KFK, QQC)
|
|
||||||
SXC = (XTB, DPQ)
|
|
||||||
HNG = (VXF, MVH)
|
|
||||||
QHT = (TTD, LBH)
|
|
||||||
LMK = (QQT, QTP)
|
|
||||||
DXR = (KCT, KQS)
|
|
||||||
FSA = (RXT, BLP)
|
|
||||||
GHK = (JMM, VBN)
|
|
||||||
DMM = (VQM, LTG)
|
|
||||||
FBQ = (FSV, GHJ)
|
|
||||||
KCN = (QVR, TDG)
|
|
||||||
KBF = (XNM, HBL)
|
|
||||||
KJP = (FKG, CJZ)
|
|
||||||
JLH = (CKG, XLV)
|
|
||||||
RJX = (KKN, RJH)
|
|
||||||
PFS = (BVC, SXR)
|
|
||||||
DHM = (HXV, FRV)
|
|
||||||
KFK = (PLL, GQC)
|
|
||||||
CNB = (KNS, HVP)
|
|
||||||
DDG = (QTS, VRJ)
|
|
||||||
QVT = (JCK, DJQ)
|
|
||||||
LRB = (TXD, MPR)
|
|
||||||
DMS = (QVD, MFS)
|
|
||||||
PMJ = (LNN, NPJ)
|
|
||||||
BXD = (MLL, QKQ)
|
|
||||||
DGF = (FMX, PKP)
|
|
||||||
RHQ = (RJH, KKN)
|
|
||||||
MRG = (TNN, LLX)
|
|
||||||
BBM = (VFP, VGF)
|
|
||||||
PLP = (BBK, KFX)
|
|
||||||
RSN = (SBN, DQF)
|
|
||||||
XTP = (HMT, XNV)
|
|
||||||
LLX = (KBF, TDV)
|
|
||||||
KHR = (QGL, NCM)
|
|
||||||
PFB = (SXR, BVC)
|
|
||||||
NKP = (JTF, BJH)
|
|
||||||
RPH = (RSN, VBM)
|
|
||||||
HBL = (LVT, JXF)
|
|
||||||
CBC = (LRB, QGN)
|
|
||||||
FXH = (GCH, KBD)
|
|
||||||
QTF = (KVL, DLS)
|
|
||||||
RPQ = (FJB, RMD)
|
|
||||||
SLD = (MSH, NSN)
|
|
||||||
PXF = (QXM, HDF)
|
|
||||||
QBJ = (RDQ, DJH)
|
|
||||||
QPH = (RKJ, CSC)
|
|
||||||
TVF = (JMC, MTV)
|
|
||||||
MJM = (DLM, BQS)
|
|
||||||
XQV = (LCD, QCL)
|
|
||||||
KQH = (SJK, BPR)
|
|
||||||
CSC = (BLD, PDP)
|
|
||||||
BLP = (XVK, LJB)
|
|
||||||
BBK = (DJT, LLJ)
|
|
||||||
PSH = (GQH, RBQ)
|
|
||||||
RMD = (XQV, KFT)
|
|
||||||
TJJ = (QLV, HPG)
|
|
||||||
STS = (BSB, TMP)
|
|
||||||
FPN = (TCK, GLD)
|
|
||||||
JPF = (VCS, CMQ)
|
|
||||||
NVX = (TLD, GMD)
|
|
||||||
XLV = (LKV, QNK)
|
|
||||||
GSF = (CKS, BVB)
|
|
||||||
QHR = (KTV, KPG)
|
|
||||||
JRX = (FPN, DTC)
|
|
||||||
KGC = (VQM, LTG)
|
|
||||||
SSK = (NHP, NHP)
|
|
||||||
GLN = (RMX, NGG)
|
|
||||||
NPJ = (QRV, KTB)
|
|
||||||
PCP = (XSF, BPL)
|
|
||||||
JTF = (LSL, BHB)
|
|
||||||
TDV = (HBL, XNM)
|
|
||||||
FKV = (JVF, HKK)
|
|
||||||
GSG = (QJP, CLF)
|
|
||||||
QNK = (XNQ, CGQ)
|
|
||||||
RQT = (QVQ, RCH)
|
|
||||||
XNT = (RKM, XRV)
|
|
||||||
JMM = (RBK, JPL)
|
|
||||||
LSL = (NGH, KCN)
|
|
||||||
QLQ = (TLV, KDN)
|
|
||||||
KXR = (KRH, KRH)
|
|
||||||
QLV = (GSR, BQV)
|
|
||||||
PMG = (LPH, XFB)
|
|
||||||
VNF = (LVQ, HHG)
|
|
||||||
CSS = (RKK, RQN)
|
|
||||||
HGR = (PVX, LFX)
|
|
||||||
QGN = (MPR, TXD)
|
|
||||||
XNQ = (GTJ, LXQ)
|
|
||||||
QQC = (GQC, PLL)
|
|
||||||
CKR = (KQH, HQD)
|
|
||||||
TLD = (JLJ, VFL)
|
|
||||||
XSD = (TTQ, LDQ)
|
|
||||||
FXF = (BXS, LMQ)
|
|
||||||
ZZZ = (QBJ, MJJ)
|
|
||||||
HPG = (GSR, BQV)
|
|
||||||
LJC = (RNF, FNK)
|
|
||||||
CCL = (DXF, HRM)
|
|
||||||
FQR = (QBF, CLH)
|
|
||||||
GHJ = (MPS, NRB)
|
|
||||||
LLJ = (NVX, BTR)
|
|
||||||
MCQ = (RTG, CTK)
|
|
||||||
PLL = (DJD, FTV)
|
|
||||||
BLD = (XGL, NDH)
|
|
||||||
MLL = (NHV, PPJ)
|
|
||||||
KDN = (LLS, DLN)
|
|
||||||
KKN = (DCC, CCH)
|
|
||||||
FHB = (TCJ, VLF)
|
|
||||||
HCC = (RDN, TRJ)
|
|
||||||
TGV = (TKF, CFG)
|
|
||||||
TKB = (SVJ, KHH)
|
|
||||||
QDN = (RXG, PFF)
|
|
||||||
GQN = (RKT, NKK)
|
|
||||||
FLV = (TLV, KDN)
|
|
||||||
KTV = (LKK, VGH)
|
|
||||||
XHQ = (JLX, SNS)
|
|
||||||
MHN = (DHV, KMD)
|
|
||||||
DLD = (SSQ, LDK)
|
|
||||||
DKD = (CKR, JPC)
|
|
||||||
SRD = (KPP, LFS)
|
|
||||||
LVT = (PMG, NBN)
|
|
||||||
KPP = (FLQ, XTX)
|
|
||||||
BQV = (GLN, NQG)
|
|
||||||
BSB = (KHR, FGL)
|
|
||||||
HGC = (DBX, QTF)
|
|
||||||
DSF = (RBQ, GQH)
|
|
||||||
GRQ = (MVQ, RVP)
|
|
||||||
JGT = (SFN, GQT)
|
|
||||||
HDF = (SMX, HGC)
|
|
||||||
QBF = (VKF, XHQ)
|
|
||||||
QKM = (JTV, LPP)
|
|
||||||
LJB = (QQC, KFK)
|
|
||||||
NTH = (QQV, MHS)
|
|
||||||
QTX = (FMX, PKP)
|
|
||||||
HCQ = (FFT, CBC)
|
|
||||||
XKJ = (DXR, PTS)
|
|
||||||
BHH = (KPP, LFS)
|
|
||||||
GRH = (QLQ, FLV)
|
|
||||||
FNX = (MJX, PFZ)
|
|
||||||
HQN = (CKS, BVB)
|
|
||||||
SJV = (CGF, VKD)
|
|
||||||
RDL = (QJV, MLX)
|
|
||||||
MFR = (DMF, CFD)
|
|
||||||
LPF = (SRD, BHH)
|
|
||||||
HCP = (MPV, NVL)
|
|
||||||
KNS = (VCD, LJL)
|
|
||||||
CDX = (LLX, TNN)
|
|
||||||
SGS = (KMC, RQK)
|
|
||||||
HQS = (NKP, FRN)
|
|
||||||
QVD = (VML, QHT)
|
|
||||||
NRG = (LDS, SCH)
|
|
||||||
BVB = (HCP, NVM)
|
|
||||||
RBK = (QLB, RQT)
|
|
||||||
MPV = (CGR, TSC)
|
|
||||||
VFP = (JXP, QCM)
|
|
||||||
QFS = (DFQ, FHB)
|
|
||||||
FTK = (LSH, DDG)
|
|
||||||
TJH = (KPL, KTR)
|
|
||||||
HQF = (MQF, FTK)
|
|
||||||
FGX = (HVP, KNS)
|
|
||||||
DDK = (NTM, JNC)
|
|
||||||
BJC = (SQK, RGB)
|
|
||||||
HVP = (VCD, LJL)
|
|
||||||
LTG = (RMV, CJC)
|
|
||||||
BNR = (CSS, RBN)
|
|
||||||
GQT = (LCN, DTK)
|
|
||||||
XSF = (BGT, FCN)
|
|
||||||
SSQ = (KTL, JMR)
|
|
||||||
RNH = (BXH, BXH)
|
|
||||||
FTV = (CMM, PBL)
|
|
||||||
QRK = (TSF, QFS)
|
|
||||||
CLR = (NFS, PGK)
|
|
||||||
SRJ = (PFV, SHX)
|
|
||||||
FQT = (QKT, BJB)
|
|
||||||
FRN = (BJH, JTF)
|
|
||||||
RCN = (NRV, CCL)
|
|
||||||
QTM = (CKR, JPC)
|
|
||||||
JHT = (HRC, NVR)
|
|
||||||
KVB = (KRH, KKT)
|
|
||||||
HJG = (GHN, GHN)
|
|
||||||
RNF = (QFF, CKV)
|
|
||||||
PTT = (VNT, FNX)
|
|
||||||
GRB = (SVJ, KHH)
|
|
||||||
TRJ = (PVJ, QKP)
|
|
||||||
MHS = (FCV, JXD)
|
|
||||||
VBM = (SBN, DQF)
|
|
||||||
DLM = (VNH, SCJ)
|
|
||||||
PPJ = (DMH, PHJ)
|
|
||||||
QJN = (LSX, KBN)
|
|
||||||
HXV = (SMH, BJP)
|
|
||||||
GVL = (VMV, DKF)
|
|
||||||
QCG = (FKV, NVD)
|
|
||||||
FNM = (XRV, RKM)
|
|
||||||
JQJ = (NVT, HGR)
|
|
||||||
KVX = (GRG, PMJ)
|
|
||||||
JLV = (SMG, RPH)
|
|
||||||
TXD = (MFN, HQG)
|
|
||||||
TLJ = (FHD, MHN)
|
|
||||||
RPV = (GKH, BPT)
|
|
||||||
CPR = (JLH, PLC)
|
|
||||||
FLQ = (TPR, LGG)
|
|
||||||
BTF = (HGR, NVT)
|
|
||||||
GCH = (QPT, FDV)
|
|
||||||
JCF = (GHM, NKS)
|
|
||||||
CLF = (PCT, XKJ)
|
|
||||||
RMT = (QKM, XCP)
|
|
||||||
KPL = (DJB, VLV)
|
|
||||||
RMV = (NMS, HCC)
|
|
||||||
XRV = (VPH, PHH)
|
|
||||||
HBB = (XKH, FBQ)
|
|
||||||
PXB = (QBF, CLH)
|
|
||||||
HMR = (PCP, LMJ)
|
|
||||||
KCT = (PFS, PFB)
|
|
||||||
DCC = (MBP, BJC)
|
|
||||||
VFV = (VBD, HQS)
|
|
||||||
DJB = (BQX, SLD)
|
|
||||||
MFS = (VML, QHT)
|
|
||||||
RPC = (PHR, JFD)
|
|
||||||
RDS = (LFC, RNK)
|
|
||||||
KMC = (RPR, NRL)
|
|
||||||
CJD = (VJN, GKK)
|
|
||||||
VST = (VCS, CMQ)
|
|
||||||
VMC = (RPC, MCV)
|
|
||||||
VJV = (XTP, DRK)
|
|
||||||
BXH = (RXT, BLP)
|
|
||||||
PNQ = (DSF, PSH)
|
|
||||||
RJJ = (FXH, QLX)
|
|
||||||
NKS = (QDQ, DPP)
|
|
||||||
QDQ = (SJV, MRP)
|
|
||||||
HQQ = (CJD, DVT)
|
|
||||||
LKV = (CGQ, XNQ)
|
|
||||||
KTL = (HFF, FPS)
|
|
||||||
MBP = (RGB, SQK)
|
|
||||||
MQQ = (HCQ, MDL)
|
|
||||||
BQS = (SCJ, VNH)
|
|
||||||
NRT = (FJD, HTS)
|
|
||||||
HHG = (RTC, RPQ)
|
|
||||||
VNH = (XSD, HQH)
|
|
||||||
QTS = (QTG, MHD)
|
|
||||||
DJQ = (NRG, QCD)
|
|
||||||
MDX = (BPT, GKH)
|
|
||||||
QJV = (QQP, VLJ)
|
|
||||||
HBD = (HBB, CKC)
|
|
||||||
GBF = (HJG, FPV)
|
|
||||||
VDC = (JFJ, VNF)
|
|
||||||
MPH = (PFV, SHX)
|
|
||||||
TPR = (BXD, FVX)
|
|
||||||
KFX = (DJT, LLJ)
|
|
||||||
LSX = (VKN, STS)
|
|
||||||
HJL = (KFX, BBK)
|
|
||||||
QLT = (KGC, DMM)
|
|
||||||
QFF = (BJM, QCG)
|
|
||||||
DVM = (GCD, FSC)
|
|
||||||
MHD = (JCF, JPJ)
|
|
||||||
DPQ = (JJX, GNL)
|
|
||||||
NMS = (TRJ, RDN)
|
|
||||||
VLJ = (XJB, HSJ)
|
|
||||||
JSP = (MHN, FHD)
|
|
||||||
BTR = (GMD, TLD)
|
|
||||||
TTD = (SPC, DFJ)
|
|
||||||
QKT = (XPV, BVJ)
|
|
||||||
MKK = (HCQ, MDL)
|
|
||||||
LFC = (LSS, GQN)
|
|
||||||
QGL = (RPG, HGJ)
|
|
||||||
JDT = (FPN, DTC)
|
|
||||||
NCM = (RPG, HGJ)
|
|
||||||
LCN = (QLT, MTG)
|
|
||||||
VGS = (VJV, SRT)
|
|
||||||
CGF = (FXF, STT)
|
|
||||||
KQS = (PFB, PFS)
|
|
||||||
PFF = (DLD, MRJ)
|
|
||||||
LSH = (QTS, VRJ)
|
|
||||||
FGF = (MPH, SRJ)
|
|
||||||
BJG = (TVF, BDN)
|
|
||||||
HQR = (CXG, CPR)
|
|
||||||
JVF = (RGM, NCG)
|
|
||||||
SNP = (BLN, DFD)
|
|
||||||
DQH = (GSC, CFT)
|
|
||||||
JVA = (RMT, DPF)
|
|
||||||
VPH = (CRN, CHT)
|
|
||||||
DFQ = (VLF, TCJ)
|
|
||||||
DFD = (HQR, QDF)
|
|
||||||
NJH = (RXG, PFF)
|
|
||||||
DTK = (QLT, MTG)
|
|
||||||
MJJ = (DJH, RDQ)
|
|
||||||
GGB = (CFT, GSC)
|
|
||||||
SMH = (RHQ, RJX)
|
|
||||||
NFS = (SNP, QLP)
|
|
||||||
LNV = (XLR, KQF)
|
|
||||||
LCD = (FNM, XNT)
|
|
||||||
GQH = (JDT, JRX)
|
|
||||||
JPJ = (GHM, NKS)
|
|
||||||
GMD = (VFL, JLJ)
|
|
||||||
HTS = (KXR, KVB)
|
|
||||||
KFT = (LCD, QCL)
|
|
||||||
SGH = (NVR, HRC)
|
|
||||||
QKP = (MQD, MLM)
|
|
||||||
HFF = (MGM, KSX)
|
|
||||||
HJM = (KBN, LSX)
|
|
||||||
MJX = (VHC, PXF)
|
|
||||||
TSF = (FHB, DFQ)
|
|
||||||
MSH = (GFM, JHC)
|
|
||||||
VBG = (HJM, QJN)
|
|
||||||
CKS = (HCP, NVM)
|
|
||||||
DQF = (LJC, KXM)
|
|
||||||
FVP = (FJD, HTS)
|
|
||||||
DPP = (SJV, MRP)
|
|
||||||
FKM = (CSS, RBN)
|
|
||||||
VCD = (FCH, GBX)
|
|
||||||
DJV = (VMC, HVC)
|
|
||||||
RKM = (VPH, PHH)
|
|
||||||
TMP = (KHR, FGL)
|
|
||||||
BVC = (TLJ, JSP)
|
|
||||||
SRV = (HQS, VBD)
|
|
||||||
FCN = (DHM, VDX)
|
|
||||||
DJH = (FBG, MCQ)
|
|
||||||
NGG = (RPL, DFV)
|
|
||||||
SRT = (XTP, DRK)
|
|
||||||
RMN = (QTD, JGS)
|
|
||||||
MLH = (MQJ, VDR)
|
|
||||||
KVL = (VFV, SRV)
|
|
||||||
VDX = (FRV, HXV)
|
|
||||||
RXT = (LJB, XVK)
|
|
||||||
LSS = (RKT, NKK)
|
|
||||||
LNN = (KTB, QRV)
|
|
||||||
BCC = (CHL, QXP)
|
|
||||||
GHN = (XBS, XBS)
|
|
||||||
FCK = (FKM, BNR)
|
|
||||||
QLP = (BLN, DFD)
|
|
||||||
BDN = (JMC, MTV)
|
|
||||||
MLX = (VLJ, QQP)
|
|
||||||
RDH = (VNT, VNT)
|
|
||||||
DFV = (JKJ, KDX)
|
|
||||||
DXG = (JLV, MVL)
|
|
||||||
TCF = (DSF, PSH)
|
|
||||||
JJX = (MKM, TJJ)
|
|
||||||
VFL = (GGB, DQH)
|
|
||||||
VLV = (SLD, BQX)
|
|
||||||
RBQ = (JDT, JRX)
|
|
||||||
JXP = (QXB, QVT)
|
|
||||||
PFV = (STX, XHF)
|
|
||||||
BLN = (QDF, HQR)
|
|
||||||
FVX = (QKQ, MLL)
|
|
||||||
QTP = (DJV, GMN)
|
|
||||||
JLP = (NJF, MFR)
|
|
||||||
CXG = (PLC, JLH)
|
|
||||||
VKF = (JLX, SNS)
|
|
||||||
QQT = (GMN, DJV)
|
|
||||||
KDX = (MHH, PMX)
|
|
||||||
FJD = (KXR, KXR)
|
|
||||||
XJB = (PHB, JTH)
|
|
||||||
VMV = (RCN, XJS)
|
|
||||||
MKM = (HPG, QLV)
|
|
||||||
SQK = (GBF, JCS)
|
|
||||||
PMT = (SGQ, DXG)
|
|
||||||
LXQ = (GRB, TKB)
|
|
||||||
RKK = (SSK, SSK)
|
|
||||||
QXA = (VHC, PXF)
|
|
||||||
QDP = (QTD, JGS)
|
|
||||||
VQC = (KQF, XLR)
|
|
||||||
QKQ = (PPJ, NHV)
|
|
||||||
TXM = (JLP, JCJ)
|
|
||||||
SPC = (LRR, SXC)
|
|
||||||
BHG = (KFL, BCC)
|
|
||||||
QBK = (VNF, JFJ)
|
|
||||||
BPB = (LBJ, JGT)
|
|
||||||
RNK = (LSS, GQN)
|
|
||||||
BJP = (RHQ, RJX)
|
|
||||||
VNT = (MJX, MJX)
|
|
||||||
QLX = (GCH, KBD)
|
|
||||||
DXF = (RNH, RNH)
|
|
||||||
DLS = (VFV, SRV)
|
|
||||||
SXR = (TLJ, JSP)
|
|
||||||
SGQ = (JLV, MVL)
|
|
||||||
NRL = (XPP, XGM)
|
|
||||||
JFD = (LVD, LTQ)
|
|
||||||
XNM = (JXF, LVT)
|
|
||||||
PHH = (CHT, CRN)
|
|
||||||
QTD = (CTJ, LPF)
|
|
||||||
FCV = (GTC, CKJ)
|
|
||||||
QRG = (JLP, JCJ)
|
|
||||||
DKS = (KPL, KTR)
|
|
||||||
TTQ = (BFV, LVR)
|
|
||||||
RPR = (XGM, XPP)
|
|
||||||
DVS = (FTH, FFG)
|
|
||||||
RRH = (NJH, QDN)
|
|
||||||
KTR = (DJB, VLV)
|
|
||||||
KQM = (BJV, MND)
|
|
||||||
GKS = (BXH, QCZ)
|
|
||||||
FSV = (MPS, NRB)
|
|
||||||
QXB = (DJQ, JCK)
|
|
||||||
FHX = (QFS, TSF)
|
|
||||||
FGL = (QGL, NCM)
|
|
||||||
BHB = (KCN, NGH)
|
|
||||||
KNA = (KTV, KPG)
|
|
||||||
NBN = (LPH, XFB)
|
|
||||||
NVM = (NVL, MPV)
|
|
||||||
LVR = (CNB, FGX)
|
|
||||||
QCL = (FNM, XNT)
|
|
||||||
XRR = (MTB, HMR)
|
|
||||||
LLS = (TXM, QRG)
|
|
||||||
AAA = (MJJ, QBJ)
|
|
||||||
RPL = (JKJ, KDX)
|
|
||||||
QCM = (QVT, QXB)
|
|
||||||
QVF = (BQS, DLM)
|
|
||||||
LMQ = (LMK, BVF)
|
|
||||||
BLS = (CQK, GTG)
|
|
||||||
JMC = (PLP, HJL)
|
|
||||||
KXM = (RNF, FNK)
|
|
||||||
NDH = (FHJ, GML)
|
|
||||||
SNS = (VJK, FMJ)
|
|
||||||
KFL = (QXP, CHL)
|
|
||||||
FSD = (XNH, MJF)
|
|
||||||
DTC = (GLD, TCK)
|
|
||||||
MRP = (CGF, VKD)
|
|
||||||
JHX = (CJD, DVT)
|
|
||||||
KPG = (LKK, VGH)
|
|
||||||
DJT = (NVX, BTR)
|
|
||||||
MQD = (FQT, KDB)
|
|
||||||
CKJ = (BLS, CGP)
|
|
||||||
JXD = (GTC, CKJ)
|
|
||||||
NVL = (CGR, TSC)
|
|
||||||
PKV = (DBR, PGB)
|
|
||||||
JPL = (QLB, RQT)
|
|
||||||
TSC = (FMS, KRS)
|
|
||||||
XGL = (GML, FHJ)
|
|
||||||
DJD = (PBL, CMM)
|
|
||||||
FSC = (BFG, NTH)
|
|
||||||
DMH = (PBN, HND)
|
|
||||||
KRS = (FQR, PXB)
|
|
||||||
LLM = (GMX, VLX)
|
|
||||||
FJB = (XQV, KFT)
|
|
||||||
KRH = (QHR, QHR)
|
|
||||||
RDQ = (MCQ, FBG)
|
|
||||||
GLD = (VST, JPF)
|
|
||||||
RVP = (HBD, RBC)
|
|
||||||
DHV = (RJJ, KFV)
|
|
||||||
FMX = (RFL, GSG)
|
|
||||||
SMX = (DBX, QTF)
|
|
||||||
LPP = (FSD, PHM)
|
|
||||||
TDG = (MKK, MQQ)
|
|
||||||
HPL = (BDN, TVF)
|
|
||||||
MGM = (RDH, RDH)
|
|
||||||
FHJ = (XFJ, GVL)
|
|
||||||
TQB = (VFP, VGF)
|
|
||||||
JLJ = (DQH, GGB)
|
|
||||||
FMS = (FQR, PXB)
|
|
||||||
HQD = (BPR, SJK)
|
|
||||||
VXR = (XQX, VBG)
|
|
||||||
GML = (XFJ, GVL)
|
|
||||||
GCS = (RKJ, CSC)
|
|
||||||
CTJ = (SRD, BHH)
|
|
||||||
CLH = (XHQ, VKF)
|
|
||||||
HND = (RDL, PXS)
|
|
||||||
QPT = (RRH, CKQ)
|
|
||||||
NVD = (HKK, JVF)
|
|
||||||
XGM = (VFK, MLH)
|
|
||||||
GMN = (HVC, VMC)
|
|
||||||
QDF = (CXG, CPR)
|
|
||||||
TCK = (JPF, VST)
|
|
||||||
BJH = (LSL, BHB)
|
|
||||||
JNC = (BPB, SLZ)
|
|
||||||
GSC = (QVF, MJM)
|
|
||||||
XHG = (SRJ, MPH)
|
|
||||||
CGQ = (GTJ, LXQ)
|
|
||||||
CHL = (TGV, HPX)
|
|
||||||
MRJ = (LDK, SSQ)
|
|
||||||
GKH = (VQC, LNV)
|
|
||||||
MLM = (FQT, KDB)
|
|
||||||
BPT = (LNV, VQC)
|
|
||||||
BXT = (TKD, ZZZ)
|
|
||||||
PMP = (NHP, KJP)
|
|
||||||
PLC = (XLV, CKG)
|
|
||||||
FXA = (LBJ, JGT)
|
|
||||||
PKP = (RFL, GSG)
|
|
||||||
BQX = (MSH, NSN)
|
|
||||||
LBJ = (SFN, GQT)
|
|
||||||
KMD = (KFV, RJJ)
|
|
||||||
PVJ = (MQD, MLM)
|
|
||||||
LDQ = (LVR, BFV)
|
|
||||||
SLS = (PGB, DBR)
|
|
||||||
VTP = (HQQ, JHX)
|
|
||||||
MPS = (QTX, DGF)
|
|
||||||
VRJ = (QTG, MHD)
|
|
||||||
HBH = (HNG, FKF)
|
|
||||||
RTC = (RMD, FJB)
|
|
||||||
PHB = (LPD, LPD)
|
|
||||||
CMM = (DMS, KFB)
|
|
||||||
QVR = (MKK, MQQ)
|
|
||||||
XFJ = (DKF, VMV)
|
|
||||||
TLV = (DLN, LLS)
|
|
||||||
QRV = (SCL, BSJ)
|
|
||||||
MFN = (GHK, RRL)
|
|
||||||
NVT = (LFX, PVX)
|
|
||||||
FVL = (HMR, MTB)
|
|
||||||
VCS = (TQB, BBM)
|
|
||||||
XHF = (QBK, VDC)
|
|
||||||
JTV = (FSD, PHM)
|
|
||||||
VML = (TTD, LBH)
|
|
||||||
SCL = (DKS, TJH)
|
|
||||||
VHC = (QXM, HDF)
|
|
||||||
LPV = (GMX, VLX)
|
|
||||||
CFG = (BTF, JQJ)
|
|
||||||
MCV = (PHR, JFD)
|
|
||||||
LDS = (FGF, XHG)
|
|
||||||
VGF = (QCM, JXP)
|
|
||||||
BVF = (QQT, QTP)
|
|
||||||
VKN = (TMP, BSB)
|
|
||||||
VJK = (KQM, DHQ)
|
|
||||||
CTK = (GSF, HQN)
|
|
||||||
PHM = (MJF, XNH)
|
|
||||||
PVX = (MHK, SXL)
|
|
||||||
JPC = (KQH, HQD)
|
|
||||||
JGS = (CTJ, LPF)
|
|
||||||
XNV = (CLR, BLB)
|
|
||||||
PTS = (KCT, KQS)
|
|
||||||
BXS = (BVF, LMK)
|
|
||||||
BJB = (XPV, BVJ)
|
|
||||||
MHK = (VTP, KKX)
|
|
||||||
CJC = (NMS, HCC)
|
|
||||||
RKT = (PMT, FCX)
|
|
||||||
BFG = (QQV, MHS)
|
|
||||||
LPH = (HDD, DVM)
|
|
||||||
GSR = (GLN, NQG)
|
|
||||||
MHH = (VGS, TRH)
|
|
||||||
HMT = (BLB, CLR)
|
|
||||||
JCJ = (NJF, MFR)
|
|
||||||
MDK = (RPV, MDX)
|
|
||||||
LRR = (DPQ, XTB)
|
|
||||||
RKJ = (PDP, BLD)
|
|
||||||
MJF = (RXX, SGS)
|
|
||||||
NCG = (NRT, FVP)
|
|
||||||
QQV = (JXD, FCV)
|
|
||||||
MJQ = (BCC, KFL)
|
|
||||||
TKD = (MJJ, QBJ)
|
|
||||||
MND = (MDK, KBG)
|
|
||||||
RXG = (MRJ, DLD)
|
|
||||||
BGT = (DHM, VDX)
|
|
||||||
XCP = (LPP, JTV)
|
|
||||||
TRS = (QPH, GCS)
|
|
||||||
FPS = (MGM, KSX)
|
|
||||||
MVL = (SMG, RPH)
|
|
||||||
BJM = (NVD, FKV)
|
|
||||||
BSJ = (TJH, DKS)
|
|
||||||
MTV = (PLP, HJL)
|
|
||||||
GQC = (FTV, DJD)
|
|
||||||
CQL = (FTK, MQF)
|
|
||||||
VQM = (RMV, CJC)
|
|
||||||
SLZ = (JGT, LBJ)
|
|
||||||
HVC = (MCV, RPC)
|
|
||||||
LFX = (MHK, SXL)
|
|
||||||
BJQ = (LFC, RNK)
|
|
||||||
BFV = (FGX, CNB)
|
|
||||||
DRK = (HMT, XNV)
|
|
||||||
VBD = (NKP, FRN)
|
|
||||||
KBN = (STS, VKN)
|
|
||||||
XQX = (HJM, QJN)
|
|
||||||
MPR = (HQG, MFN)
|
|
||||||
KFB = (MFS, QVD)
|
|
||||||
GHM = (QDQ, DPP)
|
|
||||||
KBD = (QPT, FDV)
|
|
||||||
MVH = (FVL, XRR)
|
|
||||||
PGB = (RVG, TRS)
|
|
||||||
RGM = (NRT, FVP)
|
|
||||||
KKT = (QHR, GNZ)
|
|
||||||
TCJ = (RDS, BJQ)
|
|
||||||
MVQ = (HBD, RBC)
|
|
||||||
CKC = (XKH, FBQ)
|
|
||||||
SHX = (XHF, STX)
|
|
||||||
NVR = (RFF, GRH)
|
|
||||||
DKF = (RCN, XJS)
|
|
||||||
KTB = (BSJ, SCL)
|
|
||||||
HSJ = (PHB, JTH)
|
|
||||||
RJH = (DCC, CCH)
|
|
||||||
FNK = (QFF, CKV)
|
|
||||||
XNH = (SGS, RXX)
|
|
||||||
NRV = (DXF, DXF)
|
|
||||||
HRM = (RNH, GKS)
|
|
||||||
LJL = (GBX, FCH)
|
|
||||||
RDN = (PVJ, QKP)
|
|
||||||
JXM = (MVQ, RVP)
|
|
||||||
XLR = (HBH, MGJ)
|
|
||||||
QXP = (HPX, TGV)
|
|
||||||
HQH = (TTQ, LDQ)
|
|
||||||
HGJ = (FCK, HGS)
|
|
||||||
JTH = (LPD, DDK)
|
|
||||||
NKK = (FCX, PMT)
|
|
||||||
DHQ = (MND, BJV)
|
|
||||||
RFF = (FLV, QLQ)
|
|
||||||
RGB = (GBF, JCS)
|
|
||||||
RMX = (DFV, RPL)
|
|
||||||
VXF = (XRR, FVL)
|
|
||||||
SMG = (RSN, VBM)
|
|
||||||
KBG = (RPV, MDX)
|
|
||||||
QCZ = (BLP, RXT)
|
|
||||||
CQK = (BJG, HPL)
|
|
||||||
FDV = (RRH, CKQ)
|
|
||||||
CKQ = (QDN, NJH)
|
|
||||||
RRL = (JMM, VBN)
|
|
||||||
RVG = (QPH, GCS)
|
|
||||||
FTT = (GRG, PMJ)
|
|
||||||
FHD = (KMD, DHV)
|
|
||||||
GFM = (MRG, CDX)
|
|
||||||
FFG = (QRK, FHX)
|
|
||||||
RTG = (GSF, HQN)
|
|
||||||
PXS = (MLX, QJV)
|
|
||||||
MQJ = (JHT, SGH)
|
|
||||||
KSX = (RDH, PTT)
|
|
||||||
VXP = (VBG, XQX)
|
|
||||||
PMX = (TRH, VGS)
|
|
||||||
BPR = (GRQ, JXM)
|
|
||||||
VKD = (STT, FXF)
|
|
||||||
SXL = (KKX, VTP)
|
|
||||||
HDD = (GCD, FSC)
|
|
||||||
GTJ = (GRB, TKB)
|
|
||||||
CHT = (VXP, VXR)
|
|
||||||
RBC = (CKC, HBB)
|
|
||||||
XBS = (TKD, TKD)
|
|
||||||
KHH = (CQL, HQF)
|
|
||||||
XTX = (TPR, LGG)
|
|
||||||
LKK = (LLM, LPV)
|
|
||||||
VFK = (VDR, MQJ)
|
|
||||||
JLX = (VJK, FMJ)
|
|
||||||
FRV = (SMH, BJP)
|
|
||||||
GTC = (CGP, BLS)
|
|
||||||
PHR = (LTQ, LVD)
|
|
||||||
GCD = (BFG, NTH)
|
|
||||||
SBN = (KXM, LJC)
|
|
||||||
STX = (QBK, VDC)
|
|
||||||
FBG = (RTG, CTK)
|
|
||||||
CKV = (BJM, QCG)
|
|
||||||
DPF = (XCP, QKM)
|
|
||||||
FKF = (MVH, VXF)
|
|
||||||
BLB = (PGK, NFS)
|
|
||||||
XPV = (MJQ, BHG)
|
|
||||||
GMX = (FTT, KVX)
|
|
||||||
LBH = (DFJ, SPC)
|
|
||||||
JHC = (CDX, MRG)
|
|
||||||
GNL = (TJJ, MKM)
|
|
||||||
DSM = (FTH, FFG)
|
|
||||||
FFT = (QGN, LRB)
|
|
||||||
GRG = (NPJ, LNN)
|
|
||||||
JFJ = (HHG, LVQ)
|
|
||||||
CGR = (FMS, KRS)
|
|
||||||
LFS = (XTX, FLQ)
|
|
||||||
DMF = (TCF, PNQ)
|
|
||||||
LVQ = (RTC, RPQ)
|
|
||||||
DFJ = (SXC, LRR)
|
|
||||||
VLF = (RDS, BJQ)
|
|
||||||
LMJ = (BPL, XSF)
|
|
||||||
BVJ = (BHG, MJQ)
|
|
||||||
NRB = (QTX, DGF)
|
|
||||||
GKK = (RMN, QDP)
|
|
||||||
CFD = (PNQ, TCF)
|
|
||||||
GBX = (DSM, DVS)
|
|
||||||
NTM = (BPB, BPB)
|
|
||||||
XKH = (GHJ, FSV)
|
|
||||||
LGG = (BXD, FVX)
|
|
||||||
DBR = (RVG, TRS)
|
|
||||||
GTG = (BJG, HPL)
|
|
||||||
HKK = (NCG, RGM)
|
|
||||||
CKG = (LKV, QNK)
|
|
||||||
FKG = (RMT, DPF)
|
|
||||||
QVQ = (DKD, QTM)
|
|
||||||
LDK = (KTL, JMR)
|
|
||||||
PHJ = (PBN, HND)
|
|
||||||
PFZ = (PXF, VHC)
|
|
||||||
VLX = (KVX, FTT)
|
|
||||||
KQF = (HBH, MGJ)
|
|
||||||
RQN = (SSK, PMP)
|
|
||||||
CMQ = (TQB, BBM)
|
|
||||||
NHP = (FKG, FKG)
|
|
||||||
DVT = (GKK, VJN)
|
|
||||||
RPG = (FCK, HGS)
|
|
||||||
RBN = (RKK, RQN)
|
|
||||||
PBN = (RDL, PXS)
|
|
||||||
RCH = (QTM, DKD)
|
|
||||||
CRN = (VXP, VXR)
|
|
||||||
TNN = (KBF, TDV)
|
|
||||||
RFL = (QJP, CLF)
|
|
||||||
NJF = (DMF, CFD)
|
|
||||||
NQG = (RMX, NGG)
|
|
||||||
VDR = (JHT, SGH)
|
|
||||||
FPV = (GHN, BRB)
|
|
||||||
PBL = (DMS, KFB)
|
|
||||||
XTB = (JJX, GNL)
|
|
||||||
HGS = (FKM, BNR)
|
|
||||||
CCH = (BJC, MBP)
|
|
||||||
STT = (LMQ, BXS)
|
|
||||||
LTQ = (SLS, PKV)
|
|
||||||
SFN = (LCN, DTK)
|
|
||||||
NGH = (QVR, TDG)
|
|
||||||
RQK = (RPR, NRL)
|
|
||||||
PDP = (NDH, XGL)
|
|
||||||
FCH = (DSM, DVS)
|
|
||||||
QCD = (SCH, LDS)
|
|
||||||
TKF = (BTF, JQJ)
|
|
||||||
BPL = (BGT, FCN)
|
|
||||||
SVJ = (CQL, HQF)
|
|
||||||
QTG = (JPJ, JCF)
|
|
||||||
NSN = (GFM, JHC)
|
|
||||||
JCS = (HJG, FPV)
|
|
||||||
HRC = (GRH, RFF)
|
|
||||||
VGH = (LLM, LPV)
|
|
||||||
BRB = (XBS, BXT)
|
|
||||||
JMR = (HFF, FPS)
|
|
||||||
VJN = (RMN, QDP)
|
|
||||||
HPX = (TKF, CFG)
|
|
||||||
CFT = (QVF, MJM)
|
|
||||||
DBX = (KVL, DLS)
|
|
||||||
NHV = (PHJ, DMH)
|
|
||||||
FTH = (QRK, FHX)
|
|
||||||
XFB = (DVM, HDD)
|
|
||||||
XPP = (MLH, VFK)
|
|
||||||
CGP = (CQK, GTG)
|
|
||||||
MDL = (FFT, CBC)
|
|
||||||
GNZ = (KPG, KTV)
|
|
||||||
BJV = (KBG, MDK)
|
|
||||||
SCH = (FGF, XHG)
|
|
||||||
RXX = (KMC, RQK)
|
|
||||||
HQG = (GHK, RRL)
|
|
||||||
KKX = (JHX, HQQ)
|
|
||||||
LVD = (SLS, PKV)
|
|
||||||
QQP = (XJB, HSJ)
|
|
||||||
MTB = (LMJ, PCP)
|
|
||||||
FMJ = (KQM, DHQ)
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 8: Haunted Wasteland ---</h2><p>You're still riding a camel across Desert Island when you spot a sandstorm quickly approaching. When you turn to warn the Elf, she disappears before your eyes! To be fair, she had just finished warning you about <em>ghosts</em> a few minutes ago.</p>
|
|
||||||
<p>One of the camel's pouches is labeled "maps" - sure enough, it's full of documents (your puzzle input) about how to navigate the desert. At least, you're pretty sure that's what they are; one of the documents contains a list of left/right instructions, and the rest of the documents seem to describe some kind of <em>network</em> of labeled nodes.</p>
|
|
||||||
<p>It seems like you're meant to use the <em>left/right</em> instructions to <em>navigate the network</em>. Perhaps if you have the camel follow the same instructions, you can escape the haunted wasteland!</p>
|
|
||||||
<p>After examining the maps for a bit, two nodes stick out: <code>AAA</code> and <code>ZZZ</code>. You feel like <code>AAA</code> is where you are now, and you have to follow the left/right instructions until you reach <code>ZZZ</code>.</p>
|
|
||||||
<p>This format defines each <em>node</em> of the network individually. For example:</p>
|
|
||||||
<pre><code>RL
|
|
||||||
|
|
||||||
AAA = (BBB, CCC)
|
|
||||||
BBB = (DDD, EEE)
|
|
||||||
CCC = (ZZZ, GGG)
|
|
||||||
DDD = (DDD, DDD)
|
|
||||||
EEE = (EEE, EEE)
|
|
||||||
GGG = (GGG, GGG)
|
|
||||||
ZZZ = (ZZZ, ZZZ)
|
|
||||||
</code></pre>
|
|
||||||
<p>Starting with <code>AAA</code>, you need to <em>look up the next element</em> based on the next left/right instruction in your input. In this example, start with <code>AAA</code> and go <em>right</em> (<code>R</code>) by choosing the right element of <code>AAA</code>, <code><em>CCC</em></code>. Then, <code>L</code> means to choose the <em>left</em> element of <code>CCC</code>, <code><em>ZZZ</em></code>. By following the left/right instructions, you reach <code>ZZZ</code> in <code><em>2</em></code> steps.</p>
|
|
||||||
<p>Of course, you might not find <code>ZZZ</code> right away. If you run out of left/right instructions, repeat the whole sequence of instructions as necessary: <code>RL</code> really means <code>RLRLRLRLRLRLRLRL...</code> and so on. For example, here is a situation that takes <code><em>6</em></code> steps to reach <code>ZZZ</code>:</p>
|
|
||||||
<pre><code>LLR
|
|
||||||
|
|
||||||
AAA = (BBB, BBB)
|
|
||||||
BBB = (AAA, ZZZ)
|
|
||||||
ZZZ = (ZZZ, ZZZ)
|
|
||||||
</code></pre>
|
|
||||||
<p>Starting at <code>AAA</code>, follow the left/right instructions. <em>How many steps are required to reach <code>ZZZ</code>?</em></p>
|
|
||||||
|
|
||||||
<p>Your puzzle answer was <code>12083</code>.</p><article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>The <span title="Duhduhduhduhduh! Dah, duhduhduhduhduh!">sandstorm</span> is upon you and you aren't any closer to escaping the wasteland. You had the camel follow the instructions, but you've barely left your starting position. It's going to take <em>significantly more steps</em> to escape!</p>
|
|
||||||
<p>What if the map isn't for people - what if the map is for <em>ghosts</em>? Are ghosts even bound by the laws of spacetime? Only one way to find out.</p>
|
|
||||||
<p>After examining the maps a bit longer, your attention is drawn to a curious fact: the number of nodes with names ending in <code>A</code> is equal to the number ending in <code>Z</code>! If you were a ghost, you'd probably just <em>start at every node that ends with <code>A</code></em> and follow all of the paths at the same time until they all simultaneously end up at nodes that end with <code>Z</code>.</p>
|
|
||||||
<p>For example:</p>
|
|
||||||
<pre><code>LR
|
|
||||||
|
|
||||||
11A = (11B, XXX)
|
|
||||||
11B = (XXX, 11Z)
|
|
||||||
11Z = (11B, XXX)
|
|
||||||
22A = (22B, XXX)
|
|
||||||
22B = (22C, 22C)
|
|
||||||
22C = (22Z, 22Z)
|
|
||||||
22Z = (22B, 22B)
|
|
||||||
XXX = (XXX, XXX)
|
|
||||||
</code></pre>
|
|
||||||
<p>Here, there are two starting nodes, <code>11A</code> and <code>22A</code> (because they both end with <code>A</code>). As you follow each left/right instruction, use that instruction to <em>simultaneously</em> navigate away from both nodes you're currently on. Repeat this process until <em>all</em> of the nodes you're currently on end with <code>Z</code>. (If only some of the nodes you're on end with <code>Z</code>, they act like any other node and you continue as normal.) In this example, you would proceed as follows:</p>
|
|
||||||
<ul>
|
|
||||||
<li>Step 0: You are at <code>11A</code> and <code>22A</code>.</li>
|
|
||||||
<li>Step 1: You choose all of the <em>left</em> paths, leading you to <code>11B</code> and <code>22B</code>.</li>
|
|
||||||
<li>Step 2: You choose all of the <em>right</em> paths, leading you to <code><em>11Z</em></code> and <code>22C</code>.</li>
|
|
||||||
<li>Step 3: You choose all of the <em>left</em> paths, leading you to <code>11B</code> and <code><em>22Z</em></code>.</li>
|
|
||||||
<li>Step 4: You choose all of the <em>right</em> paths, leading you to <code><em>11Z</em></code> and <code>22B</code>.</li>
|
|
||||||
<li>Step 5: You choose all of the <em>left</em> paths, leading you to <code>11B</code> and <code>22C</code>.</li>
|
|
||||||
<li>Step 6: You choose all of the <em>right</em> paths, leading you to <code><em>11Z</em></code> and <code><em>22Z</em></code>.</li>
|
|
||||||
</ul>
|
|
||||||
<p>So, in this example, you end up entirely on nodes that end in <code>Z</code> after <code><em>6</em></code> steps.</p>
|
|
||||||
<p>Simultaneously start on every node that ends with <code>A</code>. <em>How many steps does it take before you're only on nodes that end with <code>Z</code>?</em></p>
|
|
||||||
@@ -1,200 +0,0 @@
|
|||||||
14 23 30 32 26 9 -22 -70 -138 -229 -346 -492 -670 -883 -1134 -1426 -1762 -2145 -2578 -3064 -3606
|
|
||||||
4 27 78 180 375 742 1428 2693 4965 8900 15460 26084 43181 71517 121785 219063 421510 859337 1812006 3854420 8122831
|
|
||||||
12 33 58 90 140 227 378 628 1020 1605 2442 3598 5148 7175 9770 13032 17068 21993 27930 35010 43372
|
|
||||||
8 20 43 88 185 401 878 1913 4113 8678 17903 36055 70882 136157 255860 470864 849326 1502400 2607395 4441106 7426759
|
|
||||||
5 14 28 46 72 124 261 652 1736 4562 11453 27208 61141 130356 264772 514542 960655 1729670 3013706 5097002 8390566
|
|
||||||
-2 4 30 95 234 523 1117 2301 4554 8626 15628 27135 45302 72993 113923 172813 255558 369408 523162 727375 994578
|
|
||||||
-2 2 9 20 43 97 234 609 1649 4398 11158 26641 60071 129171 267968 542171 1078918 2122391 4133699 7963449 15140741
|
|
||||||
23 47 87 162 303 551 955 1570 2455 3671 5279 7338 9903 13023 16739 21082 26071 31711 37991 44882 52335
|
|
||||||
5 28 76 161 295 490 758 1111 1561 2120 2800 3613 4571 5686 6970 8435 10093 11956 14036 16345 18895
|
|
||||||
10 2 5 45 167 455 1079 2385 5045 10285 20210 38246 69720 122600 208418 343400 549828 857660 1306435 1947491 2846525
|
|
||||||
11 20 28 37 51 84 172 395 937 2254 5486 13351 31941 74219 166844 363702 773007 1611356 3309648 6715181 13465567
|
|
||||||
12 20 28 33 35 39 55 90 118 10 -574 -2245 -5593 -9774 -8323 21013 138200 484444 1363352 3384881 7710315
|
|
||||||
16 23 42 91 196 390 719 1260 2156 3673 6284 10785 18448 31216 51945 84698 135096 210731 321646 480887 705132
|
|
||||||
1 8 34 87 175 317 566 1040 1964 3753 7225 14140 28440 58856 124019 261975 547235 1120454 2238908 4360653 8282317
|
|
||||||
19 22 25 42 93 205 422 833 1642 3337 7070 15450 34120 74849 161658 343159 717581 1483116 3037123 6166146 12398567
|
|
||||||
13 23 44 85 152 247 369 530 806 1449 3105 7241 17019 39117 87448 190442 404619 838691 1694498 3333829 6383738
|
|
||||||
24 38 54 75 115 218 502 1239 2989 6836 14838 30916 62601 124398 244140 474856 916926 1759830 3362026 6406045 12202199
|
|
||||||
2 23 61 125 231 402 668 1066 1640 2441 3527 4963 6821 9180 12126 15752 20158 25451 31745 39161 47827
|
|
||||||
0 3 12 33 74 142 239 369 577 1044 2263 5347 12634 29067 65509 146443 326722 725577 1591458 3419069 7150862
|
|
||||||
15 19 22 23 17 -10 -87 -255 -527 -741 -160 3442 15617 48571 126688 295063 632075 1267950 2414604 4422018 7902157
|
|
||||||
26 43 70 112 170 246 366 641 1401 3459 8591 20354 45407 95550 190753 363511 664932 1173043 2003884 3326052 5379456
|
|
||||||
-1 -1 6 41 131 303 573 925 1287 1542 1677 2311 6127 21290 68986 199159 522031 1269185 2908648 6356221 13354187
|
|
||||||
14 30 63 135 284 581 1162 2287 4449 8573 16371 30959 57905 106971 194932 349967 618142 1072306 1823093 3030381 4911112
|
|
||||||
17 35 77 154 276 452 690 997 1379 1841 2387 3020 3742 4554 5456 6447 7525 8687 9929 11246 12632
|
|
||||||
-1 8 38 109 255 539 1073 2051 3824 7091 13363 25989 52219 107015 219591 443936 874801 1670742 3085712 5510265 9522523
|
|
||||||
-5 -2 14 59 158 340 629 1031 1517 2002 2320 2195 1208 -1240 -5969 -14065 -26929 -46330 -74462 -114005 -168190
|
|
||||||
15 41 75 124 212 383 709 1319 2486 4847 9898 21022 45501 98269 208626 431805 868225 1694541 3212293 5922144 10634474
|
|
||||||
17 33 53 85 162 363 839 1841 3747 7085 12549 21005 33484 51159 75303 107225 148181 199257 261221 334341 418166
|
|
||||||
14 33 64 115 213 421 875 1854 3896 7973 15738 29857 54439 95577 162013 265940 423954 658169 997508 1479183 2150377
|
|
||||||
2 11 22 42 97 243 581 1276 2580 4859 8624 14566 23595 36883 55911 82520 118966 167979 232826 317378 426181
|
|
||||||
18 20 14 0 -8 36 245 876 2485 6200 14156 30158 60708 116693 216340 390573 692744 1215960 2123014 3696392 6419132
|
|
||||||
18 27 38 57 95 159 247 351 466 598 766 1008 1447 2608 6550 20326 65533 202760 590573 1621022 4218046
|
|
||||||
-8 -15 -16 14 124 401 998 2192 4501 8922 17424 33969 66582 131425 260614 517001 1022018 2008219 3918536 7593000 14616172
|
|
||||||
13 24 43 85 171 328 589 993 1585 2416 3543 5029 6943 9360 12361 16033 20469 25768 32035 39381 47923
|
|
||||||
8 31 68 136 280 598 1276 2633 5176 9665 17188 29246 47848 75616 115900 172903 251816 358963 501956 689860 933368
|
|
||||||
26 52 96 157 231 309 369 374 302 249 662 2774 9323 25636 61139 131305 259962 481738 844204 1408971 2250583
|
|
||||||
8 7 3 8 56 222 645 1549 3255 6191 10957 18622 31677 56536 109315 228053 496898 1091527 2360831 4968508 10130750
|
|
||||||
19 30 49 76 124 247 586 1446 3425 7619 15925 31465 59187 106849 187069 322378 558107 993992 1857093 3659894 7524106
|
|
||||||
-6 2 32 93 201 400 794 1603 3280 6766 14017 29010 59538 120307 238352 463045 885850 1681022 3190154 6094719 11757259
|
|
||||||
-2 -1 10 44 119 272 589 1264 2718 5840 12469 26341 54909 112747 227720 451799 879390 1677405 3133116 5728194 10250347
|
|
||||||
12 26 50 93 178 356 722 1433 2728 4950 8570 14213 22686 35008 52442 76529 109124 152434 209058 282029 374858
|
|
||||||
3 18 50 107 212 426 898 1955 4249 8987 18284 35698 67030 121501 213452 364752 608143 991800 1585438 2488357 3839880
|
|
||||||
3 20 55 129 282 581 1129 2082 3701 6496 11559 21233 40324 78133 151665 290462 543607 989556 1749575 3005689 5024190
|
|
||||||
18 32 43 48 50 58 87 178 470 1369 3886 10280 25277 58388 128277 270807 553406 1099850 2131577 4034364 7462776
|
|
||||||
2 11 20 30 45 72 121 205 340 545 842 1256 1815 2550 3495 4687 6166 7975 10160 12770 15857
|
|
||||||
13 24 34 39 26 -23 -103 -124 195 1496 5059 13266 30382 63843 126306 238779 435201 768872 1321128 2212601 3617282
|
|
||||||
20 41 70 103 136 163 186 251 523 1423 3879 9789 22850 49980 103715 206420 398504 756520 1436393 2779359 5568808
|
|
||||||
17 39 68 96 108 75 -54 -357 -925 -1782 -2634 -2249 2866 21012 69836 183940 427029 910537 1821232 3460962 6302472
|
|
||||||
12 25 47 91 184 376 749 1426 2580 4443 7315 11573 17680 26194 37777 53204 73372 99309 132183 173311 224168
|
|
||||||
9 23 48 89 150 244 427 871 2007 4801 11282 25548 55694 117542 241875 488328 971501 1908667 3704204 7094267 13387062
|
|
||||||
6 23 54 121 274 611 1304 2643 5138 9761 18474 35292 68298 133295 260192 503830 961822 1803179 3313102 5961427 10504914
|
|
||||||
13 31 60 106 181 312 561 1056 2033 3889 7246 13026 22537 37570 60507 94440 143301 212003 306592 434410 604269
|
|
||||||
24 41 70 117 200 377 795 1780 3998 8735 18379 37244 72966 138862 257972 470200 845388 1507873 2682964 4784091 8572860
|
|
||||||
21 40 70 108 162 261 462 853 1551 2694 4426 6874 10116 14139 18786 23691 28201 31284 31422 26488 13606
|
|
||||||
7 12 33 89 216 481 1015 2089 4264 8662 17457 34828 68952 136319 271009 544033 1102084 2242030 4548437 9137620 18073857
|
|
||||||
-4 -7 0 34 126 325 709 1424 2785 5486 10979 22095 43993 85536 161206 293683 517226 882007 1459562 2349536 3687912
|
|
||||||
0 12 35 68 104 129 121 60 -16 169 1592 6986 23067 64991 164926 388049 861778 1828597 3741459 7437683 14461140
|
|
||||||
23 32 41 50 59 68 77 86 95 104 113 122 131 140 149 158 167 176 185 194 203
|
|
||||||
10 16 27 42 65 110 220 523 1363 3562 8896 20916 46346 97537 197087 387281 750512 1454224 2848417 5670598 11460303
|
|
||||||
16 30 53 77 87 69 33 50 297 1099 2952 6506 12482 21492 33726 48465 63374 73524 70087 38643 -42967
|
|
||||||
19 41 72 108 148 204 324 637 1442 3387 7818 17438 37550 78461 160253 322316 642113 1271041 2500520 4879276 9414028
|
|
||||||
15 30 57 109 225 481 1000 1972 3707 6756 12147 21795 39157 70215 124882 218938 376615 633962 1043133 1677753 2639529
|
|
||||||
14 20 43 98 211 425 806 1449 2484 4082 6461 9892 14705 21295 30128 41747 56778 75936 100031 129974 166783
|
|
||||||
15 17 20 26 44 113 338 940 2327 5207 10791 21189 40222 75136 140257 264724 508495 994481 1970878 3927904 7809112
|
|
||||||
25 53 104 191 333 554 891 1420 2314 3961 7205 13863 27886 58003 123648 267820 583911 1269449 2729590 5769071 11935891
|
|
||||||
12 16 17 11 -7 -39 -70 -39 226 1156 3753 10204 25064 57585 126483 270012 567572 1186000 2477477 5182433 10839687
|
|
||||||
7 20 43 94 203 421 845 1667 3256 6283 11900 21985 39466 68738 116188 190844 305165 475990 725665 1083368 1586653
|
|
||||||
5 23 61 128 242 441 794 1412 2459 4163 6827 10840 16688 24965 36384 51788 72161 98639 132521 175280 228574
|
|
||||||
8 25 41 50 45 18 -40 -139 -290 -505 -797 -1180 -1669 -2280 -3030 -3937 -5020 -6299 -7795 -9530 -11527
|
|
||||||
8 7 14 44 119 268 527 939 1554 2429 3628 5222 7289 9914 13189 17213 22092 27939 34874 43024 52523
|
|
||||||
14 16 24 39 61 96 168 336 716 1508 3028 5745 10323 17668 28980 45810 70122 104360 151520 215227 299817
|
|
||||||
2 -1 10 47 123 250 446 771 1432 3035 7139 17415 41978 97915 219803 475319 993266 2013091 3971216 7649687 14428865
|
|
||||||
5 27 63 122 225 420 821 1697 3657 7999 17307 36390 73685 143357 268644 487701 864549 1510047 2621427 4554210 7947537
|
|
||||||
5 2 5 21 63 162 377 809 1636 3195 6146 11768 22468 42645 80160 148842 272735 493192 880483 1552343 2702885
|
|
||||||
8 14 45 120 263 503 874 1415 2170 3188 4523 6234 8385 11045 14288 18193 22844 28330 34745 42188 50763
|
|
||||||
21 38 62 111 217 426 798 1407 2341 3702 5606 8183 11577 15946 21462 28311 36693 46822 58926 73247 90041
|
|
||||||
12 24 49 92 155 230 298 344 409 730 2078 6502 18834 49516 119585 269006 569986 1147444 2209463 4091320 7317589
|
|
||||||
13 30 60 111 195 320 484 678 915 1327 2429 5773 15481 41716 108355 269591 645004 1491641 3347905 7312828 15574862
|
|
||||||
11 5 -6 -16 0 93 354 956 2256 5009 10793 22845 47697 98317 199945 400511 788473 1522157 2876252 5313038 9588222
|
|
||||||
6 11 29 69 142 273 532 1108 2475 5733 13254 29842 64780 135496 274323 541239 1047936 2002555 3790467 7115107 13234518
|
|
||||||
17 23 26 41 91 213 482 1068 2362 5238 11568 25197 53748 111908 227302 450762 873823 1657721 3080134 5608513 10012225
|
|
||||||
5 3 -1 -5 1 42 161 413 857 1577 2799 5219 10717 23704 53433 117701 248477 500111 960911 1769019 3133673
|
|
||||||
7 24 49 80 124 217 454 1039 2370 5176 10722 21094 39569 71065 122653 204097 328369 512064 775615 1143180 1642042
|
|
||||||
5 15 31 53 81 115 155 201 253 311 375 445 521 603 691 785 885 991 1103 1221 1345
|
|
||||||
6 11 14 23 53 127 281 573 1096 1995 3488 5891 9647 15359 23827 36089 53466 77611 110562 154799 213305
|
|
||||||
17 20 24 29 35 42 50 59 69 80 92 105 119 134 150 167 185 204 224 245 267
|
|
||||||
12 18 16 9 10 49 194 599 1596 3852 8616 18085 35922 67963 123154 214763 361916 591510 940560 1459041 2213290
|
|
||||||
15 30 42 43 16 -56 -162 -198 181 1887 7082 20536 52192 121777 266728 555347 1108231 2133328 3984966 7267933 13029812
|
|
||||||
6 9 23 75 208 493 1048 2076 3945 7340 13518 24690 44537 78838 136145 228381 371160 583531 886729 1301373 1842382
|
|
||||||
20 40 68 114 202 372 677 1171 1885 2803 3900 5419 8789 19006 50105 136993 360435 899732 2144689 4935498 11077705
|
|
||||||
2 14 42 93 173 301 549 1137 2624 6248 14498 32080 67609 136671 267411 510578 957062 1767458 3220154 5786927 10248101
|
|
||||||
14 38 75 127 206 347 641 1307 2830 6215 13455 28407 58464 117793 233621 458298 891926 1723576 3303971 6269539 11747586
|
|
||||||
1 11 31 61 101 151 211 281 361 451 551 661 781 911 1051 1201 1361 1531 1711 1901 2101
|
|
||||||
4 -1 1 30 112 271 515 813 1060 1027 293 -1844 -6480 -15245 -30473 -55405 -94428 -153353 -239735 -363238 -536048
|
|
||||||
10 21 41 80 161 333 692 1410 2772 5221 9411 16268 27059 43469 67686 102494 151374 218613 309421 430056 587957
|
|
||||||
15 45 97 181 323 583 1082 2048 3909 7503 14565 28831 58433 120835 252490 526816 1086147 2196177 4335249 8335809 15601591
|
|
||||||
7 9 27 71 162 360 816 1859 4136 8833 18028 35285 66725 123052 223427 402741 724821 1305505 2351449 4223099 7533604
|
|
||||||
21 38 62 95 139 196 268 357 465 594 746 923 1127 1360 1624 1921 2253 2622 3030 3479 3971
|
|
||||||
9 11 16 24 35 49 66 86 109 135 164 196 231 269 310 354 401 451 504 560 619
|
|
||||||
6 14 25 46 103 251 585 1269 2613 5250 10508 21149 42764 86256 171960 335927 638536 1174570 2081715 3540428 5751333
|
|
||||||
13 31 69 134 236 396 653 1065 1709 2708 4358 7519 14614 31922 74498 176324 410910 933058 2063916 4464405 9486389
|
|
||||||
15 36 78 145 252 438 783 1433 2637 4800 8556 14865 25138 41394 66453 104169 159707 239868 353466 511761 728952
|
|
||||||
26 44 62 88 144 278 582 1208 2367 4285 7075 10465 13299 12701 2761 -27433 -96632 -235390 -491460 -936978 -1677846
|
|
||||||
20 34 51 77 131 257 540 1126 2246 4244 7609 13011 21341 33755 51722 77076 112072 159446 222479 305065 411783
|
|
||||||
17 34 68 125 206 297 350 261 -135 -1015 -2408 -3846 -3735 1623 19311 61035 143389 285328 500072 778447 1063084
|
|
||||||
5 2 -1 -4 -7 -10 -13 -16 -19 -22 -25 -28 -31 -34 -37 -40 -43 -46 -49 -52 -55
|
|
||||||
19 26 31 42 76 163 358 769 1614 3340 6898 14408 30716 66798 146664 320414 687441 1435482 2903269 5676858 10732176
|
|
||||||
19 26 46 106 242 511 1026 2018 3936 7628 14717 28425 55378 109503 220293 449949 927972 1918877 3950775 8052827 16183409
|
|
||||||
20 31 49 86 176 402 943 2156 4718 9863 19759 38080 70838 127550 222825 378466 626192 1011095 1595957 2466562 3738148
|
|
||||||
21 38 78 154 290 530 955 1727 3192 6093 11965 23799 47057 91071 170733 308153 533642 885075 1404663 2132847 3100971
|
|
||||||
26 47 77 121 194 338 660 1401 3044 6459 13058 24883 44476 74317 115666 167034 223706 282724 364549 577436 1281654
|
|
||||||
7 32 70 121 185 262 352 455 571 700 842 997 1165 1346 1540 1747 1967 2200 2446 2705 2977
|
|
||||||
9 13 22 42 93 227 561 1334 2997 6345 12700 24154 43881 76527 128687 209478 331217 510213 767682 1130794 1633861
|
|
||||||
5 15 25 35 45 55 65 75 85 95 105 115 125 135 145 155 165 175 185 195 205
|
|
||||||
17 37 66 111 181 278 398 552 808 1347 2537 5097 10621 23194 53789 130960 324620 795294 1890505 4324968 9505338
|
|
||||||
10 21 47 103 213 415 777 1437 2682 5100 9899 19619 39701 81754 169905 352347 721122 1444279 2815799 5330023 9788669
|
|
||||||
13 11 15 41 109 242 465 804 1285 1933 2771 3819 5093 6604 8357 10350 12573 15007 17623 20381 23229
|
|
||||||
9 22 43 82 177 412 945 2068 4341 8873 17869 35625 70241 136463 260337 486970 894200 1618802 2911453 5259931 9673910
|
|
||||||
2 -1 -4 -7 -10 -13 -16 -19 -22 -25 -28 -31 -34 -37 -40 -43 -46 -49 -52 -55 -58
|
|
||||||
25 49 102 201 367 636 1085 1894 3480 6757 13615 27812 56703 114678 229950 457538 903072 1764642 3403789 6462856 12056176
|
|
||||||
19 32 57 103 188 352 682 1360 2763 5668 11651 23848 48453 97860 197624 402206 830175 1740496 3691429 7858001 16641182
|
|
||||||
9 13 29 71 161 335 651 1208 2201 4063 7786 15580 32139 66959 138424 280777 555665 1070737 2008835 3672709 6551973
|
|
||||||
-6 -2 11 33 64 104 153 211 278 354 439 533 636 748 869 999 1138 1286 1443 1609 1784
|
|
||||||
10 19 36 76 168 378 856 1914 4138 8533 16696 31008 54832 92700 150468 235414 356250 523015 746812 1039348 1412232
|
|
||||||
3 8 22 46 81 128 188 262 351 456 578 718 877 1056 1256 1478 1723 1992 2286 2606 2953
|
|
||||||
16 37 69 105 143 208 402 1000 2618 6505 15064 32800 68053 136153 265127 505970 951092 1767489 3256591 5962615 10868987
|
|
||||||
10 15 23 31 43 81 191 440 906 1689 3032 5752 12357 29481 72620 174613 399898 867299 1784981 3502261 6584199
|
|
||||||
9 27 49 82 139 239 411 705 1216 2142 3943 7783 16690 38372 91547 219216 514843 1171309 2568285 5421944 11032453
|
|
||||||
16 25 34 43 52 61 70 79 88 97 106 115 124 133 142 151 160 169 178 187 196
|
|
||||||
2 14 52 146 346 735 1456 2759 5074 9116 16028 27568 46346 76117 122136 191581 294050 442138 652100 944606 1345594
|
|
||||||
4 22 52 91 149 267 544 1173 2495 5113 10190 20225 40912 85206 181528 389233 826150 1715304 3460984 6768279 12825231
|
|
||||||
21 31 41 51 61 71 81 91 101 111 121 131 141 151 161 171 181 191 201 211 221
|
|
||||||
22 39 72 145 297 582 1067 1839 3058 5133 9152 17765 36801 77996 163319 331507 647558 1216083 2199584 3842905 6505297
|
|
||||||
7 22 45 76 115 162 217 280 351 430 517 612 715 826 945 1072 1207 1350 1501 1660 1827
|
|
||||||
-2 7 31 78 159 296 552 1105 2397 5400 12068 26128 54586 110827 221203 438926 872656 1743923 3500729 7041360 14157097
|
|
||||||
8 9 11 14 18 23 29 36 44 53 63 74 86 99 113 128 144 161 179 198 218
|
|
||||||
6 0 -7 -15 -24 -34 -45 -57 -70 -84 -99 -115 -132 -150 -169 -189 -210 -232 -255 -279 -304
|
|
||||||
17 19 27 43 64 82 84 52 -37 -211 -503 -951 -1598 -2492 -3686 -5238 -7211 -9673 -12697 -16361 -20748
|
|
||||||
12 5 -4 -11 -6 27 117 345 954 2578 6641 15972 35666 74195 144752 266839 468280 788319 1283522 2040251 3201106
|
|
||||||
-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
|
||||||
3 0 6 33 93 197 360 624 1111 2119 4282 8849 18257 37523 77846 165693 364347 821630 1869014 4215989 9312565
|
|
||||||
3 24 63 118 180 246 360 704 1777 4737 12055 28769 64886 139977 291993 594335 1189351 2354894 4637403 9117248 17931616
|
|
||||||
15 27 45 64 76 74 77 190 710 2292 6215 14871 32800 69013 142156 291563 599909 1237785 2548293 5202538 10477368
|
|
||||||
9 27 49 75 105 139 177 219 265 315 369 427 489 555 625 699 777 859 945 1035 1129
|
|
||||||
7 18 30 56 118 246 481 882 1537 2578 4200 6684 10424 15958 24003 35494 51627 73906 104194 144768 198378
|
|
||||||
22 38 64 115 225 457 923 1831 3593 7057 13967 27808 55258 108546 209104 393002 718768 1278320 2211874 3727841 6128887
|
|
||||||
-2 4 31 90 193 351 574 885 1378 2381 4843 11181 27050 64901 150836 337205 724626 1498582 2987295 5748904 10696643
|
|
||||||
1 0 0 1 3 6 10 15 21 28 36 45 55 66 78 91 105 120 136 153 171
|
|
||||||
7 29 58 91 127 172 249 413 771 1507 2912 5419 9643 16426 26887 42477 65039 96873 140806 200267 279367
|
|
||||||
4 0 5 25 76 192 434 915 1864 3762 7604 15392 31092 62596 125907 254105 516044 1053596 2151911 4364551 8723660
|
|
||||||
-3 6 21 35 31 -24 -185 -535 -1197 -2368 -4390 -7828 -13368 -20937 -26496 -12926 72637 370342 1217155 3367177 8414593
|
|
||||||
20 26 38 63 101 141 158 111 -58 -424 -1078 -2125 -3681 -5869 -8814 -12637 -17448 -23338 -30370 -38569 -47911
|
|
||||||
14 28 61 139 297 577 1038 1795 3107 5546 10307 19780 38645 76065 150205 297571 592030 1182806 2369267 4747107 9493891
|
|
||||||
-5 4 33 99 226 449 827 1477 2650 4890 9360 18499 37307 75759 153144 305533 598125 1144928 2139131 3898643 6932648
|
|
||||||
-5 0 30 105 252 507 930 1643 2900 5202 9490 17509 32578 61290 117195 228414 452557 904480 1805570 3567701 6931124
|
|
||||||
9 14 35 86 196 416 827 1563 2880 5334 10188 20261 41566 86247 177473 356985 695751 1307394 2362317 4097188 6808892
|
|
||||||
20 42 79 134 210 310 437 594 784 1010 1275 1582 1934 2334 2785 3290 3852 4474 5159 5910 6730
|
|
||||||
18 36 67 112 184 327 642 1320 2682 5226 9681 17068 28768 46597 72888 110580 163314 235536 332607 460920 628024
|
|
||||||
1 16 54 127 246 414 616 806 891 712 22 -1539 -4472 -9450 -17352 -29300 -46699 -71280 -105146 -150821 -211302
|
|
||||||
12 19 18 9 11 86 368 1097 2671 5759 11578 22558 43872 86831 176168 365099 765198 1603104 3323596 6769750 13488005
|
|
||||||
13 25 47 82 144 270 532 1049 1999 3631 6277 10364 16426 25116 37218 53659 75521 104053 140683 187030 244916
|
|
||||||
18 44 82 141 251 474 923 1814 3590 7166 14354 28547 55782 106376 197468 357111 631345 1097711 1893752 3281337 5796298
|
|
||||||
-3 -5 -7 2 47 165 394 747 1161 1417 1059 -573 -3879 -7342 -2954 35062 176409 593127 1686497 4356260 10558447
|
|
||||||
9 18 38 77 151 288 532 947 1621 2670 4242 6521 9731 14140 20064 27871 37985 50890 67134 87333 112175
|
|
||||||
11 25 38 62 123 264 553 1108 2159 4181 8161 16115 32062 63820 126273 247277 478311 913625 1724420 3219124 5947937
|
|
||||||
7 10 28 80 197 425 826 1488 2569 4430 7980 15498 32465 71399 159412 352272 759211 1584594 3194820 6221348 11713301
|
|
||||||
4 -5 -19 -38 -62 -91 -125 -164 -208 -257 -311 -370 -434 -503 -577 -656 -740 -829 -923 -1022 -1126
|
|
||||||
-4 4 31 94 230 510 1063 2118 4078 7653 14099 25637 46160 82377 145591 254363 438376 743882 1241191 2034744 3276402
|
|
||||||
2 8 17 25 34 63 164 445 1105 2500 5292 10793 21711 43643 87849 176089 348620 676840 1282539 2366281 4248104
|
|
||||||
10 24 35 51 93 193 396 780 1514 2980 5991 12143 24345 47577 89932 164004 288690 491480 811315 1302099 2036957
|
|
||||||
1 18 49 95 156 231 318 414 515 616 711 793 854 885 876 816 693 494 205 -189 -704
|
|
||||||
0 10 37 83 148 241 415 848 2018 5075 12624 30344 70244 156988 339726 713399 1455732 2889320 5582623 10509641 19295916
|
|
||||||
1 17 40 70 112 175 263 355 378 202 -248 -517 1774 14377 58060 182207 494627 1215467 2770252 5944056 12128040
|
|
||||||
22 46 83 133 196 272 361 463 578 706 847 1001 1168 1348 1541 1747 1966 2198 2443 2701 2972
|
|
||||||
13 30 53 75 85 82 112 335 1124 3190 7729 16621 32805 61139 110361 197224 354507 645418 1187905 2193563 4027137
|
|
||||||
22 38 65 111 184 292 443 645 906 1234 1637 2123 2700 3376 4159 5057 6078 7230 8521 9959 11552
|
|
||||||
-7 -3 12 48 137 352 825 1759 3441 6286 10983 18885 32900 59312 111199 214421 417517 807255 1531986 2835306 5102751
|
|
||||||
6 19 48 101 195 380 773 1599 3249 6389 12189 22787 42160 77642 142408 259333 466736 826631 1436230 2443577 4068337
|
|
||||||
6 19 38 70 138 290 616 1278 2566 5025 9762 19156 38404 78737 163900 342877 714254 1471611 2985678 5948678 11620590
|
|
||||||
6 9 15 18 17 18 30 56 95 208 769 3130 11086 33741 90658 220534 495084 1040355 2068331 3922442 7141463
|
|
||||||
20 39 62 81 88 75 34 -35 -91 40 884 3815 12173 33765 86307 208785 484198 1083698 2351220 4967152 10272446
|
|
||||||
7 9 14 13 -9 -62 -130 -143 63 830 2907 8080 20783 51916 127332 305732 714777 1621365 3564450 7600425 15748881
|
|
||||||
26 35 41 44 44 41 35 26 14 -1 -19 -40 -64 -91 -121 -154 -190 -229 -271 -316 -364
|
|
||||||
22 40 75 133 217 327 455 570 588 322 -593 -2805 -7385 -16007 -31173 -56488 -96990 -159540 -253277 -390143 -585483
|
|
||||||
15 16 22 46 115 274 583 1100 1846 2755 3628 4144 4047 3750 5813 18109 60021 173670 442730 1021246 2172799
|
|
||||||
-3 1 10 18 22 27 50 123 295 633 1222 2164 3576 5587 8334 11957 16593 22369 29394 37750 47482
|
|
||||||
12 21 26 27 24 30 103 400 1264 3387 8173 18602 41262 90947 200630 442261 968683 2095790 4460305 9319056 19114059
|
|
||||||
6 20 33 42 56 107 261 629 1378 2742 5033 8652 14100 21989 33053 48159 68318 94696 128625 171614 225360
|
|
||||||
13 27 63 126 228 403 740 1460 3078 6709 14598 30978 63387 124605 235405 428348 752891 1282119 2121457 3419766 5383278
|
|
||||||
23 38 61 113 233 494 1046 2200 4565 9245 18102 34111 61903 108755 186601 316182 535323 914640 1585883 2790781 4961869
|
|
||||||
10 10 8 9 23 65 155 318 584 988 1570 2375 3453 4859 6653 8900 11670 15038 19084 23893 29555
|
|
||||||
24 44 69 109 194 389 823 1740 3580 7098 13529 24807 43846 74891 123947 199294 312096 477112 713517 1045841 1505034
|
|
||||||
-6 -9 -12 -15 -18 -21 -24 -27 -30 -33 -36 -39 -42 -45 -48 -51 -54 -57 -60 -63 -66
|
|
||||||
14 23 27 35 68 159 353 707 1290 2183 3479 5283 7712 10895 14973 20099 26438 34167 43475 54563 67644
|
|
||||||
7 29 79 166 310 557 1002 1833 3421 6497 12474 23996 45851 86522 160956 295738 538951 978833 1778229 3236182 5894304
|
|
||||||
17 36 74 133 209 291 371 488 845 2069 5756 15595 39653 94909 215969 471255 992125 2023845 4013000 7755418 14644761
|
|
||||||
12 15 15 11 10 46 223 792 2282 5740 13222 28869 61286 128655 269281 562489 1168671 2404083 4877858 9739127 19116561
|
|
||||||
7 23 47 83 135 207 303 427 583 775 1007 1283 1607 1983 2415 2907 3463 4087 4783 5555 6407
|
|
||||||
6 30 63 111 201 393 794 1572 2962 5248 8696 13404 19027 24329 26511 20265 -3490 -59222 -168763 -363635 -687675
|
|
||||||
15 13 15 38 108 260 538 995 1693 2703 4105 5988 8450 11598 15548 20425 26363 33505 42003 52018 63720
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
|
|
||||||
<article class="day-desc"><h2>--- Day 9: Mirage Maintenance ---</h2><p>You ride the camel through the sandstorm and stop where the ghost's maps told you to stop. <span title="The sound of a sandstorm slowly settling.">The sandstorm subsequently subsides, somehow seeing you standing at an <em>oasis</em>!</span></p>
|
|
||||||
<p>The camel goes to get some water and you stretch your neck. As you look up, you discover what must be yet another giant floating island, this one made of metal! That must be where the <em>parts to fix the sand machines</em> come from.</p>
|
|
||||||
<p>There's even a <a href="https://en.wikipedia.org/wiki/Hang_gliding" target="_blank">hang glider</a> partially buried in the sand here; once the sun rises and heats up the sand, you might be able to use the glider and the hot air to get all the way up to the metal island!</p>
|
|
||||||
<p>While you wait for the sun to rise, you admire the oasis hidden here in the middle of Desert Island. It must have a delicate ecosystem; you might as well take some ecological readings while you wait. Maybe you can report any environmental instabilities you find to someone so the oasis can be around for the next sandstorm-worn traveler.</p>
|
|
||||||
<p>You pull out your handy <em>Oasis And Sand Instability Sensor</em> and analyze your surroundings. The OASIS produces a report of many values and how they are changing over time (your puzzle input). Each line in the report contains the <em>history</em> of a single value. For example:</p>
|
|
||||||
<pre><code>0 3 6 9 12 15
|
|
||||||
1 3 6 10 15 21
|
|
||||||
10 13 16 21 30 45
|
|
||||||
</code></pre>
|
|
||||||
<p>To best protect the oasis, your environmental report should include a <em>prediction of the next value</em> in each history. To do this, start by making a new sequence from the <em>difference at each step</em> of your history. If that sequence is <em>not</em> all zeroes, repeat this process, using the sequence you just generated as the input sequence. Once all of the values in your latest sequence are zeroes, you can extrapolate what the next value of the original history should be.</p>
|
|
||||||
<p>In the above dataset, the first history is <code>0 3 6 9 12 15</code>. Because the values increase by <code>3</code> each step, the first sequence of differences that you generate will be <code>3 3 3 3 3</code>. Note that this sequence has one fewer value than the input sequence because at each step it considers two numbers from the input. Since these values aren't <em>all zero</em>, repeat the process: the values differ by <code>0</code> at each step, so the next sequence is <code>0 0 0 0</code>. This means you have enough information to extrapolate the history! Visually, these sequences can be arranged like this:</p>
|
|
||||||
<pre><code>0 3 6 9 12 15
|
|
||||||
3 3 3 3 3
|
|
||||||
0 0 0 0
|
|
||||||
</code></pre>
|
|
||||||
<p>To extrapolate, start by adding a new zero to the end of your list of zeroes; because the zeroes represent differences between the two values above them, this also means there is now a placeholder in every sequence above it:<p>
|
|
||||||
<pre><code>0 3 6 9 12 15 <em>B</em>
|
|
||||||
3 3 3 3 3 <em>A</em>
|
|
||||||
0 0 0 0 <em>0</em>
|
|
||||||
</code></pre>
|
|
||||||
<p>You can then start filling in placeholders from the bottom up. <code>A</code> needs to be the result of increasing <code>3</code> (the value to its left) by <code>0</code> (the value below it); this means <code>A</code> must be <code><em>3</em></code>:</p>
|
|
||||||
<pre><code>0 3 6 9 12 15 B
|
|
||||||
3 3 3 3 <em>3</em> <em>3</em>
|
|
||||||
0 0 0 0 <em>0</em>
|
|
||||||
</code></pre>
|
|
||||||
<p>Finally, you can fill in <code>B</code>, which needs to be the result of increasing <code>15</code> (the value to its left) by <code>3</code> (the value below it), or <code><em>18</em></code>:</p>
|
|
||||||
<pre><code>0 3 6 9 12 <em>15</em> <em>18</em>
|
|
||||||
3 3 3 3 3 <em>3</em>
|
|
||||||
0 0 0 0 0
|
|
||||||
</code></pre>
|
|
||||||
<p>So, the next value of the first history is <code><em>18</em></code>.</p>
|
|
||||||
<p>Finding all-zero differences for the second history requires an additional sequence:</p>
|
|
||||||
<pre><code>1 3 6 10 15 21
|
|
||||||
2 3 4 5 6
|
|
||||||
1 1 1 1
|
|
||||||
0 0 0
|
|
||||||
</code></pre>
|
|
||||||
<p>Then, following the same process as before, work out the next value in each sequence from the bottom up:</p>
|
|
||||||
<pre><code>1 3 6 10 15 21 <em>28</em>
|
|
||||||
2 3 4 5 6 <em>7</em>
|
|
||||||
1 1 1 1 <em>1</em>
|
|
||||||
0 0 0 <em>0</em>
|
|
||||||
</code></pre>
|
|
||||||
<p>So, the next value of the second history is <code><em>28</em></code>.</p>
|
|
||||||
<p>The third history requires even more sequences, but its next value can be found the same way:</p>
|
|
||||||
<pre><code>10 13 16 21 30 45 <em>68</em>
|
|
||||||
3 3 5 9 15 <em>23</em>
|
|
||||||
0 2 4 6 <em>8</em>
|
|
||||||
2 2 2 <em>2</em>
|
|
||||||
0 0 <em>0</em>
|
|
||||||
</code></pre>
|
|
||||||
<p>So, the next value of the third history is <code><em>68</em></code>.</p>
|
|
||||||
<p>If you find the next value for each history in this example and add them together, you get <code><em>114</em></code>.</p>
|
|
||||||
<p>Analyze your OASIS report and extrapolate the next value for each history. <em>What is the sum of these extrapolated values?</em></p>
|
|
||||||
|
|
||||||
<p>Your puzzle answer was <code>1980437560</code>.</p><p class="day-success">The first half of this puzzle is complete! It provides one gold star: *</p>
|
|
||||||
<article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>Of course, it would be nice to have <em>even more history</em> included in your report. Surely it's safe to just <em>extrapolate backwards</em> as well, right?</p>
|
|
||||||
<p>For each history, repeat the process of finding differences until the sequence of differences is entirely zero. Then, rather than adding a zero to the end and filling in the next values of each previous sequence, you should instead add a zero to the <em>beginning</em> of your sequence of zeroes, then fill in new <em>first</em> values for each previous sequence.</p>
|
|
||||||
<p>In particular, here is what the third example history looks like when extrapolating back in time:</p>
|
|
||||||
<pre><code><em>5</em> 10 13 16 21 30 45
|
|
||||||
<em>5</em> 3 3 5 9 15
|
|
||||||
<em>-2</em> 0 2 4 6
|
|
||||||
<em>2</em> 2 2 2
|
|
||||||
<em>0</em> 0 0
|
|
||||||
</code></pre>
|
|
||||||
<p>Adding the new values on the left side of each sequence from bottom to top eventually reveals the new left-most history value: <code><em>5</em></code>.</p>
|
|
||||||
<p>Doing this for the remaining example data above results in previous values of <code><em>-3</em></code> for the first history and <code><em>0</em></code> for the second history. Adding all three new values together produces <code><em>2</em></code>.</p>
|
|
||||||
<p>Analyze your OASIS report again, this time extrapolating the <em>previous</em> value for each history. <em>What is the sum of these extrapolated values?</em></p>
|
|
||||||
Reference in New Issue
Block a user