Mercurial > hg > aoc
comparison 2017/day01/problem @ 34:049fb8e56025
Add problem statements and inputs
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Tue, 09 Jan 2018 21:51:44 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
33:bc652fa0a645 | 34:049fb8e56025 |
---|---|
1 --- Day 1: Inverse Captcha --- | |
2 | |
3 The night before Christmas, one of Santa's Elves calls you in a panic. | |
4 "The printer's broken! We can't print the Naughty or Nice List!" By | |
5 the time you make it to sub-basement 17, there are only a few minutes | |
6 until midnight. "We have a big problem," she says; "there must be | |
7 almost fifty bugs in this system, but nothing else can print The List. | |
8 Stand in this square, quick! There's no time to explain; if you can | |
9 convince them to pay you in stars, you'll be able to--" She pulls a | |
10 lever and the world goes blurry. | |
11 | |
12 When your eyes can focus again, everything seems a lot more pixelated | |
13 than before. She must have sent you inside the computer! You check the | |
14 system clock: 25 milliseconds until midnight. With that much time, you | |
15 should be able to collect all fifty stars by December 25th. | |
16 | |
17 Collect stars by solving puzzles. Two puzzles will be made available | |
18 on each day millisecond in the advent calendar; the second puzzle is | |
19 unlocked when you complete the first. Each puzzle grants one star. | |
20 Good luck! | |
21 | |
22 You're standing in a room with "digitization quarantine" written in | |
23 LEDs along one wall. The only door is locked, but it includes a small | |
24 interface. "Restricted Area - Strictly No Digitized Users Allowed." | |
25 | |
26 It goes on to explain that you may only leave by solving a captcha to | |
27 prove you're not a human. Apparently, you only get one millisecond to | |
28 solve the captcha: too fast for a normal human, but it feels like | |
29 hours to you. | |
30 | |
31 The captcha requires you to review a sequence of digits (your puzzle | |
32 input) and find the sum of all digits that match the next digit in the | |
33 list. The list is circular, so the digit after the last digit is the | |
34 first digit in the list. | |
35 | |
36 For example: | |
37 | |
38 1122 produces a sum of 3 (1 + 2) because the first digit (1) | |
39 matches the second digit and the third digit (2) matches the | |
40 fourth digit. | |
41 | |
42 1111 produces 4 because each digit (all 1) matches the next. | |
43 | |
44 1234 produces 0 because no digit matches the next. | |
45 | |
46 91212129 produces 9 because the only digit that matches the next | |
47 one is the last digit, 9. | |
48 | |
49 What is the solution to your captcha? | |
50 | |
51 Your puzzle answer was 1144. | |
52 | |
53 --- Part Two --- | |
54 | |
55 You notice a progress bar that jumps to 50% completion. Apparently, | |
56 the door isn't yet satisfied, but it did emit a star as encouragement. | |
57 The instructions change: | |
58 | |
59 Now, instead of considering the next digit, it wants you to consider | |
60 the digit halfway around the circular list. That is, if your list | |
61 contains 10 items, only include a digit in your sum if the digit 10/2 | |
62 = 5 steps forward matches it. Fortunately, your list has an even | |
63 number of elements. | |
64 | |
65 For example: | |
66 | |
67 1212 produces 6: the list contains 4 items, and all four digits | |
68 match the digit 2 items ahead. | |
69 | |
70 1221 produces 0, because every comparison is between a 1 and a 2. | |
71 | |
72 123425 produces 4, because both 2s match each other, but no other | |
73 digit has a match. | |
74 | |
75 123123 produces 12. | |
76 | |
77 12131415 produces 4. | |
78 | |
79 What is the solution to your new captcha? | |
80 | |
81 Your puzzle answer was 1194. | |
82 | |
83 Both parts of this puzzle are complete! They provide two gold stars: ** |