Compare commits
24
Commits
e48758bd3a
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef764ef2be | ||
|
|
2b2261905f | ||
|
|
0b6a222015 | ||
|
|
5757e5fb19 | ||
|
|
9a0e5314e3 | ||
|
|
fcf7546442 | ||
|
|
e478cf9030 | ||
|
|
4bd6014a6e | ||
|
|
3aa0c74003 | ||
|
|
3298e5cc8a | ||
|
|
e88cfd643a | ||
|
|
638d856417 | ||
|
|
6069495db4 | ||
|
|
9d6ae2527b | ||
|
|
b64d593a51 | ||
|
|
73c816e5a7 | ||
|
|
201077b551 | ||
|
|
4ae9fde7e9 | ||
|
|
dc4447ccfb | ||
|
|
369e4c1e63 | ||
|
|
90756ec10c | ||
|
|
cac6ced738 | ||
|
|
6d87bf0038 | ||
|
|
731ce4b177 |
No files matched your search
@@ -1 +1,2 @@
|
||||
AoC2021/Bene/
|
||||
__pycache__
|
||||
Binary file not shown.
@@ -0,0 +1,97 @@
|
||||
--- Day 5: Print Queue ---
|
||||
|
||||
Satisfied with their search on Ceres, the squadron of scholars suggests subsequently scanning the stationery stacks of sub-basement 17.
|
||||
|
||||
The North Pole printing department is busier than ever this close to Christmas, and while The Historians continue their search of this historically significant facility, an Elf operating a very familiar printer beckons you over.
|
||||
|
||||
The Elf must recognize you, because they waste no time explaining that the new sleigh launch safety manual updates won't print correctly. Failure to update the safety manuals would be dire indeed, so you offer your services.
|
||||
|
||||
Safety protocols clearly indicate that new pages for the safety manuals must be printed in a very specific order. The notation X|Y means that if both page number X and page number Y are to be produced as part of an update, page number X must be printed at some point before page number Y.
|
||||
|
||||
The Elf has for you both the page ordering rules and the pages to produce in each update (your puzzle input), but can't figure out whether each update has the pages in the right order.
|
||||
|
||||
For example:
|
||||
|
||||
47|53
|
||||
97|13
|
||||
97|61
|
||||
97|47
|
||||
75|29
|
||||
61|13
|
||||
75|53
|
||||
29|13
|
||||
97|29
|
||||
53|29
|
||||
61|53
|
||||
97|53
|
||||
61|29
|
||||
47|13
|
||||
75|47
|
||||
97|75
|
||||
47|61
|
||||
75|61
|
||||
47|29
|
||||
75|13
|
||||
53|13
|
||||
|
||||
75,47,61,53,29
|
||||
97,61,53,29,13
|
||||
75,29,13
|
||||
75,97,47,61,53
|
||||
61,13,29
|
||||
97,13,75,29,47
|
||||
|
||||
The first section specifies the page ordering rules, one per line. The first rule, 47|53, means that if an update includes both page number 47 and page number 53, then page number 47 must be printed at some point before page number 53. (47 doesn't necessarily need to be immediately before 53; other pages are allowed to be between them.)
|
||||
|
||||
The second section specifies the page numbers of each update. Because most safety manuals are different, the pages needed in the updates are different too. The first update, 75,47,61,53,29, means that the update consists of page numbers 75, 47, 61, 53, and 29.
|
||||
|
||||
To get the printers going as soon as possible, start by identifying which updates are already in the right order.
|
||||
|
||||
In the above example, the first update (75,47,61,53,29) is in the right order:
|
||||
|
||||
75 is correctly first because there are rules that put each other page after it: 75|47, 75|61, 75|53, and 75|29.
|
||||
47 is correctly second because 75 must be before it (75|47) and every other page must be after it according to 47|61, 47|53, and 47|29.
|
||||
61 is correctly in the middle because 75 and 47 are before it (75|61 and 47|61) and 53 and 29 are after it (61|53 and 61|29).
|
||||
53 is correctly fourth because it is before page number 29 (53|29).
|
||||
29 is the only page left and so is correctly last.
|
||||
|
||||
Because the first update does not include some page numbers, the ordering rules involving those missing page numbers are ignored.
|
||||
|
||||
The second and third updates are also in the correct order according to the rules. Like the first update, they also do not include every page number, and so only some of the ordering rules apply - within each update, the ordering rules that involve missing page numbers are not used.
|
||||
|
||||
The fourth update, 75,97,47,61,53, is not in the correct order: it would print 75 before 97, which violates the rule 97|75.
|
||||
|
||||
The fifth update, 61,13,29, is also not in the correct order, since it breaks the rule 29|13.
|
||||
|
||||
The last update, 97,13,75,29,47, is not in the correct order due to breaking several rules.
|
||||
|
||||
For some reason, the Elves also need to know the middle page number of each update being printed. Because you are currently only printing the correctly-ordered updates, you will need to find the middle page number of each correctly-ordered update. In the above example, the correctly-ordered updates are:
|
||||
|
||||
75,47,61,53,29
|
||||
97,61,53,29,13
|
||||
75,29,13
|
||||
|
||||
These have middle page numbers of 61, 53, and 29 respectively. Adding these page numbers together gives 143.
|
||||
|
||||
Of course, you'll need to be careful: the actual list of page ordering rules is bigger and more complicated than the above example.
|
||||
|
||||
Determine which updates are already in the correct order. What do you get if you add up the middle page number from those correctly-ordered updates?
|
||||
|
||||
Your puzzle answer was 5948.
|
||||
--- Part Two ---
|
||||
|
||||
While the Elves get to work printing the correctly-ordered updates, you have a little time to fix the rest of them.
|
||||
|
||||
For each of the incorrectly-ordered updates, use the page ordering rules to put the page numbers in the right order. For the above example, here are the three incorrectly-ordered updates and their correct orderings:
|
||||
|
||||
75,97,47,61,53 becomes 97,75,47,61,53.
|
||||
61,13,29 becomes 61,29,13.
|
||||
97,13,75,29,47 becomes 97,75,47,29,13.
|
||||
|
||||
After taking only the incorrectly-ordered updates and ordering them correctly, their middle page numbers are 47, 29, and 47. Adding these together produces 123.
|
||||
|
||||
Find the updates which are not in the correct order. What do you get if you add up the middle page numbers after correctly ordering just those updates?
|
||||
|
||||
Your puzzle answer was 3062.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
from functools import cmp_to_key
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
lines = [line.strip('\n') for line in open(sys.argv[1])]
|
||||
rules = [tuple([int(y) for y in x.split('|')]) for x in lines[:lines.index('')]]
|
||||
updates = [[int(x) for x in line.split(',')] for line in lines[lines.index('')+1:]]
|
||||
|
||||
def compare(a,b):
|
||||
for rule in rules:
|
||||
if a in rule and b in rule:
|
||||
return -1 if a == rule[0] else 1
|
||||
return 0
|
||||
|
||||
res1, res2 = 0, 0
|
||||
for update in updates:
|
||||
correct = True
|
||||
for i, u in enumerate(update):
|
||||
for u2 in update[i+1:]:
|
||||
if compare(u,u2) == 1:
|
||||
correct = False
|
||||
break
|
||||
if not correct:
|
||||
update.sort(key=cmp_to_key(compare))
|
||||
res2 += update[int(len(update)/2)]
|
||||
break
|
||||
if correct: res1 += update[int(len(update)/2)]
|
||||
|
||||
# challenge 1
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
47|53
|
||||
97|13
|
||||
97|61
|
||||
97|47
|
||||
75|29
|
||||
61|13
|
||||
75|53
|
||||
29|13
|
||||
97|29
|
||||
53|29
|
||||
61|53
|
||||
97|53
|
||||
61|29
|
||||
47|13
|
||||
75|47
|
||||
97|75
|
||||
47|61
|
||||
75|61
|
||||
47|29
|
||||
75|13
|
||||
53|13
|
||||
|
||||
75,47,61,53,29
|
||||
97,61,53,29,13
|
||||
75,29,13
|
||||
75,97,47,61,53
|
||||
61,13,29
|
||||
97,13,75,29,47
|
||||
+1371
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,195 @@
|
||||
--- Day 6: Guard Gallivant ---
|
||||
|
||||
The Historians use their fancy device again, this time to whisk you all away to the North Pole prototype suit manufacturing lab... in the year 1518! It turns out that having direct access to history is very convenient for a group of historians.
|
||||
|
||||
You still have to be careful of time paradoxes, and so it will be important to avoid anyone from 1518 while The Historians search for the Chief. Unfortunately, a single guard is patrolling this part of the lab.
|
||||
|
||||
Maybe you can work out where the guard will go ahead of time so that The Historians can search safely?
|
||||
|
||||
You start by making a map (your puzzle input) of the situation. For example:
|
||||
|
||||
....#.....
|
||||
.........#
|
||||
..........
|
||||
..#.......
|
||||
.......#..
|
||||
..........
|
||||
.#..^.....
|
||||
........#.
|
||||
#.........
|
||||
......#...
|
||||
|
||||
The map shows the current position of the guard with ^ (to indicate the guard is currently facing up from the perspective of the map). Any obstructions - crates, desks, alchemical reactors, etc. - are shown as #.
|
||||
|
||||
Lab guards in 1518 follow a very strict patrol protocol which involves repeatedly following these steps:
|
||||
|
||||
If there is something directly in front of you, turn right 90 degrees.
|
||||
Otherwise, take a step forward.
|
||||
|
||||
Following the above protocol, the guard moves up several times until she reaches an obstacle (in this case, a pile of failed suit prototypes):
|
||||
|
||||
....#.....
|
||||
....^....#
|
||||
..........
|
||||
..#.......
|
||||
.......#..
|
||||
..........
|
||||
.#........
|
||||
........#.
|
||||
#.........
|
||||
......#...
|
||||
|
||||
Because there is now an obstacle in front of the guard, she turns right before continuing straight in her new facing direction:
|
||||
|
||||
....#.....
|
||||
........>#
|
||||
..........
|
||||
..#.......
|
||||
.......#..
|
||||
..........
|
||||
.#........
|
||||
........#.
|
||||
#.........
|
||||
......#...
|
||||
|
||||
Reaching another obstacle (a spool of several very long polymers), she turns right again and continues downward:
|
||||
|
||||
....#.....
|
||||
.........#
|
||||
..........
|
||||
..#.......
|
||||
.......#..
|
||||
..........
|
||||
.#......v.
|
||||
........#.
|
||||
#.........
|
||||
......#...
|
||||
|
||||
This process continues for a while, but the guard eventually leaves the mapped area (after walking past a tank of universal solvent):
|
||||
|
||||
....#.....
|
||||
.........#
|
||||
..........
|
||||
..#.......
|
||||
.......#..
|
||||
..........
|
||||
.#........
|
||||
........#.
|
||||
#.........
|
||||
......#v..
|
||||
|
||||
By predicting the guard's route, you can determine which specific positions in the lab will be in the patrol path. Including the guard's starting position, the positions visited by the guard before leaving the area are marked with an X:
|
||||
|
||||
....#.....
|
||||
....XXXXX#
|
||||
....X...X.
|
||||
..#.X...X.
|
||||
..XXXXX#X.
|
||||
..X.X.X.X.
|
||||
.#XXXXXXX.
|
||||
.XXXXXXX#.
|
||||
#XXXXXXX..
|
||||
......#X..
|
||||
|
||||
In this example, the guard will visit 41 distinct positions on your map.
|
||||
|
||||
Predict the path of the guard. How many distinct positions will the guard visit before leaving the mapped area?
|
||||
|
||||
Your puzzle answer was 5212.
|
||||
--- Part Two ---
|
||||
|
||||
While The Historians begin working around the guard's patrol route, you borrow their fancy device and step outside the lab. From the safety of a supply closet, you time travel through the last few months and record the nightly status of the lab's guard post on the walls of the closet.
|
||||
|
||||
Returning after what seems like only a few seconds to The Historians, they explain that the guard's patrol area is simply too large for them to safely search the lab without getting caught.
|
||||
|
||||
Fortunately, they are pretty sure that adding a single new obstruction won't cause a time paradox. They'd like to place the new obstruction in such a way that the guard will get stuck in a loop, making the rest of the lab safe to search.
|
||||
|
||||
To have the lowest chance of creating a time paradox, The Historians would like to know all of the possible positions for such an obstruction. The new obstruction can't be placed at the guard's starting position - the guard is there right now and would notice.
|
||||
|
||||
In the above example, there are only 6 different positions where a new obstruction would cause the guard to get stuck in a loop. The diagrams of these six situations use O to mark the new obstruction, | to show a position where the guard moves up/down, - to show a position where the guard moves left/right, and + to show a position where the guard moves both up/down and left/right.
|
||||
|
||||
Option one, put a printing press next to the guard's starting position:
|
||||
|
||||
....#.....
|
||||
....+---+#
|
||||
....|...|.
|
||||
..#.|...|.
|
||||
....|..#|.
|
||||
....|...|.
|
||||
.#.O^---+.
|
||||
........#.
|
||||
#.........
|
||||
......#...
|
||||
|
||||
Option two, put a stack of failed suit prototypes in the bottom right quadrant of the mapped area:
|
||||
|
||||
....#.....
|
||||
....+---+#
|
||||
....|...|.
|
||||
..#.|...|.
|
||||
..+-+-+#|.
|
||||
..|.|.|.|.
|
||||
.#+-^-+-+.
|
||||
......O.#.
|
||||
#.........
|
||||
......#...
|
||||
|
||||
Option three, put a crate of chimney-squeeze prototype fabric next to the standing desk in the bottom right quadrant:
|
||||
|
||||
....#.....
|
||||
....+---+#
|
||||
....|...|.
|
||||
..#.|...|.
|
||||
..+-+-+#|.
|
||||
..|.|.|.|.
|
||||
.#+-^-+-+.
|
||||
.+----+O#.
|
||||
#+----+...
|
||||
......#...
|
||||
|
||||
Option four, put an alchemical retroencabulator near the bottom left corner:
|
||||
|
||||
....#.....
|
||||
....+---+#
|
||||
....|...|.
|
||||
..#.|...|.
|
||||
..+-+-+#|.
|
||||
..|.|.|.|.
|
||||
.#+-^-+-+.
|
||||
..|...|.#.
|
||||
#O+---+...
|
||||
......#...
|
||||
|
||||
Option five, put the alchemical retroencabulator a bit to the right instead:
|
||||
|
||||
....#.....
|
||||
....+---+#
|
||||
....|...|.
|
||||
..#.|...|.
|
||||
..+-+-+#|.
|
||||
..|.|.|.|.
|
||||
.#+-^-+-+.
|
||||
....|.|.#.
|
||||
#..O+-+...
|
||||
......#...
|
||||
|
||||
Option six, put a tank of sovereign glue right next to the tank of universal solvent:
|
||||
|
||||
....#.....
|
||||
....+---+#
|
||||
....|...|.
|
||||
..#.|...|.
|
||||
..+-+-+#|.
|
||||
..|.|.|.|.
|
||||
.#+-^-+-+.
|
||||
.+----++#.
|
||||
#+----++..
|
||||
......#O..
|
||||
|
||||
It doesn't really matter what you choose to use as an obstacle so long as you and The Historians can put it into position without the guard noticing. The important thing is having enough options that you can find one that minimizes time paradoxes, and in this example, there are 6 different positions you could choose.
|
||||
|
||||
You need to get the guard stuck in a loop by adding a single new obstruction. How many different positions could you choose for this obstruction?
|
||||
|
||||
Your puzzle answer was 1767.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+81
@@ -0,0 +1,81 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
from copy import deepcopy
|
||||
import numpy as np
|
||||
|
||||
|
||||
def show(maps):
|
||||
st = ''
|
||||
for line in maps:
|
||||
print(''.join(line))
|
||||
|
||||
|
||||
def find_guard(current):
|
||||
move = (0,0)
|
||||
for y in range(0, len(current)):
|
||||
for x, field in enumerate(current[y]):
|
||||
if field == '.' or field == '#' or field == 'X': continue
|
||||
elif field == '^': move = np.array((0, -1))
|
||||
elif field == '>': move = np.array((1, 0))
|
||||
elif field == 'v': move = np.array((0, 1))
|
||||
elif field == '<': move = np.array((-1, 0))
|
||||
guard = np.array((x, y))
|
||||
return(guard, move, field)
|
||||
|
||||
|
||||
def guard(m, guard, move):
|
||||
next = {(0,-1): '>', (1,0): 'v', (0,1): '<', (-1,0): '^'}
|
||||
nextm = {(0,-1): (1,0), (1,0): (0,1), (0,1): (-1, 0), (-1,0): (0,-1)}
|
||||
current = m
|
||||
|
||||
while (0 <= guard[0] + move[0] < len(m[0]) and 0 <= guard[1] + move[1] < len(m)):
|
||||
gx, gy = guard
|
||||
guard = guard + move
|
||||
x, y = guard
|
||||
if m[y][x] == '#':
|
||||
current[gy][gx] = next[tuple(move)]
|
||||
return current, True, np.array((gx, gy)), np.array(nextm[tuple(move)])
|
||||
else:
|
||||
current[gy][gx] = 'X'
|
||||
current[guard[1]][guard[0]] = 'X'
|
||||
return current, False, np.array((guard[0], guard[1])), np.array(nextm[tuple(move)])
|
||||
|
||||
|
||||
def test_loop(m, x, y, g, move, o):
|
||||
current = deepcopy(m)
|
||||
current[y][x] = '#'
|
||||
positions = set([])
|
||||
positions.add((g[0], g[1], o))
|
||||
running = True
|
||||
while running:
|
||||
current, running, g, move = guard(current, g, move)
|
||||
o = current[g[1]][g[0]]
|
||||
if (g[0], g[1], o) in positions:
|
||||
return True
|
||||
positions.add((g[0], g[1], o))
|
||||
return False
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
maps = [list(line.strip('\n')) for line in open(sys.argv[1])]
|
||||
sguard, smove, start = find_guard(maps)
|
||||
|
||||
# challenge 1
|
||||
running = True
|
||||
current = deepcopy(maps)
|
||||
g, m = sguard, smove
|
||||
while running:
|
||||
current, running, g, m = guard(current, g, m)
|
||||
|
||||
res1 = sum([m.count('X') for m in current])
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
res2 = 0
|
||||
for y in range(0, len(current)):
|
||||
for x, field in enumerate(current[y]):
|
||||
if field == '#' or field == '.': continue
|
||||
res2 += test_loop(maps, x, y, sguard, smove, start)
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
....#.....
|
||||
.........#
|
||||
..........
|
||||
..#.......
|
||||
.......#..
|
||||
..........
|
||||
.#..^.....
|
||||
........#.
|
||||
#.........
|
||||
......#...
|
||||
@@ -0,0 +1,130 @@
|
||||
................#.................#.#...........................#.#..................#............................................
|
||||
..........#................#...........#...................#.#....................................................................
|
||||
....#......#......#............#.#........#..........#.......#.......#...#........#..........#.........................#..........
|
||||
..................#............#.....##...............#..#.....................#...........#......................................
|
||||
#.........#.............................................................#........#............#........#.....#...#...........#....
|
||||
.....#...#......#..................................................#........#..................#......#.......................#...
|
||||
#.................................................#......................#......#...................................#.............
|
||||
...#.#...#.....................................#.......................#.........#..................................#....#........
|
||||
..............................................#..............#...#...........##..........................#.......#............#...
|
||||
........#.#.......#.................##.......................#..........#...........................#...#.........................
|
||||
.................#..............................#.................#............#....#.....#.......................................
|
||||
.................................................................#......#............#.#.#..................#.....................
|
||||
.#..........#......#...#.......#..........................#....................#.#.............................#..................
|
||||
...............#.....##.......#..#...###......#......................#.................................#.#......#..#..............
|
||||
#.....................#......................................#..........#...............#........#...............#...#.#..........
|
||||
.......................................#..................#.........................#.............................................
|
||||
.......................#...............................................................#........................#...........#.....
|
||||
......#....#..........................................................................................#..........#................
|
||||
........#.......................................#..........................#.............##.........#............#.#.........#....
|
||||
......#........#........................................................#..........................#..............................
|
||||
....................#.................................................#.....................#......#..#...#....................#..
|
||||
...........#....................##.....#...#............#...#......................................#.....#.......#.........#....#.
|
||||
#..............#.................#......#..................#...................#......#...........#...............................
|
||||
.......#.......#.........................................#.....#..#.................................................#..........#..
|
||||
..#..................#.......................#..#..#...#..........................#.........#...##......#..........#.#..#.........
|
||||
..#.........#....................#...........................#....................#..........................#................#..#
|
||||
......#.....................................................#..#.......#.............#...................#......................#.
|
||||
.....#..................................................................#...#.....................#......................#.#......
|
||||
......#..............#...................................#.......................#...................................#...##.......
|
||||
...........#..........#....................................................................#........................#.............
|
||||
#.......................................#..........................#........#......#......................##......................
|
||||
.............#...#..........#......#..........#.#......................................................................#..........
|
||||
........................................................#....#...#......##..........................#..........#..................
|
||||
.#...#.....#..........#....#...........................................#........#....................................#............
|
||||
....#....................................##.......#...........................................#.......#...........................
|
||||
...........#.............#........................................................#...#................#........#.................
|
||||
.....#.#........................................#....................#.........#..................................................
|
||||
.........#............#..............................#...#..............#...........................#...............#.....#.......
|
||||
......................#........................................#.#..........#...#..#......................#.......................
|
||||
##...........#..............#......#....................#..........................#.......................#.......#.......#......
|
||||
....#..#.........................................................#.....#..#.........................................#.....#.......
|
||||
....#......##................#......................................#.......................................#..................#..
|
||||
..............................#............................#..................#.......#.......#..................#...#............
|
||||
......................................................#............................#..............................................
|
||||
.......#.............................#......#.................................#...................................................
|
||||
..................................................................................................................#...............
|
||||
.......................#.....#...........##........................................#..............................#...............
|
||||
..........................#................................................................#..................#...................
|
||||
..........................#..................#........#..............#.#..#...................##..................................
|
||||
..................#............................................................................................#..................
|
||||
.......................#..........#...##................#.........................................................................
|
||||
...............#.....................................#............................................#...............................
|
||||
....#..................................................................................#........#.................................
|
||||
..#................#.....................................................................#...#....................................
|
||||
..........#.............#.........#......#................#......#.........#........#.......................#.....................
|
||||
..........................................................................#.................................#.....#....#.#........
|
||||
....#..........#......................................#......................................................#.......#....#.....#.
|
||||
.....#...............................#............................#........................................................#......
|
||||
.............................................................................#.......................#....................#..#....
|
||||
................#.............................................................#...................................................
|
||||
.....#................#.......#....................#............#.......#.....#.................................#.................
|
||||
...........................................................................................................#.#....................
|
||||
.....#...............................................#...................................................................#..#.....
|
||||
................#..............................#.............#.#..............................................................#...
|
||||
..#............#...................#..................................................................#...............#...#....#..
|
||||
..........#...............#...............#............................................#......#...##........#..#..................
|
||||
......#..###..........................................................................................#................#..........
|
||||
..........#........#.....#.......................#.........................................#.#........#.#.........................
|
||||
.....#............................................................#.....#..........................#..............................
|
||||
...............................................................#..............#........................................#..........
|
||||
.................................................#....#...#....................................#..#........................#......
|
||||
.................#..........#......#......................#.......#...................#.#.........................................
|
||||
.#............................................................................#..............#..............................#..#..
|
||||
..#........#...#..........#.................#...#...................................................#...#............#............
|
||||
...........#.......#..#...............................................................................#...........................
|
||||
.#.#..#...........##...................#...................................#...........#...............................#..........
|
||||
......................................................................#............#.....................................#...#....
|
||||
....#............#.#.#................#............#....#...#......#....................................................#.........
|
||||
.......................................................................................#.....................................#....
|
||||
.......................................#..................#........#................................................#.............
|
||||
.........................................#.....#..........#.......##..................................#................#..........
|
||||
..............#.............#............#..........................................................#.............................
|
||||
.#...................#...#..........................................................#........#........#..........................#
|
||||
..#..............................#.....................................#.................#.............#...........#..............
|
||||
.................................#........................#.#....#......#....................#....................................
|
||||
.#..................................................#.....#............................#..........#..................#.......#....
|
||||
.....................#.......................^............#...#...#..............#................#...............................
|
||||
.........#....................................#....................#...........#...........#..............#...................#...
|
||||
............................#...........#....................#.............#.......#.......................#...#....#.............
|
||||
............#.................#...........#..................................................................#............#.......
|
||||
...........#....................#.................................................#......#.#....................#.................
|
||||
..............................................................#..........#........#....#.........#................................
|
||||
...............#.........#......#..........#.#.............................................................................#....#.
|
||||
...............##...##..........................................................................................#.................
|
||||
..........................#.#...........................#......................#...............#..................................
|
||||
.....#...#..................#...........#....#.........#............................#.............................................
|
||||
.........................................................................................#...................#...#................
|
||||
............#.....................#...........#..................................................................#................
|
||||
.#.............................#............................#..........#......##...................................#.#............
|
||||
............#.........................................#...............................................#.#....#....................
|
||||
.........................................................#..#.#...............#......#....#........#..........................#...
|
||||
............................#..#.................#................................................................#...............
|
||||
............................#.........................................................................#....#..#............#..#...
|
||||
....#........#....#....#..#..............................#...#......................#.......................#............#........
|
||||
..#...............#............................................................................................................#..
|
||||
#.......................#...#............#..................................................#.........................#...........
|
||||
.....#.................#..#.............................................#...................................................##....
|
||||
...............#....................................#................#.........................#.#...........................#.#..
|
||||
.................#....#....#..............#....#.#....#...............#......................#...............#..................#.
|
||||
...........#...............................................................................#....#.................#...............
|
||||
...............#............................................###.#.#.#........#...................................#....#...........
|
||||
................#.................#........#............#..............#.....................#.............#......................
|
||||
....................................#.....................................................#....#..................................
|
||||
..#..#.............#......#.#..................#........................................#..........#...#..........................
|
||||
...............#........................#...............................#.............#...................#..#....#...............
|
||||
......#...........................#..............................................#..............................#...............#.
|
||||
...........#..............#................#....#..........#................#.......#..............#.........#.................#..
|
||||
......#....................................................................................................#......................
|
||||
...........#.............#...............#..........#....#.#...##..................#....................#.........................
|
||||
.......................................................#.#.....................................#..................#.......#.......
|
||||
...............#...............#...........................................................................#..................#...
|
||||
...............#......#.........#..................#.............................#..............................#.................
|
||||
...............#..........#..#.......#.............#............................#.#............................#..................
|
||||
..........#................................#..#...................................................................................
|
||||
..#................#............#........#...................................#...............##.................##....#.......#...
|
||||
..#.....................................................................#.............................................#.#.........
|
||||
#...#...#.......................##............#..............#.........#......................#........#.#........................
|
||||
..............................#......#.......#.........#...#..#.......................................................#.#.........
|
||||
.#..................#.#................................#..........#.......#..........................#............................
|
||||
...............#.....................#...#..........................................#..........#......#...........................
|
||||
Binary file not shown.
@@ -0,0 +1,54 @@
|
||||
--- Day 7: Bridge Repair ---
|
||||
|
||||
The Historians take you to a familiar rope bridge over a river in the middle of a jungle. The Chief isn't on this side of the bridge, though; maybe he's on the other side?
|
||||
|
||||
When you go to cross the bridge, you notice a group of engineers trying to repair it. (Apparently, it breaks pretty frequently.) You won't be able to cross until it's fixed.
|
||||
|
||||
You ask how long it'll take; the engineers tell you that it only needs final calibrations, but some young elephants were playing nearby and stole all the operators from their calibration equations! They could finish the calibrations if only someone could determine which test values could possibly be produced by placing any combination of operators into their calibration equations (your puzzle input).
|
||||
|
||||
For example:
|
||||
|
||||
190: 10 19
|
||||
3267: 81 40 27
|
||||
83: 17 5
|
||||
156: 15 6
|
||||
7290: 6 8 6 15
|
||||
161011: 16 10 13
|
||||
192: 17 8 14
|
||||
21037: 9 7 18 13
|
||||
292: 11 6 16 20
|
||||
|
||||
Each line represents a single equation. The test value appears before the colon on each line; it is your job to determine whether the remaining numbers can be combined with operators to produce the test value.
|
||||
|
||||
Operators are always evaluated left-to-right, not according to precedence rules. Furthermore, numbers in the equations cannot be rearranged. Glancing into the jungle, you can see elephants holding two different types of operators: add (+) and multiply (*).
|
||||
|
||||
Only three of the above equations can be made true by inserting operators:
|
||||
|
||||
190: 10 19 has only one position that accepts an operator: between 10 and 19. Choosing + would give 29, but choosing * would give the test value (10 * 19 = 190).
|
||||
3267: 81 40 27 has two positions for operators. Of the four possible configurations of the operators, two cause the right side to match the test value: 81 + 40 * 27 and 81 * 40 + 27 both equal 3267 (when evaluated left-to-right)!
|
||||
292: 11 6 16 20 can be solved in exactly one way: 11 + 6 * 16 + 20.
|
||||
|
||||
The engineers just need the total calibration result, which is the sum of the test values from just the equations that could possibly be true. In the above example, the sum of the test values for the three equations listed above is 3749.
|
||||
|
||||
Determine which equations could possibly be true. What is their total calibration result?
|
||||
|
||||
Your puzzle answer was 4998764814652.
|
||||
--- Part Two ---
|
||||
|
||||
The engineers seem concerned; the total calibration result you gave them is nowhere close to being within safety tolerances. Just then, you spot your mistake: some well-hidden elephants are holding a third type of operator.
|
||||
|
||||
The concatenation operator (||) combines the digits from its left and right inputs into a single number. For example, 12 || 345 would become 12345. All operators are still evaluated left-to-right.
|
||||
|
||||
Now, apart from the three equations that could be made true using only addition and multiplication, the above example has three more equations that can be made true by inserting operators:
|
||||
|
||||
156: 15 6 can be made true through a single concatenation: 15 || 6 = 156.
|
||||
7290: 6 8 6 15 can be made true using 6 * 8 || 6 * 15.
|
||||
192: 17 8 14 can be made true using 17 || 8 + 14.
|
||||
|
||||
Adding up all six test values (the three that could be made before using only + and * plus the new three that can now be made by also using ||) produces the new total calibration result of 11387.
|
||||
|
||||
Using your new knowledge of elephant hiding spots, determine which equations could possibly be true. What is their total calibration result?
|
||||
|
||||
Your puzzle answer was 37598910447546.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
def maths(nums, sec=False):
|
||||
if len(nums) == 2:
|
||||
yield nums[0] * nums[1]
|
||||
yield nums[0] + nums[1]
|
||||
if sec: yield int(str(nums[0]) + str(nums[1]))
|
||||
else:
|
||||
yield from maths([nums[0] * nums[1]] + nums[2:], sec)
|
||||
yield from maths([nums[0] + nums[1]] + nums[2:], sec)
|
||||
if sec: yield from maths([int(str(nums[0]) + str(nums[1]))] + nums[2:], sec)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
lines = [line.strip('\n') for line in open(sys.argv[1])]
|
||||
res1, res2 = 0, 0
|
||||
for line in lines:
|
||||
test, nums = line.split(': ')
|
||||
nums = [int(n) for n in nums.split(' ')]
|
||||
if int(test) in maths(nums): res1 += int(test)
|
||||
if int(test) in maths(nums, True): res2 += int(test)
|
||||
|
||||
# challenge 1
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
190: 10 19
|
||||
3267: 81 40 27
|
||||
83: 17 5
|
||||
156: 15 6
|
||||
7290: 6 8 6 15
|
||||
161011: 16 10 13
|
||||
192: 17 8 14
|
||||
21037: 9 7 18 13
|
||||
292: 11 6 16 20
|
||||
@@ -0,0 +1,850 @@
|
||||
426048: 425 608 69 88 1 282
|
||||
1234: 8 53 21 2 611 1 538
|
||||
3493064: 42 823 101 932 966
|
||||
7851123: 81 52 937 7 9
|
||||
109137611815: 9 4 9 1 9 5 13 97 18 1 4
|
||||
143516213: 2 906 6 5 12 22 578 3 3
|
||||
629453: 7 492 3 28 6 6 9 104
|
||||
5423661: 5 2 8 8 91 4 6 7 3 40 8 6
|
||||
18682395: 93 37 3 1 431 765 2
|
||||
556488358421: 794 98 33 6 917 7
|
||||
14604120: 89 13 65 703 17
|
||||
51347: 24 9 908 8 9 3 6 36 41 6
|
||||
1200264: 1 324 69 614 9 34 52
|
||||
84467: 99 1 694 50 64
|
||||
832680: 3 58 68 45 3
|
||||
13238: 4 3 58 9 652
|
||||
1505251: 3 24 97 1 29 669 5
|
||||
28869324: 99 749 1 46 74
|
||||
125890: 6 894 7 6 87 9 2
|
||||
265251: 8 9 8 87 251
|
||||
928664914: 4 7 6 8 664 8 2 9 1
|
||||
103228624: 7 2 73 7 94 91 95 26
|
||||
5765376: 442 85 4 41 8 742 8 4 8
|
||||
101551004: 2 78 991 38 75 8 4
|
||||
11531: 4 42 589 122 1
|
||||
230639: 88 6 3 722 3 9 1
|
||||
533796498: 66 80 3 2 101 4 5 2 501
|
||||
8494148: 32 35 79 2 8 3 30 2 8
|
||||
222246692: 23 41 13 94 970 689
|
||||
9841934: 2 998 419 815 5 809
|
||||
2186556: 51 9 9 660 4 2 9 8 69 7 3
|
||||
11207789126: 1 9 425 1 68 5 9 2 293 9
|
||||
33355203: 7 199 5 84 119 57
|
||||
60424: 989 61 79 8 8
|
||||
651253: 3 4 904 8 2 8 72 87 493
|
||||
2099106644: 277 842 9 624 22
|
||||
29145931: 3 6 15 3 7 9 70 6 1 1 6 5
|
||||
63140: 8 79 61 77 82
|
||||
720845730: 9 3 43 1 53 45 650 81
|
||||
3030: 45 57 85 280 5 94
|
||||
64316066: 7 6 7 422 14 953 37 4 2
|
||||
31898201: 77 74 3 622 3 797
|
||||
99024982725: 48 77 1 3 47 8 1 30 846
|
||||
3086415: 5 139 1 6 1 8 2 24 2 3 6 9
|
||||
1604915280: 2 7 652 74 321 7 18 4
|
||||
1040: 316 22 7 3 4
|
||||
792201: 748 7 22 488 99 493 4
|
||||
1449102: 23 525 6 4 4 5 82
|
||||
6672: 8 1 563 7 9 593 863 1 4
|
||||
641235: 18 5 76 3 87 8 8 93 15
|
||||
836: 399 2 31 7
|
||||
2589888404878: 4 8 94 21 41 40 4 8 77
|
||||
79158297957: 221 570 58 29 795 6
|
||||
94656: 64 547 254 223 87
|
||||
158670130: 2 9 3 4 32 2 645 2 6 5
|
||||
1172900: 5 624 9 5 3 69 38
|
||||
18570144924: 6 3 570 144 926
|
||||
11809188: 63 26 801 77 7 9 90
|
||||
17569711116: 9 9 2 2 156 793 3 109 4
|
||||
72864: 8 2 3 1 5 3 99 8 4 72
|
||||
30090677155977: 38 89 11 5 217 41 9 79
|
||||
54186: 5 418 6
|
||||
536456640: 1 53 273 27 3 1 35 52
|
||||
1324: 568 47 2 45 5 2 40
|
||||
255466537: 98 49 133 4 82 56
|
||||
108593: 440 931 5 635 54
|
||||
274562: 18 4 88 12 3
|
||||
2310: 168 125 6 551 1
|
||||
158226796: 4 2 1 71 56 18 67
|
||||
227860: 632 36 2 68 5
|
||||
254276307: 211 927 13 62 57 90
|
||||
969151: 96 75 1 79 6 608 1 856
|
||||
1381920960: 329 7 7 6 4 3 5 51 5 4 3 8
|
||||
57750433: 466 22 1 43 6 1 131
|
||||
2039463: 8 532 4 2 2 4 3 59 245 1
|
||||
924: 4 2 42 57 2 23
|
||||
984: 9 5 1 3 4
|
||||
3490: 32 9 8 5 7 7 18
|
||||
764789: 47 91 3 83 341 2 942 4
|
||||
8761312983: 1 5 1 645 2 56 981
|
||||
49375245: 46 16 94 4 67
|
||||
1371731088: 258 80 58 98 119 1 6
|
||||
1691074: 3 653 36 8 2 4 61 153
|
||||
237984: 3 60 942 4 84 514
|
||||
8487: 3 836 6 3 7
|
||||
1302665: 8 327 850 4 8 848 637
|
||||
338504789434: 9 7 96 4 27 58 1 7 7 431
|
||||
4375: 5 320 13 87 62
|
||||
39114592: 24 74 32 3 53 53 8 58 9
|
||||
55211: 1 2 5 261 3 6 6 3 873 6 5
|
||||
3930310: 6 727 89 883 77
|
||||
105416741: 8 6 2 7 830 2 7 81 29 72
|
||||
1864306: 752 37 67 22 76
|
||||
10308245: 460 6 22 56 243
|
||||
8724688: 61 143 1 688
|
||||
802716549428: 81 991 6 5 494 30
|
||||
4542460: 5 11 52 818 924
|
||||
3187936924: 8 9 54 879 356
|
||||
63545: 1 459 7 429 71
|
||||
117919: 9 76 202 28 91 1
|
||||
3743973: 74 82 5 41 5 269
|
||||
861952: 57 558 68 7 2
|
||||
3334911: 668 16 39 8 255
|
||||
66798536: 27 9 931 6 92 65 3 3
|
||||
8653262: 4 82 5 326 2
|
||||
658062508: 5 97 94 2 5 6 9 3 55 6 7
|
||||
22128516: 111 222 898
|
||||
1200278: 40 5 6 269 1 8
|
||||
8492254: 465 206 452 28 74 6
|
||||
3976640: 97 49 2 8 340
|
||||
6598260668: 7 20 3 459 9 9 9 66 8
|
||||
349711968: 699 417 1 4 1 9 50 4 4 8
|
||||
4360998090: 46 474 98 40 5 9 586 2
|
||||
38968452095: 4 8 59 12 7 172 6 592
|
||||
7435934408: 521 8 34 8 32 2 2 2 7 79
|
||||
3601746: 772 4 711 1 61 7
|
||||
1037835487: 2 33 58 143 836 7
|
||||
5238563720270: 5 238 5 5 4 9 720 27 2 5
|
||||
73195290: 1 5 3 442 4 46 2 7 74 9
|
||||
39219: 7 612 3 676 2 9 5 58 3 3
|
||||
171333389699: 63 45 681 1 9 868 3 96
|
||||
5938: 5 554 315 59 8
|
||||
26921: 93 28 3 36 843
|
||||
462492: 370 38 563 73 443
|
||||
372492502: 9 1 521 5 407
|
||||
252499564: 6 1 676 72 5 91 736 44
|
||||
9089304: 8 405 786 1 28
|
||||
22290929687: 18 8 255 512 849
|
||||
496884960: 62 9 691 5 3 52 2 418 1
|
||||
52469758: 7 21 96 244 80
|
||||
1915494: 72 667 81 32 1 5
|
||||
9240: 10 4 9 8 48 21
|
||||
1229174: 39 965 1 6 16 2 676 73
|
||||
63520233: 629 6 20 20 2 31
|
||||
40053664: 520 36 298 72 207
|
||||
31513519: 5 63 13 52 1
|
||||
73259497328: 105 380 5 4 81 92 2 82
|
||||
380149: 5 2 9 59 84 52
|
||||
3532752: 75 6 40 8 7 9 1 4 7 7 48
|
||||
735865836: 2 63 65 3 220 42 58
|
||||
1036899: 1 972 63 89 6
|
||||
119723575: 885 89 2 8 95 775
|
||||
3394585738: 1 14 571 49 3 218 264
|
||||
43184: 9 47 91 47 18 728
|
||||
49179361: 3 2 358 1 27 7 8 5 1 35 1
|
||||
60589: 51 9 55 8 31
|
||||
3853: 376 9 454 6 9
|
||||
97218628: 727 238 7 1 5 3 562 67
|
||||
573: 3 18 8 47 306
|
||||
2673281: 37 17 850 5 31
|
||||
2519097323: 4 4 5 97 433 8 9 95 142
|
||||
6282472: 46 1 691 942 3 472
|
||||
1997842: 25 474 46 4 4
|
||||
21463827009: 6 23 2 74 68 7 1 540 5 6
|
||||
52876: 55 96 7 3 3
|
||||
5458: 97 56 11 8 8
|
||||
306: 4 93 5 1 3
|
||||
2246440404358: 35 2 97 944 68 53 358
|
||||
2156122429948: 627 6 8 625 3 796 3 1 9
|
||||
705471450: 257 448 47 1 450
|
||||
12086441200083: 60 4 322 5 3 8 5 5 20 86
|
||||
95185977895: 98 5 36 209 966
|
||||
66643: 1 3 7 1 6 43
|
||||
243331: 233 9 57 6 756
|
||||
12661228256: 590 33 4 6 7 5 4 774 8 4
|
||||
1100: 141 1 952 1 5
|
||||
10510801045: 69 2 2 9 86 5 9 1 76 28 3
|
||||
9888464534: 77 6 246 98 7 74 967 5
|
||||
361718875114: 2 97 4 725 12 1 5 186 6
|
||||
106512316: 40 7 2 8 449 818 536
|
||||
7588010: 64 694 772 1 291
|
||||
991: 23 4 7 1
|
||||
417: 6 45 7 75 65
|
||||
15920852: 55 93 8 8 3 3 5 8 5 7 8 9
|
||||
699: 4 8 55 43 589
|
||||
35097279829: 4 6 2 2 7 9 58 9 5 7 982 9
|
||||
108684: 5 6 2 62 283 1 6 4 9 2 1 6
|
||||
35276: 28 575 4 57 677
|
||||
8895075: 5 175 18 8 8 171
|
||||
40618: 7 219 38 7 558 54 46
|
||||
55909321: 4 4 4 6 3 2 41 705 8 3
|
||||
176390408: 496 6 61 6 8 3 64 5 2 5
|
||||
407788355: 40 778 7 603 3 747
|
||||
102608197: 81 5 348 5 7 26 1 4 237
|
||||
8020532: 9 9 9 1 969 8 4 5 8 884
|
||||
2581035: 66 5 388 83 7
|
||||
802185122: 561 993 4 360
|
||||
3277848705: 9 6 53 9 95 6 7 11 7 6
|
||||
134464957445: 1 493 1 9 495 74 44
|
||||
229748861160: 67 46 3 205 234 518
|
||||
2940111322: 37 12 917 589 22
|
||||
18670960793: 9 6 5 3 9 8 261 3 1 46 4
|
||||
1142150721: 5 16 55 5 212 5 5 2 18 3
|
||||
22196443505: 815 786 45 77 4 1
|
||||
573211: 2 377 7 24 18 9
|
||||
4843: 3 6 9 44 4 82 8
|
||||
302249666485: 3 194 57 134 54 717
|
||||
662063: 5 3 2 1 624
|
||||
132572: 6 8 36 82 57 2
|
||||
3864582: 2 3 24 7 582
|
||||
1690: 102 691 4 128 765
|
||||
1209: 19 8 7 7 96
|
||||
126089845: 7 5 8 5 98 736 3 7 9 1 7 6
|
||||
46487320: 7 1 664 7 249 71
|
||||
39486: 46 405 1 87 160
|
||||
2736552: 3 28 8 83 7 28 537
|
||||
2172301065: 63 91 618 3 55
|
||||
523522: 93 1 67 362 522
|
||||
986428764: 985 978 446 4 722 43
|
||||
12315880: 9 29 96 8 470
|
||||
3984391: 39 843 92
|
||||
5689708: 5 4 5 7 7 576 6 157 6 19
|
||||
64505661: 64 1 505 397 262
|
||||
227515138: 227 5 1 513 5
|
||||
215361445: 3 83 63 820 93 86 2 46
|
||||
34003007060: 651 993 2 526 60
|
||||
16267: 920 7 1 2 834 6 58 69
|
||||
267374268991: 6 89 73 9 8 826 8 71 59
|
||||
112166154: 10 2 93 5 66 155
|
||||
135: 9 1 5 42 43
|
||||
11248: 70 1 423 8
|
||||
2911500: 7 1 379 10 647
|
||||
65618: 984 65 686 971 1
|
||||
1423917: 23 24 26 9 18 1 3 99
|
||||
1436633024645: 2 84 134 9 2 9 9 8 79 8 2
|
||||
280912: 935 3 3 62 52
|
||||
102593598: 442 2 326 89 3 4 1 7 75
|
||||
38611: 3 9 503 9 6 7
|
||||
36060: 5 8 1 16 4 601
|
||||
28487: 73 691 6 37
|
||||
721930973: 72 18 830 479 70
|
||||
36324778803: 800 100 3 2 26 454
|
||||
70492231245: 571 990 211 5 591
|
||||
801607886: 2 79 33 888 80 7 886
|
||||
15442400: 28 69 999 3 72 157 8
|
||||
354682: 8 40 1 3 5 5 4 8 3 18 9 1
|
||||
11718044: 9 180 31 20 43
|
||||
2292878: 7 56 82 229 425
|
||||
8686510: 37 390 2 64 1 9 291 4 3
|
||||
47239: 2 77 52 4 9 9
|
||||
23755253: 2 3 1 14 707 19 10 22 1
|
||||
20814560: 68 8 44 536 1 3 2 4 2 2
|
||||
431195040: 3 579 696 74 1
|
||||
29632103424: 32 66 6 7 6 62 898
|
||||
3417: 8 81 2 28 869
|
||||
10513496180: 211 3 56 7 2 6 7 135 47
|
||||
4575903869: 45 6 2 3 9 1 903 8 6 9
|
||||
481562: 2 15 946 50 5 9 3
|
||||
23919714428: 27 8 335 3 2 6 39 4 2 6
|
||||
7227024325: 393 870 603 211 22
|
||||
113705615: 16 7 76 94 561 4
|
||||
36627744: 31 879 122 467 76
|
||||
9682305217682: 3 1 3 8 5 9 739 1 1 835 1
|
||||
1883: 19 215 8 1 14
|
||||
310865765704: 4 5 93 47 8 3 6 8 5 703 4
|
||||
65640: 2 3 9 5 671 1 89 9 3 9 3
|
||||
34615688: 8 581 1 9 1 6 5 699 4 90
|
||||
2874960: 136 2 372 936 55
|
||||
125692: 11 4 89 28 2
|
||||
21607840833966: 9 9 950 1 75 96 871 39
|
||||
23335608: 45 75 54 7 51
|
||||
6234: 20 18 819 73 6 654
|
||||
250181: 92 8 4 338 50 7 4
|
||||
38566354: 9 7 120 611 37
|
||||
62704469: 2 8 9 71 5 66 44 5 6 10
|
||||
385850: 5 8 8 7 2 8 63 6 3 678 3 2
|
||||
115032285: 8 150 96 7 913 15 21
|
||||
24871: 8 3 270 600 1
|
||||
77113465: 7 555 723 1 6 7 465
|
||||
6231: 5 8 5 956 5
|
||||
388: 4 291 1 18 4 72
|
||||
63870451184: 1 1 3 2 911 508 8 293
|
||||
961: 5 9 1 8 4 9 87 5 10 5 26 1
|
||||
651002: 2 861 685 2 84 5 2
|
||||
2999: 9 328 41 3 3
|
||||
697540864632: 38 79 4 2 726 8 4 316 2
|
||||
13399549: 3 1 11 73 8 59
|
||||
3562090: 866 1 6 83 674
|
||||
7828907: 74 2 706 87 2 10
|
||||
2386854: 1 2 6 68 78 5 2 4 3 5 5 4
|
||||
81760686: 706 5 7 1 6 6 2 7 2 19 87
|
||||
214797: 8 9 3 421 8 1 3 4 1 9 42 9
|
||||
54427336: 30 712 8 173 53 79 73
|
||||
1053341344949: 65 569 3 712 238 4
|
||||
1448736525566: 160 97 9 6 4 6 8 57 563
|
||||
2123419597390: 606 83 8 9 9 6 6 9 7 393
|
||||
123978240: 336 8 4 9 4 6 8 7 7 2 8 60
|
||||
35148535: 2 7 4 48 565 8 4 2 8 9 5 2
|
||||
204124802990: 9 630 13 340 36 7 583
|
||||
539960: 44 66 196 25 960
|
||||
37179596269: 5 9 63 806 153 6 267
|
||||
46944: 256 517 694 4 8
|
||||
164447918604: 3 3 5 68 2 239 59 3 20 1
|
||||
606512067: 202 5 85 25 2 1 7 4 6
|
||||
582: 6 82 4 78 1 8
|
||||
358489335615: 4 8 36 290 49 3 356 12
|
||||
37968920318: 619 787 27 6 9 203 1 8
|
||||
45917891663: 6 97 6 743 4 91 665
|
||||
56974260612: 681 192 73 598 894
|
||||
1433362936: 23 81 301 2 938
|
||||
13387282062: 71 5 209 7 382 7
|
||||
1440477: 3 9 37 3 66 4 2 667 58 9
|
||||
54297: 87 359 12 77 5 2 7
|
||||
45930136: 75 180 3 3 8 378 104 8
|
||||
15415060: 60 9 86 5 795 94 115
|
||||
152568: 9 1 61 5 68
|
||||
27460988: 2 74 60 488 501
|
||||
1057969: 284 4 4 93
|
||||
2426020: 856 7 13 202 2
|
||||
49096: 6 5 24 2 68
|
||||
9219: 345 9 3 85 8 23 15 5
|
||||
502450092967: 1 142 17 6 6 1 85 589
|
||||
252469069: 478 8 7 1 57 8 66 59
|
||||
24272: 1 8 8 7 4 752 9 6 1
|
||||
156972819: 21 9 858 968 3
|
||||
4435814457: 77 9 8 8 6 1 14 460
|
||||
7029: 57 3 5 6 971
|
||||
7053569543: 70 52 914 2 653 531 9
|
||||
19649102: 9 7 9 5 22 545 4 839 94
|
||||
267089242: 3 5 3 83 8 2 342 7 29 5 7
|
||||
93765: 40 945 53 957 47
|
||||
815253659: 48 97 581 700 8 52 7
|
||||
14381: 70 1 91 2 1
|
||||
6727770: 8 5 1 2 7 47 96 2 4 2 9 38
|
||||
488959: 12 7 770 5 7
|
||||
444850: 57 3 7 68 6 350
|
||||
359101435530: 819 36 14 3 143 553 2
|
||||
255298640: 5 7 2 336 9 6 25 6 226 8
|
||||
627971804: 91 69 71 723 81
|
||||
376876294: 603 625 5 15 779
|
||||
4870224: 8 32 3 2 68 8 93
|
||||
2921378615: 7 3 1 1 7 7 272 2 3 953 5
|
||||
25762: 22 3 475 1 288
|
||||
9334: 8 9 6 1 5 125 42 364
|
||||
61711944: 453 61 26 6 4 8 3
|
||||
31159097: 62 1 5 953 605 32 97
|
||||
1486721291: 178 87 68 96 9
|
||||
164195070864: 93 879 40 795 8 4 22
|
||||
209: 2 83 46
|
||||
448419: 16 657 642 341 4
|
||||
2213729487: 7 9 9 7 1 33 6 6 7 457 3 4
|
||||
826: 83 91 642 8 2
|
||||
69845916113: 4 6 87 39 6 1 6 62 78 77
|
||||
420247390: 7 8 70 5 9 6 6 33 1 9 6 53
|
||||
468391418: 1 5 4 363 885 7 3 9 6 3 8
|
||||
730151: 729 320 7 816 9
|
||||
6121517413: 707 9 6 6 4 4 6 43 6 9 3 4
|
||||
1331520: 8 304 44 288 95
|
||||
2651662: 24 755 9 34 1
|
||||
55557168: 45 8 7 13 6 49 716 8
|
||||
925030462: 453 992 2 8 8 64 4 2 3
|
||||
22929993: 6 1 9 403 8 6 7 9 677 9 8
|
||||
136079: 10 7 80 8 1
|
||||
4018560: 24 2 115 4 182
|
||||
155443251648: 1 89 7 9 6 2 2 819 48
|
||||
47311914088: 1 739 4 9 498 7 71 7 4
|
||||
12959675904: 7 558 529 98 1 84 64
|
||||
117075505: 4 651 2 693 2 63 6 89 7
|
||||
8663990338: 3 5 36 5 2 989 3 23 337
|
||||
38598654357: 8 78 6 7 3 2 5 1 9 1 343
|
||||
1066: 3 68 3 447 7
|
||||
9763884: 4 8 11 4 806
|
||||
2649: 710 3 76 94 1 3
|
||||
97022: 6 5 4 84 77 2
|
||||
4436743: 2 4 20 36 7 37 6
|
||||
10887: 8 1 931 930 26
|
||||
41289: 5 160 2 2 4
|
||||
64001920: 561 4 3 61 38
|
||||
4877046: 961 40 84 3 58
|
||||
94551: 942 3 5 3 1
|
||||
2348968: 234 86 3 6 8
|
||||
4829697944: 5 51 4 9 7 8 687 122 8
|
||||
1275687: 531 4 6 262 9 9
|
||||
866: 5 3 7 3 8
|
||||
62826: 1 6 1 1 6 2 634 84 491 7
|
||||
234421278: 586 4 2 12 81
|
||||
987: 5 81 3 31 864
|
||||
1512712546: 9 8 7 63 7 125 47
|
||||
81507: 1 4 800 69 38
|
||||
6885843415: 743 5 546 570 926
|
||||
28383880: 20 47 9 76 1 89 469
|
||||
8399: 73 86 242 8 877 994
|
||||
6734289681: 841 681 9 889
|
||||
2487534047373: 259 5 3 948 9 974 101
|
||||
11402873: 17 96 609 414 17 553
|
||||
18904325600: 55 21 735 4 325 600
|
||||
1335462451: 16 5 9 9 14 8 3 3 70 955
|
||||
70253: 2 115 30 9 2 38
|
||||
17112: 9 5 4 7 9 66 1 6 5 1 9 2
|
||||
240212907: 4 9 83 31 381 71 8 21 4
|
||||
1137902: 24 89 78 71 31
|
||||
17115001: 8 9 5 100 978 2
|
||||
8596391: 85 8 7 3 87 9 24 3 5 5 22
|
||||
536020: 80 67 17
|
||||
1999835: 8 241 881 8 790
|
||||
91503776: 1 6 419 4 5 7 7 2 6 8 91 7
|
||||
141043433: 470 5 59 6 4 796 1 2 3
|
||||
662831: 69 96 6 5 31 9
|
||||
2527482: 5 670 26 6 8 4 3 6 6 258
|
||||
663617436: 3 8 420 90 66 91 7
|
||||
5117396: 9 43 45 5 32 34 74
|
||||
286833458: 299 976 59 956
|
||||
1810904: 402 12 2 15 73 351 3
|
||||
14755500281: 339 44 1 161 3 3 2 1 3 2
|
||||
891738: 8 2 2 43 1 6 4 93 2 963
|
||||
1431924: 1 32 3 124 9 92 4
|
||||
18526: 572 3 33 7 71 27 4
|
||||
204101449: 650 314 9 5 50
|
||||
19637: 54 6 5 57 55
|
||||
46435032: 4 5 706 87 84
|
||||
3901884025: 21 5 80 167 377 335
|
||||
1357110633: 798 3 2 85 633
|
||||
368814453: 93 509 63 8 612
|
||||
16783688: 4 9 9 417 4 972 5 31 9
|
||||
12778007: 75 949 14 552 167
|
||||
3103890: 775 4 3 89 3
|
||||
746384: 52 14 91 74 5 8 305 9 8
|
||||
1324077: 1 132 24 2 1 6 674 967
|
||||
6907431: 203 9 3 7 2 6 3 6 30 4 3 3
|
||||
291241150: 142 5 2 5 909 5 500 86
|
||||
10416: 35 4 9 217
|
||||
222786114772: 428 3 36 98 836 1 52
|
||||
30956235: 5 263 130 3 193 37
|
||||
1807890624: 973 24 27 1 688
|
||||
70133160056: 822 711 9 1 4 2 6 5 5 5 7
|
||||
882460946: 1 8 8 6 3 1 3 2 5 943 2 3
|
||||
2371851: 8 27 50 5 890
|
||||
40024680321: 1 8 5 7 65 5 4 38 941 3 7
|
||||
487213: 29 9 661 697 9
|
||||
740743860807: 77 75 6 2 46 134 812
|
||||
17850: 20 9 9 26 83 5
|
||||
83290948: 5 91 8 75 2 927
|
||||
586005: 584 894 66 816 228
|
||||
483120417: 3 3 72 4 50 99 4 17
|
||||
21612195: 117 9 6 9 6 1 3 379 5 6 9
|
||||
1146285425: 70 5 863 1 945 427
|
||||
311680: 8 8 5 4 81 3 621 3 4 1 6 5
|
||||
81: 2 5 2 4 1
|
||||
1692432: 6 80 5 764 8 146
|
||||
982802: 73 73 2 8 4 3 8 5 3 5 7 2
|
||||
25409164560: 1 6 9 1 188 7 2 5 7 9 12 5
|
||||
366260: 318 47 47 1 78 7
|
||||
168240337: 5 944 11 6 9 9 4 3 5 2 67
|
||||
156807: 47 4 8 456 80 7
|
||||
14995745: 6 714 25 35 870
|
||||
24780095: 8 15 5 5 4 7 67 4 3 7 11
|
||||
104125: 557 482 2 22 2
|
||||
1844501: 41 2 9 357 7 202 32 5
|
||||
6275963892: 1 482 98 9 9 699 1 12 1
|
||||
3890574408: 176 78 786 6 28
|
||||
47467: 293 9 3 6 1
|
||||
926285: 9 2 532 96 5
|
||||
2209: 7 1 8 94 20 9
|
||||
219763712: 294 7 62 184 8 8
|
||||
1754288721: 344 99 440 155 814 9
|
||||
531930: 49 85 694 65 6 900 85
|
||||
1005239880: 1 733 9 94 6 997 2 4 60
|
||||
462: 33 9 26 131 8
|
||||
6132669: 9 52 546 4 6
|
||||
14541: 30 6 1 8 8
|
||||
49132039: 57 7 6 4 6 8 98 5 2 5 2 42
|
||||
10597759252: 40 7 3 622 8 10 9 7 7 6 9
|
||||
750879481848: 55 65 6 1 6 5 8 7 3 31 9 5
|
||||
301540320: 46 510 83 819 8 795
|
||||
25711201: 3 7 337 9 296 2 2 60 5 7
|
||||
3131219615335: 6 1 51 20 21 9 615 3 35
|
||||
190931: 6 6 9 7 836 2 1 7 6 1 552
|
||||
39873482: 1 61 950 90 687
|
||||
136495497599: 4 878 7 7 4 48 5 3 7 99 2
|
||||
62: 5 9 3
|
||||
4072901: 4 52 40 14 1 2 9 1 4 1 8 8
|
||||
3639889: 665 7 2 540 6 46 7 1
|
||||
44833: 8 910 6 472 1 8 3 672
|
||||
226176: 2 65 275 30 608
|
||||
100819083: 3 9 6 7 16 325 116 9 18
|
||||
2124636580913: 5 382 61 9 6 580 91 1
|
||||
18389: 71 5 6 4 6 2
|
||||
74957687: 7 2 7 8 5 9 5 59 9 636 6
|
||||
1935561104: 70 129 276 8 5 58 561
|
||||
285412: 39 26 7 961 98 2
|
||||
910425: 7 9 111 4 4 5 427
|
||||
1868263488: 7 973 1 56 654 52
|
||||
356: 9 9 7 64 4
|
||||
121563: 2 3 84 6 25 566
|
||||
11793880: 9 1 1 61 292 577
|
||||
6433920: 50 265 4 8 4
|
||||
757114712: 677 795 6 739 29 86 4
|
||||
92196314: 91 427 769 314
|
||||
3622: 9 5 32 3 9 8 9 20 65
|
||||
748249: 41 5 3 5 3 9 1 101 4 810
|
||||
57521100: 67 570 940 490 3
|
||||
694140: 42 712 4 1 92
|
||||
2584: 1 9 2 2 6 8 7 8 12 7 460 4
|
||||
1299844: 72 4 567 8 8 47
|
||||
4438062035: 7 710 541 133 8 1 996
|
||||
17848382: 733 639 949 13 44
|
||||
1285415254454: 377 73 415 786 82 3 2
|
||||
42573460: 1 8 2 3 317 730 79 381
|
||||
6487474065: 4 6 6 6 4 42 4 48 4 5 7 89
|
||||
11248830: 1 570 7 7 4 3 5 7 11 6 9 6
|
||||
1236900001: 24 10 720 625 57
|
||||
774935037: 293 473 63 40 66
|
||||
121832: 7 5 3 2 6 88 1 1 552 7 3 3
|
||||
1016743: 76 37 6 658 58
|
||||
2533368513: 61 4 55 636 596 21
|
||||
6990058: 4 1 835 30 204
|
||||
1847406607: 20 526 740 9 8
|
||||
779328000: 6 373 4 2 3 8 80 9 12 5 8
|
||||
96371: 3 5 88 208 156 7
|
||||
5419039: 3 8 517 90 41
|
||||
249830: 99 374 8 177 3 7 9 8 90
|
||||
100166088: 8 9 99 5 45 733 9 264
|
||||
3376144: 7 157 927 442 7 584 6
|
||||
43593660: 11 9 537 99 41
|
||||
411324689: 7 21 208 389 4 41 29 6
|
||||
234004: 61 323 7 87 89 62
|
||||
23183285: 23 18 26 6 88
|
||||
97916165533: 269 91 4 165 535
|
||||
1112448: 9 61 841 2 5 4 3 8 9 6 89
|
||||
8963: 896 5 1
|
||||
73558189852: 5 6 9 4 6 97 6 658 2 98 7
|
||||
13680414: 49 47 66 90 594
|
||||
24172014797: 48 336 8 5 1 479 7
|
||||
9967992824: 9 41 946 706 93 28 2 4
|
||||
76153297584: 47 81 66 2 975 84
|
||||
541346194846: 45 1 6 73 5 2 97 4 2 2 5 2
|
||||
2476666710: 2 630 15 208 17 630
|
||||
60279278: 6 982 17 61 6 3 845
|
||||
55027351: 4 528 9 2 88 135
|
||||
929699919: 3 89 480 9 8 2 99 5 4 21
|
||||
257203: 304 846 14 3 2
|
||||
19954464: 4 2 199 29 8 7 2 8 6 8 12
|
||||
349703121: 87 425 69 5 1 43 8 8 9
|
||||
9607739480: 120 8 1 4 3 7 3 6 3 4 74 3
|
||||
70229: 6 57 4 3 227
|
||||
19346675608: 4 3 7 4 3 7 466 3 5 5 609
|
||||
59456: 9 39 3 3 875 64
|
||||
4049373107: 490 831 2 825 85 1 7
|
||||
38708598: 9 8 89 40 412 1 7 18 2 5
|
||||
217787072132: 186 39 5 2 3 6 9 5 355 6
|
||||
1252444294: 382 309 78 42 9
|
||||
7796721302: 7 796 71 6 5 300
|
||||
232741316: 8 29 741 314 1
|
||||
26910444: 298 907 9 879 9 15
|
||||
40916974: 2 8 5 2 9 8 6 1 5 16 971
|
||||
34830687: 15 387 6 668 19
|
||||
49022893747: 778 140 1 17 7 4 9
|
||||
240774: 4 815 4 1 5
|
||||
2030: 4 95 11 46 895
|
||||
141432: 8 9 395 3 5 8 7 8 3 49 7 1
|
||||
466823: 1 32 544 26 71
|
||||
5847912: 202 47 694 82 7
|
||||
242621: 232 7 801 56 67
|
||||
330876: 8 4 2 2 2 2 7 150 5 18 7
|
||||
93687: 25 197 3 19 55
|
||||
71444393: 1 6 5 9 7 8 5 789 8 423 9
|
||||
6751035: 1 21 553 845 258 5 1
|
||||
191462315465: 957 31 2 3 15 464
|
||||
15511497: 55 8 2 94 73 289
|
||||
494852056149: 918 7 65 77 610 4 9
|
||||
116901382: 42 97 79 9 847 3 608 6
|
||||
287727946: 1 643 7 8 1 2 799 5 1 7
|
||||
26218340: 244 68 525 56 8 8 5 5 4
|
||||
76566: 9 77 13 60 6
|
||||
1830: 292 29 891 531 87
|
||||
403126: 356 9 148 58 706
|
||||
26406: 799 7 32 525 2 79 8
|
||||
61533769122: 1 551 8 75 6 983 189
|
||||
5083523328: 909 3 8 7 1 3 976 4 1 68
|
||||
35952796: 7 5 952 35 39 5 51
|
||||
167412767: 5 1 4 1 9 8 94 38 6 7 7 70
|
||||
2195302: 85 6 308 41 46
|
||||
1474198: 69 9 5 70 54
|
||||
364088987: 88 8 41 8 987
|
||||
78139858: 1 4 5 2 19 3 628 2 7 6 5 6
|
||||
4404409: 63 832 69
|
||||
78435: 7 47 2 61 5 16 7 21 5
|
||||
757520426: 77 2 98 98 26
|
||||
203318778: 4 281 991 7 5 62 31 8
|
||||
287102009: 8 88 930 764 73 6 8 7
|
||||
90227: 48 705 88 61 26
|
||||
8181666: 73 8 8 166 9
|
||||
4345042264: 16 1 3 8 23 5 183 8 62
|
||||
1748: 74 8 5 4 2
|
||||
253: 1 3 5 5 160 54
|
||||
7800887: 9 4 5 7 5 99 79 15 94 7
|
||||
5590: 14 42 8 5 81
|
||||
37762: 87 9 48 2 9 167
|
||||
333279: 2 2 58 80 363 524 1 57
|
||||
171214269218: 844 322 681 3 63
|
||||
118944: 5 8 7 873 93
|
||||
124807260: 419 9 9 3 40 8 270 300
|
||||
57067: 5 2 65 9 88 41 1
|
||||
67645321537: 92 3 2 715 36 71 4 4 9 6
|
||||
897: 1 7 827 62
|
||||
1191701596: 94 6 393 18 83 83 3 15
|
||||
1273: 3 4 7 1
|
||||
144149: 5 9 32 78 68
|
||||
1256472: 63 7 3 2 1 539 71 277 6
|
||||
30990621: 309 83 94 668 4
|
||||
38536499222: 2 510 18 1 9 95 88 780
|
||||
856374: 5 802 1 492 5 7 17
|
||||
130842660: 3 6 58 8 1 3 793 9 4 9
|
||||
69578132: 7 21 1 5 2 47 6 99 7 1 3 3
|
||||
5276748016: 8 7 53 1 208 226 93
|
||||
48947804: 5 910 9 3 8 1 330 773 2
|
||||
194740286300: 5 8 3 275 5 5 2 67 5 89 9
|
||||
22422998: 337 7 85 37 95 905
|
||||
6918244: 6 8 497 29 1
|
||||
45185615913: 97 710 90 9 1 9 1 810 3
|
||||
316116: 27 527 2 312 54
|
||||
11292: 929 9 4 5 201 64 9 384
|
||||
143302570: 4 16 808 8 117 82 888
|
||||
6574936: 810 8 94 844 91
|
||||
19500766: 927 48 20 7 67
|
||||
5496862: 4 4 2 5 86 8 399 28 3 3 7
|
||||
4081: 4 74 6 281 7
|
||||
107041551: 2 57 2 900 35 9 52
|
||||
365716: 8 34 43 277 3 719
|
||||
233199: 34 225 11 9
|
||||
75781172: 315 75 3 8 2 9 1 6 4
|
||||
6441: 3 601 327 1 3 6 45
|
||||
72: 7 5 6
|
||||
1847: 2 645 49 191 869 90 1
|
||||
689524: 27 4 504 47 44
|
||||
421965206413: 87 9 6 8 4 5 206 391 25
|
||||
965613600002: 4 846 6 280 7 140 690
|
||||
50559280: 8 1 6 4 2 4 567 26 534 4
|
||||
365496049: 9 4 32 4 8 7 6 686 7 4 2 5
|
||||
64994090: 2 9 4 1 21 74 3 73 79 7
|
||||
1241: 1 3 4 2 7 1 927 298
|
||||
7392027906: 8 350 66 4 2 7 909
|
||||
72665135998: 6 6 743 1 3 4 3 68 727 8
|
||||
42527813: 6 563 5 4 3 74 13
|
||||
2085967: 414 4 499 14 7
|
||||
10090710861: 386 49 70 80 95 41 21
|
||||
188483597: 7 582 4 8 218 54 1 877
|
||||
367380998: 2 2 2 6 96 3 900 5 998
|
||||
68095186: 23 615 83 8 58 665 27
|
||||
6509884572: 69 3 7 3 5 447 3 29 45
|
||||
24930077: 28 690 986 2 4 3 8 70
|
||||
886840: 24 5 86 770 45 5 883
|
||||
42180751: 55 6 7 350 535 356 90
|
||||
73846429: 761 303 97 4 36
|
||||
118157648: 762 70 33 91 1 9 221
|
||||
31303: 316 129 114 56
|
||||
2340: 1 2 1 90 13
|
||||
38925682: 993 392 77 2 5
|
||||
132208396: 881 37 1 90 5 8 7 3
|
||||
17362906539: 165 30 832 90 653 6
|
||||
513060: 806 636 6 352 86
|
||||
13556739: 451 47 42 13 3
|
||||
87166290: 5 85 372 295 72 4
|
||||
2085930558: 856 47 3 770 559
|
||||
1271377657: 9 33 460 8 7 7 8 914 6 3
|
||||
92480: 40 514 24 4 40
|
||||
203612568029: 9 8 9 3 4 593 8 4 4 80 3 1
|
||||
997367027585: 79 95 567 99 21 6 2
|
||||
14986059: 5 53 1 4 2 4 3 8 9 2 2 338
|
||||
16943: 7 4 20 353
|
||||
192411245217: 1 4 16 3 411 243 2 214
|
||||
3267945: 932 5 35 316 8 35 993
|
||||
7584118814: 7 671 470 45 7 3 34
|
||||
92005506: 773 3 57 87 6 1 761 8
|
||||
83148275295: 3 339 4 451 3 44 80 9 7
|
||||
2758387: 393 7 7 3 88
|
||||
158229124: 29 55 19 2 19 6 28 3
|
||||
19731329: 2 9 1 83 7 94 6 1 2 980 9
|
||||
372969: 6 731 54 84 9
|
||||
44398676936: 995 485 95 8 446
|
||||
29: 4 8 2 5
|
||||
28812: 917 31 113 6 27
|
||||
3221058: 4 4 121 4 4 5 83 41 620
|
||||
5012875154: 898 6 867 8 88 75 157
|
||||
619: 81 324 57 159
|
||||
2000875149: 877 559 36 5 57 387 8
|
||||
538511: 4 7 544 52 863
|
||||
37415205: 7 45 7 9 84 9 78 4 9 991
|
||||
87187684: 567 6 8 2 951 2
|
||||
723726: 7 146 73 188 2 12 9 62
|
||||
5611: 15 2 2 547 8
|
||||
161732: 8 19 1 4 8 39 32
|
||||
77322232001: 8 26 104 9 591 9 93 4 1
|
||||
7664: 9 8 5 45 7 2
|
||||
43978994: 462 45 951
|
||||
184200: 63 29 10 5 4
|
||||
24754844735: 574 385 653 66 2
|
||||
38841958460: 447 488 62 14 60
|
||||
512307698: 78 476 8 7 92 35 2 978
|
||||
978764208: 1 83 5 78 7 56 484 4 8 4
|
||||
51510: 9 1 77 9 7 32 38 7 583
|
||||
519848234: 89 192 64 9 659 7 8 4 3
|
||||
279759946564: 694 6 76 839 58 1 6 8 2
|
||||
27642337368: 30 7 9 658 999 7 368
|
||||
1714046887054: 9 4 3 88 3 699 1 7 3 976
|
||||
2096866: 762 7 4 2 9 7 4 7 1 2 27 2
|
||||
829347: 57 9 11 283 50 19
|
||||
5188: 9 98 18 397 4
|
||||
8546580: 3 931 494 63 95
|
||||
2569449: 4 318 202 3 8
|
||||
1008685401: 3 24 22 9 26 3 511 2 8
|
||||
38907: 341 1 41 3 61 4 64
|
||||
47134149: 59 5 6 423 9 55 2 6 37
|
||||
156: 4 5 48 80 8
|
||||
13690: 373 8 21 967 3
|
||||
152680: 5 4 62 3 9 75 1 7 6 2 5 4
|
||||
22638959: 203 8 12 282 4 90
|
||||
667766987: 6 184 969 39 93 7 5 3 2
|
||||
491050285: 9 3 9 9 9 7 6 28 270 6 8 3
|
||||
123681: 9 1 5 8 4 88 91 3 4 5 14 3
|
||||
2442314: 2 5 7 9 947
|
||||
66996296: 6 1 9 7 48 8 1 1 8 4 4 372
|
||||
527: 6 5 6 4 2
|
||||
18881838: 929 53 32 45 52 21 6
|
||||
41565: 44 3 73 665 8 52 2
|
||||
38558: 1 5 21 68 21
|
||||
6715471: 839 434 8
|
||||
6389: 91 7 6 9 5 7 178 974 5 4
|
||||
2117591196: 3 5 748 679 614 9 3 94
|
||||
28162196: 8 7 1 32 2 196
|
||||
35808181: 2 2 8 746 180
|
||||
9867444479: 73 352 40 6 9 1 2 48 1 4
|
||||
78674: 7 501 25 659 66
|
||||
45024: 4 4 3 3 18 18 57 276 7
|
||||
19756: 4 99 3 942 7
|
||||
799: 34 57 708
|
||||
157466: 8 2 6 8 7 678 40 9 6 69
|
||||
12013722: 53 771 14 3 7
|
||||
305851750: 8 736 8 8 5 6 3 34 8 7 5 1
|
||||
31627: 85 8 4 85 7
|
||||
120636732: 750 274 14 587 7 7
|
||||
239363098: 57 7 6 69 1 1 1 8 59 5 4 6
|
||||
23142: 7 7 4 3 8 579 6 6 8 8 50
|
||||
330: 3 42 4 9 8 5
|
||||
610059: 3 3 2 541 80 888
|
||||
15743730746: 31 237 561 6 84
|
||||
1289162: 5 6 57 370 11 28 8 5 2
|
||||
4912012: 49 120 12
|
||||
21034792439: 47 1 58 1 7 2 7 915 9 39
|
||||
10550: 2 3 9 970 45 8 514 1 5
|
||||
27651: 2 9 1 8 1 5 8 7 8 4 4 35
|
||||
53322: 8 87 4 8 2 66 63 96 759
|
||||
138446470: 26 6 47 682 4 71
|
||||
1648416: 9 278 7 657 3
|
||||
6538688411: 30 351 741 838 668
|
||||
1344480: 7 466 85 43 7 56 424
|
||||
244514648942: 468 4 7 2 5 2 1 2 37 945
|
||||
241060: 8 3 5 67 8 69 6 48 4
|
||||
40133289211: 659 7 87 9 7 2 9 17 4 1
|
||||
435126: 783 57 518 8
|
||||
17711006228220: 76 834 259 998 890
|
||||
5734080: 36 1 1 288 55
|
||||
8979895786: 9 2 93 110 38 8 5 21
|
||||
3330: 532 23 6
|
||||
10241840: 102 34 7 8 38
|
||||
13305407: 2 1 4 5 8 7 259 5 2 12 5 2
|
||||
1433165: 3 9 1 891 73 367 65
|
||||
177433659084: 44 3 58 41 477 10 4 2
|
||||
222432: 311 919 67 3 4 6 71 56
|
||||
85538: 1 4 7 2 910
|
||||
32399920: 9 4 9 9 9 343 93 8 3 8 70
|
||||
3157308169: 1 373 938 9 169
|
||||
48314570: 8 329 1 58 9 3 470 5
|
||||
2157760504767: 751 9 9 76 9 2 9 7 9 2 8 3
|
||||
113124347: 1 9 87 43 2 9 95 347 1
|
||||
234373743: 2 9 28 89 3 4 285
|
||||
65134472: 65 133 910 5 559
|
||||
5111: 5 42 2 513 9 53
|
||||
280608943: 45 909 7 7 7 5 5 9 4 587
|
||||
4944: 40 1 9 45
|
||||
177101: 80 4 186 35 2
|
||||
8123256299: 643 1 251 7 58 4 9 296
|
||||
2610013: 28 55 24 2 655 487 6
|
||||
3473695: 10 681 6 7 17 5
|
||||
102288: 44 8 693 6 8 980 4 2
|
||||
792006: 80 9 71 8 1 44 73 6 82
|
||||
8393424: 656 4 6 4 3 8 4 9 8 87 3 4
|
||||
3357448904: 9 2 514 71 901
|
||||
11955840: 5 778 1 3 2 8 3 2 4 4 16
|
||||
33523655: 1 1 3 1 1 294 8 68 4 5 8 3
|
||||
40658: 1 477 43 78 20
|
||||
419: 5 99 4
|
||||
10692: 9 8 4 4 27
|
||||
2316100872: 772 5 1 6 812 6
|
||||
8456347: 98 587 147 25
|
||||
45388: 6 755 4 4 18 59
|
||||
98449258: 90 859 57 260 7
|
||||
290537744: 880 4 3 514 8 11
|
||||
1920630535: 5 7 1 57 4 6 4 84 1 771
|
||||
41738341141: 8 3 103 9 3 4 6 5 962
|
||||
267888: 53 5 71 5 36
|
||||
457162268328: 14 3 754 7 71 9 6 318
|
||||
9818370: 378 26 9 30 10 3 90
|
||||
136158886: 8 1 7 95 325 2 1 5 3 8 7
|
||||
407: 6 42 69 8 78
|
||||
1012705468: 822 4 44 7 657 811
|
||||
4180406340096: 466 981 98 12 6 36 9 4
|
||||
10705064: 4 424 136 5 931 181
|
||||
2217819683: 7 51 62 9 9 423 96 3 5 4
|
||||
7508279323: 3 250 555 272 3 6 32 2
|
||||
2658216: 558 18 25 4 66
|
||||
59297: 60 97 2 747 351
|
||||
7495229447: 8 328 9 266 28 50
|
||||
2644059830523: 57 55 2 97 574 815 8
|
||||
54008124608: 94 751 10 958 57
|
||||
2207268: 50 592 72 49 50 7 9
|
||||
9395936945: 83 33 540 34 9 806 4
|
||||
65754981: 340 41 89 53
|
||||
5424: 267 8 2 69
|
||||
194627: 564 43 8 613 1
|
||||
75167376: 75 166 1 972 404
|
||||
237336645000: 628 915 45 700 590
|
||||
522553: 7 58 4 91 7 2 7 9 148 49
|
||||
4897: 29 13 6 95
|
||||
13670996090: 500 614 6 73 31 610
|
||||
16290039939: 74 7 6 1 7 882 87 2 438
|
||||
2804002896239: 85 2 41 17 5 52 774 5
|
||||
86506: 910 1 29 157 73 74
|
||||
21660911180: 722 2 15 911 180
|
||||
6815: 6 743 72
|
||||
114802992537: 6 17 215 5 39 1 5 186 2
|
||||
720907: 203 61 587 39 81 8
|
||||
15904808: 28 3 80 96 5 5
|
||||
200829237621: 999 710 37 3 744 27
|
||||
95188135587: 835 3 68 49 755 579 8
|
||||
61525: 81 49 4 75 3 4 5 8 28
|
||||
13221210319: 3 486 9 6 6 4 20 5 5 6 2 8
|
||||
3728996709124: 945 71 9 708 62 96 6 1
|
||||
39283710: 7 46 6 3 64 51 9 717
|
||||
24046652: 1 8 92 61 34 2 646 46 7
|
||||
178492223: 4 1 18 61 81 5 7 2 8 194
|
||||
1677144138: 6 123 83 227 39
|
||||
105579656: 2 3 4 7 2 96 8 6 63 6 366
|
||||
78276190303: 7 94 9 131 13 41 3 7 9
|
||||
110367683: 778 9 8 5 5 3 4 9 394 9
|
||||
7626312605: 4 502 5 552 1 72 598 5
|
||||
56319236258: 9 5 39 82 6 8 9 548 258
|
||||
5406139: 642 842 45 4 6
|
||||
45342: 7 29 96 267 8 1 2 50
|
||||
7525096: 1 820 330 35 97
|
||||
80899207: 11 236 80 9 7
|
||||
1022048029: 328 76 82 5 24 7
|
||||
853304431680: 313 630 752 6 603
|
||||
4608388638: 31 9 958 177 93
|
||||
68959734: 7 8 33 5 44 732 6 2 6 4
|
||||
4653: 845 319 4
|
||||
2523796352: 2 51 789 2 4 8 98
|
||||
185856: 885 21 6
|
||||
19948509: 72 83 24 3 910 396
|
||||
1680716: 236 37 35 71 3
|
||||
Binary file not shown.
@@ -0,0 +1,125 @@
|
||||
--- Day 8: Resonant Collinearity ---
|
||||
|
||||
You find yourselves on the roof of a top-secret Easter Bunny installation.
|
||||
|
||||
While The Historians do their thing, you take a look at the familiar huge antenna. Much to your surprise, it seems to have been reconfigured to emit a signal that makes people 0.1% more likely to buy Easter Bunny brand Imitation Mediocre Chocolate as a Christmas gift! Unthinkable!
|
||||
|
||||
Scanning across the city, you find that there are actually many such antennas. Each antenna is tuned to a specific frequency indicated by a single lowercase letter, uppercase letter, or digit. You create a map (your puzzle input) of these antennas. For example:
|
||||
|
||||
............
|
||||
........0...
|
||||
.....0......
|
||||
.......0....
|
||||
....0.......
|
||||
......A.....
|
||||
............
|
||||
............
|
||||
........A...
|
||||
.........A..
|
||||
............
|
||||
............
|
||||
|
||||
The signal only applies its nefarious effect at specific antinodes based on the resonant frequencies of the antennas. In particular, an antinode occurs at any point that is perfectly in line with two antennas of the same frequency - but only when one of the antennas is twice as far away as the other. This means that for any pair of antennas with the same frequency, there are two antinodes, one on either side of them.
|
||||
|
||||
So, for these two antennas with frequency a, they create the two antinodes marked with #:
|
||||
|
||||
..........
|
||||
...#......
|
||||
..........
|
||||
....a.....
|
||||
..........
|
||||
.....a....
|
||||
..........
|
||||
......#...
|
||||
..........
|
||||
..........
|
||||
|
||||
Adding a third antenna with the same frequency creates several more antinodes. It would ideally add four antinodes, but two are off the right side of the map, so instead it adds only two:
|
||||
|
||||
..........
|
||||
...#......
|
||||
#.........
|
||||
....a.....
|
||||
........a.
|
||||
.....a....
|
||||
..#.......
|
||||
......#...
|
||||
..........
|
||||
..........
|
||||
|
||||
Antennas with different frequencies don't create antinodes; A and a count as different frequencies. However, antinodes can occur at locations that contain antennas. In this diagram, the lone antenna with frequency capital A creates no antinodes but has a lowercase-a-frequency antinode at its location:
|
||||
|
||||
..........
|
||||
...#......
|
||||
#.........
|
||||
....a.....
|
||||
........a.
|
||||
.....a....
|
||||
..#.......
|
||||
......A...
|
||||
..........
|
||||
..........
|
||||
|
||||
The first example has antennas with two different frequencies, so the antinodes they create look like this, plus an antinode overlapping the topmost A-frequency antenna:
|
||||
|
||||
......#....#
|
||||
...#....0...
|
||||
....#0....#.
|
||||
..#....0....
|
||||
....0....#..
|
||||
.#....A.....
|
||||
...#........
|
||||
#......#....
|
||||
........A...
|
||||
.........A..
|
||||
..........#.
|
||||
..........#.
|
||||
|
||||
Because the topmost A-frequency antenna overlaps with a 0-frequency antinode, there are 14 total unique locations that contain an antinode within the bounds of the map.
|
||||
|
||||
Calculate the impact of the signal. How many unique locations within the bounds of the map contain an antinode?
|
||||
|
||||
Your puzzle answer was 269.
|
||||
--- Part Two ---
|
||||
|
||||
Watching over your shoulder as you work, one of The Historians asks if you took the effects of resonant harmonics into your calculations.
|
||||
|
||||
Whoops!
|
||||
|
||||
After updating your model, it turns out that an antinode occurs at any grid position exactly in line with at least two antennas of the same frequency, regardless of distance. This means that some of the new antinodes will occur at the position of each antenna (unless that antenna is the only one of its frequency).
|
||||
|
||||
So, these three T-frequency antennas now create many antinodes:
|
||||
|
||||
T....#....
|
||||
...T......
|
||||
.T....#...
|
||||
.........#
|
||||
..#.......
|
||||
..........
|
||||
...#......
|
||||
..........
|
||||
....#.....
|
||||
..........
|
||||
|
||||
In fact, the three T-frequency antennas are all exactly in line with two antennas, so they are all also antinodes! This brings the total number of antinodes in the above example to 9.
|
||||
|
||||
The original example now has 34 antinodes, including the antinodes that appear on every antenna:
|
||||
|
||||
##....#....#
|
||||
.#.#....0...
|
||||
..#.#0....#.
|
||||
..##...0....
|
||||
....0....#..
|
||||
.#...#A....#
|
||||
...#..#.....
|
||||
#....#.#....
|
||||
..#.....A...
|
||||
....#....A..
|
||||
.#........#.
|
||||
...#......##
|
||||
|
||||
Calculate the impact of the signal using this updated model. How many unique locations within the bounds of the map contain an antinode?
|
||||
|
||||
Your puzzle answer was 949.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
from itertools import combinations
|
||||
from copy import deepcopy
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
mp = [list(line.strip('\n')) for line in open(sys.argv[1])]
|
||||
antinodes = deepcopy(mp)
|
||||
ah = deepcopy(mp)
|
||||
|
||||
antennas = {}
|
||||
for j, y in enumerate(mp):
|
||||
for i, x in enumerate(y):
|
||||
if x != '.':
|
||||
if x in antennas: antennas[x].append((i,j))
|
||||
else: antennas[x] = [(i,j)]
|
||||
ah[j][i] = '#'
|
||||
|
||||
for freq, ants in antennas.items():
|
||||
for a1, a2 in combinations(ants, 2):
|
||||
dx, dy = a2[0] - a1[0], a2[1] - a1[1]
|
||||
x1, y1 = a1[0] - dx, a1[1] - dy
|
||||
x2, y2 = a2[0] + dx, a2[1] + dy
|
||||
if (0 <= x1 < len(mp[0])) and (0 <= y1 < len(mp)):
|
||||
antinodes[y1][x1] = '#'
|
||||
if (0 <= x2 < len(mp[0])) and (0 <= y2 < len(mp)):
|
||||
antinodes[y2][x2] = '#'
|
||||
while (0 <= x1 < len(mp[0])) and (0 <= y1 < len(mp)):
|
||||
ah[y1][x1] = '#'
|
||||
x1, y1 = x1-dx, y1-dy
|
||||
while (0 <= x2 < len(mp[0])) and (0 <= y2 < len(mp)):
|
||||
ah[y2][x2] = '#'
|
||||
x2, y2 = x2+dx, y2+dy
|
||||
|
||||
# challenge 1
|
||||
res1 = sum([a.count('#') for a in antinodes])
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
res2 = sum([a.count('#') for a in ah])
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
............
|
||||
........0...
|
||||
.....0......
|
||||
.......0....
|
||||
....0.......
|
||||
......A.....
|
||||
............
|
||||
............
|
||||
........A...
|
||||
.........A..
|
||||
............
|
||||
............
|
||||
@@ -0,0 +1,50 @@
|
||||
...............................6.B..........P.....
|
||||
n..............M..................................
|
||||
....n.....sM7.............................6.....p.
|
||||
......................Mr......................P...
|
||||
.......n.......................................p.E
|
||||
.......................6...................p......
|
||||
r..............................C........B....P....
|
||||
.....................d........6......B4....P......
|
||||
.........................7....................4...
|
||||
.n......................R..............4..........
|
||||
.....N........S.................K.C..........4....
|
||||
...........N..r.....................B....K........
|
||||
..................................................
|
||||
......N.......x.............7.......K.....2....E..
|
||||
...................r..H........R..................
|
||||
.....................s....p........C...........2..
|
||||
....3.......................M.....................
|
||||
........k....................H....5...............
|
||||
.....x....N................d.5..y................J
|
||||
m.....................d7...................J......
|
||||
.......exk........................................
|
||||
.......x.............5.......R....................
|
||||
..........eY......................................
|
||||
...S.3..............................O.E...J.......
|
||||
.......8...H....k...............J.................
|
||||
......S.e.........C.H.....................X.....y.
|
||||
................j..........y.........2............
|
||||
...........e.........k............................
|
||||
......YS...3..............5..........K...XR.......
|
||||
...m..............j.s..........c..................
|
||||
.........................j........................
|
||||
...............j..................................
|
||||
.....m................................2...........
|
||||
.........Y......................................b.
|
||||
..................................................
|
||||
.......................h...........b..............
|
||||
............m......D..............d...............
|
||||
........o......D..................................
|
||||
...................................O..............
|
||||
..................................................
|
||||
......8...........................................
|
||||
........D.Y..o...................1................
|
||||
.....................................b..9.........
|
||||
........................h..0......................
|
||||
.....o......................h..0........b1........
|
||||
.........8.............X..........................
|
||||
..........o..........c..........1...........O.....
|
||||
....8....................y0...c...................
|
||||
..............D.......c..................9..0.....
|
||||
............................1..........O..9.......
|
||||
Binary file not shown.
@@ -0,0 +1,77 @@
|
||||
--- Day 9: Disk Fragmenter ---
|
||||
|
||||
Another push of the button leaves you in the familiar hallways of some friendly amphipods! Good thing you each somehow got your own personal mini submarine. The Historians jet away in search of the Chief, mostly by driving directly into walls.
|
||||
|
||||
While The Historians quickly figure out how to pilot these things, you notice an amphipod in the corner struggling with his computer. He's trying to make more contiguous free space by compacting all of the files, but his program isn't working; you offer to help.
|
||||
|
||||
He shows you the disk map (your puzzle input) he's already generated. For example:
|
||||
|
||||
2333133121414131402
|
||||
|
||||
The disk map uses a dense format to represent the layout of files and free space on the disk. The digits alternate between indicating the length of a file and the length of free space.
|
||||
|
||||
So, a disk map like 12345 would represent a one-block file, two blocks of free space, a three-block file, four blocks of free space, and then a five-block file. A disk map like 90909 would represent three nine-block files in a row (with no free space between them).
|
||||
|
||||
Each file on disk also has an ID number based on the order of the files as they appear before they are rearranged, starting with ID 0. So, the disk map 12345 has three files: a one-block file with ID 0, a three-block file with ID 1, and a five-block file with ID 2. Using one character for each block where digits are the file ID and . is free space, the disk map 12345 represents these individual blocks:
|
||||
|
||||
0..111....22222
|
||||
|
||||
The first example above, 2333133121414131402, represents these individual blocks:
|
||||
|
||||
00...111...2...333.44.5555.6666.777.888899
|
||||
|
||||
The amphipod would like to move file blocks one at a time from the end of the disk to the leftmost free space block (until there are no gaps remaining between file blocks). For the disk map 12345, the process looks like this:
|
||||
|
||||
0..111....22222
|
||||
02.111....2222.
|
||||
022111....222..
|
||||
0221112...22...
|
||||
02211122..2....
|
||||
022111222......
|
||||
|
||||
The first example requires a few more steps:
|
||||
|
||||
00...111...2...333.44.5555.6666.777.888899
|
||||
009..111...2...333.44.5555.6666.777.88889.
|
||||
0099.111...2...333.44.5555.6666.777.8888..
|
||||
00998111...2...333.44.5555.6666.777.888...
|
||||
009981118..2...333.44.5555.6666.777.88....
|
||||
0099811188.2...333.44.5555.6666.777.8.....
|
||||
009981118882...333.44.5555.6666.777.......
|
||||
0099811188827..333.44.5555.6666.77........
|
||||
00998111888277.333.44.5555.6666.7.........
|
||||
009981118882777333.44.5555.6666...........
|
||||
009981118882777333644.5555.666............
|
||||
00998111888277733364465555.66.............
|
||||
0099811188827773336446555566..............
|
||||
|
||||
The final step of this file-compacting process is to update the filesystem checksum. To calculate the checksum, add up the result of multiplying each of these blocks' position with the file ID number it contains. The leftmost block is in position 0. If a block contains free space, skip it instead.
|
||||
|
||||
Continuing the first example, the first few blocks' position multiplied by its file ID number are 0 * 0 = 0, 1 * 0 = 0, 2 * 9 = 18, 3 * 9 = 27, 4 * 8 = 32, and so on. In this example, the checksum is the sum of these, 1928.
|
||||
|
||||
Compact the amphipod's hard drive using the process he requested. What is the resulting filesystem checksum? (Be careful copy/pasting the input for this puzzle; it is a single, very long line.)
|
||||
|
||||
Your puzzle answer was 6288599492129.
|
||||
--- Part Two ---
|
||||
|
||||
Upon completion, two things immediately become clear. First, the disk definitely has a lot more contiguous free space, just like the amphipod hoped. Second, the computer is running much more slowly! Maybe introducing all of that file system fragmentation was a bad idea?
|
||||
|
||||
The eager amphipod already has a new plan: rather than move individual blocks, he'd like to try compacting the files on his disk by moving whole files instead.
|
||||
|
||||
This time, attempt to move whole files to the leftmost span of free space blocks that could fit the file. Attempt to move each file exactly once in order of decreasing file ID number starting with the file with the highest file ID number. If there is no span of free space to the left of a file that is large enough to fit the file, the file does not move.
|
||||
|
||||
The first example from above now proceeds differently:
|
||||
|
||||
00...111...2...333.44.5555.6666.777.888899
|
||||
0099.111...2...333.44.5555.6666.777.8888..
|
||||
0099.1117772...333.44.5555.6666.....8888..
|
||||
0099.111777244.333....5555.6666.....8888..
|
||||
00992111777.44.333....5555.6666.....8888..
|
||||
|
||||
The process of updating the filesystem checksum is the same; now, this example's checksum would be 2858.
|
||||
|
||||
Start over, now compacting the amphipod's hard drive using this new method instead. What is the resulting filesystem checksum?
|
||||
|
||||
Your puzzle answer was 6321896265143.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+69
@@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
from copy import deepcopy
|
||||
|
||||
|
||||
def compress(mem):
|
||||
blocks = deepcopy(mem)
|
||||
r = len(blocks) - 1
|
||||
for p, b in enumerate(blocks):
|
||||
if b == None:
|
||||
while blocks[r] == None: r -= 1
|
||||
# if you check this before moving it obviously does not work
|
||||
if p >= r: break
|
||||
blocks[p] = blocks[r]
|
||||
blocks[r] = None
|
||||
return blocks
|
||||
|
||||
|
||||
def block_compress(free, full, size):
|
||||
memory = [None] * size
|
||||
for id, pos in reversed(full.items()):
|
||||
p, b = pos
|
||||
for i in sorted(free.keys()):
|
||||
if i >= p: break
|
||||
if free[i] < b: continue
|
||||
else: p = i
|
||||
if p != pos[0]:
|
||||
free[p+b] = free[p] - b
|
||||
free.pop(p)
|
||||
if (pos[0]+b) in free:
|
||||
free[pos[0]] = b + free[pos[0]+b]
|
||||
free.pop(pos[0]+b)
|
||||
else: free[pos[0]] = b
|
||||
for j in range (p, p+b): memory[j] = id
|
||||
return memory
|
||||
|
||||
|
||||
def checksum(blocks):
|
||||
cs = 0
|
||||
for p, b in enumerate(blocks):
|
||||
if b == None: continue
|
||||
cs += p * b
|
||||
return cs
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
blocks = [int(n) for n in list(open(sys.argv[1]).read().strip('\n'))]
|
||||
|
||||
memory = [None] * sum(blocks)
|
||||
p, id = 0, 0
|
||||
free, full = {}, {}
|
||||
|
||||
for i, b in enumerate(blocks):
|
||||
if i % 2 == 0 and b > 0:
|
||||
for j in range (p, p+b): memory[j] = id
|
||||
full[id] = (p, b)
|
||||
id += 1
|
||||
else: free[p] = b
|
||||
p += b
|
||||
|
||||
# challenge 1
|
||||
res1 = checksum(compress(memory))
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
res2 = checksum(block_compress(free, full, sum(blocks)))
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
2333133121414131402
|
||||
@@ -0,0 +1 @@
|
||||
6337613674436833695582382518294574934721895775456926659050519789764499137091974516817593123529825470413735998773313821249746165140476827548333979879759812148140743921984858367387865689863575979767978384602135617653231357745451442716162787988827217792125086367824652239497919721686553336289590824034825884491882728622562067753798821229222238807634124749916752577072651378955553992845307918307276391238273773149858396433832536796653365434709657851887396187578778147166906832666361736921666530215593938020386798211757213535118020656880772626853567534823537521847840542462424239748076442664335159933397986757683414553370933017533841909225785682535581657913534751914590354573479543352482677664279490115563578845916997385280799060446627827972734570759842272566609483169585119611369745574079877574611920292074449221344989775049422092807055209772581092501625426515216037533372713253769756161167528724961425674338433856921993913658367042577497436930301681312780243028924226184437743980832960764956152123711024813868188023445957797073319557834842443457408060431584672765711965523592339064155945688420399677786021375036865224718236192794168244218132331879653238514185879711274422704721314129454939677194798258512282384257688549556871296166858544234847196990249480549228468620477732643536689838393877978653367792853453997762592631241338636138577555428914232648823466514071894652137678142034849239193626153640623580414314608933385485612012888459733812386760439427452815938894615323396842132211755866147610694370823973397748963732281746466628818129365432979699941761269528742324281144556379381879602911724569887421245076318843809377436853841020844590787517655729552955292366331147517060174571596182569363324916905792827650803161491453136021278077732064374448109498165846527088615498892332771430958179814356621939482129587840825717107138658080991769344985444860919820564023672497821693314755599976209047988027535412418173944146379780263754526214261017834795745288115763115420595437959121698079541886909440959071743761324933549055785895219883434371956470166162332913626974228698704867909040649016617460867032767038334727116689244913263370265020373034542849904912599647836283459162238825918961705866907222166252213569835943736588468231414457382040649035476988352594163315317533816572151422835818584798813953851735242330898787799654338389819473342688805893283467278648262129884651697935311570182570622882847035353690402079255041929980106820933987229229797544269317587273137530758375497634699083283818553718955173431710764611483099989260285267944525422740201440336499923419596970234642786695265316332262177054801980634357789526362333385795223688334671859856597460299593595342948524369087665258874015146296241079817536554214141611547952197222448591679959466790128097793753463968675487268040477815563380229164213672752215208397193598924987982747832046393487916058272183247276523097304784635757381389468220157974675179325452839698486360399879695439645913991513175369124373993030541020107278592224606843141533658010212677209043325490342134728924457069965191109858378318612965799852635497747794734595236056575848591924766220818282475324396727508923606980769458725299525452612238764560262657775582924569776483862349887068324449156297506644312010698479354773245797667563279586421294657685887842714452735721406358806171998745643329816772286796704744766044588635885245655459774311291948625491629489845688426449351717832871305285577753164547112747414863694575184763986239102380914887326641428026877699225992392096482370418830381415159027914953351339474421536726145911393866697198669419803537365630324763404171851150754014952414412764421984874654951033761733339938562539501446678133468715754993394758543046223523398728955356737781406931429746223633763241354625939226463718409470443784758784373146313839928768614814211356253038934558927790904988453344509018747586929116183883508082777047599959667039225085656443324675746726742070671570757088224324721174549372663665357073604929544480355015119614695352475587896476298629578751175152953418694340237315682094281425544939961496671928705760203087589687943595183450878840612944545990131498239234836114902680973922971833131647941447156647709468389679862137111593607085798425435736388659127388489737118418537272479942534595188821602597196231331570739573219060339186363023917360728735156330123729551057656522303564363389388580584548939620728350317592847949877699604391352991731027339689607733987355581433793686246693841298838454573798145112168184911056903380103939467378844737779330194582116721272190126779182733559651836358413812266428668253391218604697749045971951622863863588909757411613156843452329293637464367447412392465939681589644859070551682234527516285233194458768183747577595703213148321859615511124931012101096951580915748936348216536567577647345618573868040994546908948496431144262585963718473204983249712109511962363539684909657287652765145553168177329822059904713775018257475153084721036958345931122317816828966716917929036331813946978532772968156626894887060457595911112698Line truncated
|
||||
@@ -0,0 +1,130 @@
|
||||
--- Day 10: Hoof It ---
|
||||
|
||||
You all arrive at a Lava Production Facility on a floating island in the sky. As the others begin to search the massive industrial complex, you feel a small nose boop your leg and look down to discover a reindeer wearing a hard hat.
|
||||
|
||||
The reindeer is holding a book titled "Lava Island Hiking Guide". However, when you open the book, you discover that most of it seems to have been scorched by lava! As you're about to ask how you can help, the reindeer brings you a blank topographic map of the surrounding area (your puzzle input) and looks up at you excitedly.
|
||||
|
||||
Perhaps you can help fill in the missing hiking trails?
|
||||
|
||||
The topographic map indicates the height at each position using a scale from 0 (lowest) to 9 (highest). For example:
|
||||
|
||||
0123
|
||||
1234
|
||||
8765
|
||||
9876
|
||||
|
||||
Based on un-scorched scraps of the book, you determine that a good hiking trail is as long as possible and has an even, gradual, uphill slope. For all practical purposes, this means that a hiking trail is any path that starts at height 0, ends at height 9, and always increases by a height of exactly 1 at each step. Hiking trails never include diagonal steps - only up, down, left, or right (from the perspective of the map).
|
||||
|
||||
You look up from the map and notice that the reindeer has helpfully begun to construct a small pile of pencils, markers, rulers, compasses, stickers, and other equipment you might need to update the map with hiking trails.
|
||||
|
||||
A trailhead is any position that starts one or more hiking trails - here, these positions will always have height 0. Assembling more fragments of pages, you establish that a trailhead's score is the number of 9-height positions reachable from that trailhead via a hiking trail. In the above example, the single trailhead in the top left corner has a score of 1 because it can reach a single 9 (the one in the bottom left).
|
||||
|
||||
This trailhead has a score of 2:
|
||||
|
||||
...0...
|
||||
...1...
|
||||
...2...
|
||||
6543456
|
||||
7.....7
|
||||
8.....8
|
||||
9.....9
|
||||
|
||||
(The positions marked . are impassable tiles to simplify these examples; they do not appear on your actual topographic map.)
|
||||
|
||||
This trailhead has a score of 4 because every 9 is reachable via a hiking trail except the one immediately to the left of the trailhead:
|
||||
|
||||
..90..9
|
||||
...1.98
|
||||
...2..7
|
||||
6543456
|
||||
765.987
|
||||
876....
|
||||
987....
|
||||
|
||||
This topographic map contains two trailheads; the trailhead at the top has a score of 1, while the trailhead at the bottom has a score of 2:
|
||||
|
||||
10..9..
|
||||
2...8..
|
||||
3...7..
|
||||
4567654
|
||||
...8..3
|
||||
...9..2
|
||||
.....01
|
||||
|
||||
Here's a larger example:
|
||||
|
||||
89010123
|
||||
78121874
|
||||
87430965
|
||||
96549874
|
||||
45678903
|
||||
32019012
|
||||
01329801
|
||||
10456732
|
||||
|
||||
This larger example has 9 trailheads. Considering the trailheads in reading order, they have scores of 5, 6, 5, 3, 1, 3, 5, 3, and 5. Adding these scores together, the sum of the scores of all trailheads is 36.
|
||||
|
||||
The reindeer gleefully carries over a protractor and adds it to the pile. What is the sum of the scores of all trailheads on your topographic map?
|
||||
|
||||
Your puzzle answer was 629.
|
||||
--- Part Two ---
|
||||
|
||||
The reindeer spends a few minutes reviewing your hiking trail map before realizing something, disappearing for a few minutes, and finally returning with yet another slightly-charred piece of paper.
|
||||
|
||||
The paper describes a second way to measure a trailhead called its rating. A trailhead's rating is the number of distinct hiking trails which begin at that trailhead. For example:
|
||||
|
||||
.....0.
|
||||
..4321.
|
||||
..5..2.
|
||||
..6543.
|
||||
..7..4.
|
||||
..8765.
|
||||
..9....
|
||||
|
||||
The above map has a single trailhead; its rating is 3 because there are exactly three distinct hiking trails which begin at that position:
|
||||
|
||||
.....0. .....0. .....0.
|
||||
..4321. .....1. .....1.
|
||||
..5.... .....2. .....2.
|
||||
..6.... ..6543. .....3.
|
||||
..7.... ..7.... .....4.
|
||||
..8.... ..8.... ..8765.
|
||||
..9.... ..9.... ..9....
|
||||
|
||||
Here is a map containing a single trailhead with rating 13:
|
||||
|
||||
..90..9
|
||||
...1.98
|
||||
...2..7
|
||||
6543456
|
||||
765.987
|
||||
876....
|
||||
987....
|
||||
|
||||
This map contains a single trailhead with rating 227 (because there are 121 distinct hiking trails that lead to the 9 on the right edge and 106 that lead to the 9 on the bottom edge):
|
||||
|
||||
012345
|
||||
123456
|
||||
234567
|
||||
345678
|
||||
4.6789
|
||||
56789.
|
||||
|
||||
Here's the larger example from before:
|
||||
|
||||
89010123
|
||||
78121874
|
||||
87430965
|
||||
96549874
|
||||
45678903
|
||||
32019012
|
||||
01329801
|
||||
10456732
|
||||
|
||||
Considering its trailheads in reading order, they have ratings of 20, 24, 10, 4, 1, 4, 5, 8, and 5. The sum of all trailhead ratings in this larger example topographic map is 81.
|
||||
|
||||
You're not sure how, but the reindeer seems to have crafted some tiny flags out of toothpicks and bits of paper and is using them to mark trailheads on your topographic map. What is the sum of the ratings of all trailheads?
|
||||
|
||||
Your puzzle answer was 1242.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
def trailhead_score(tm, x, y):
|
||||
height = tm[y][x]
|
||||
end_positions = set([])
|
||||
if height == 9: return set([(x,y)])
|
||||
directions = [(0,1), (1,0), (0,-1), (-1,0)]
|
||||
for d in directions:
|
||||
nx, ny = x+d[0], y+d[1]
|
||||
if nx < 0 or ny < 0: continue
|
||||
try:
|
||||
if tm[ny][nx] - height == 1:
|
||||
end_positions = end_positions.union(trailhead_score(tm, nx, ny))
|
||||
except IndexError: continue
|
||||
return end_positions
|
||||
|
||||
|
||||
def trailhead_ranking(tm, x, y):
|
||||
height = tm[y][x]
|
||||
score = 0
|
||||
if height == 9: return 1
|
||||
directions = [(0,1), (1,0), (0,-1), (-1,0)]
|
||||
for d in directions:
|
||||
nx, ny = x+d[0], y+d[1]
|
||||
if nx < 0 or ny < 0: continue
|
||||
try:
|
||||
if tm[ny][nx] - height == 1:
|
||||
score += trailhead_ranking(tm, nx, ny)
|
||||
except IndexError: continue
|
||||
return score
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
tm = [[int(l) for l in line.strip('\n')] for line in open(sys.argv[1])]
|
||||
res1, res2 = 0, 0
|
||||
for j, y in enumerate(tm):
|
||||
for i, x in enumerate(y):
|
||||
if x == 0:
|
||||
res1 += len(trailhead_score(tm, i, j))
|
||||
res2 += trailhead_ranking(tm, i, j)
|
||||
|
||||
# challenge 1
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
89010123
|
||||
78121874
|
||||
87430965
|
||||
96549874
|
||||
45678903
|
||||
32019012
|
||||
01329801
|
||||
10456732
|
||||
@@ -0,0 +1,50 @@
|
||||
56760198543405456770107687012987873265430701234123
|
||||
47891087612514320889298596543236982176321878985054
|
||||
30932912503423411978321436760145453089490965076567
|
||||
21043803498598502565450345897896334569584324105498
|
||||
43256754387687643445601231056787276578675013212389
|
||||
50105620896014553238782322348996189432106522301210
|
||||
60234211205423469109695210567345023456987101232569
|
||||
71454301312345678100556501051269010787832198543478
|
||||
82365985407856743291447892340178732696949037643323
|
||||
99878876556989856782332309650065341054658743252110
|
||||
12389565445845698943221218761234456565789650167087
|
||||
03458890330532787892100321052442787074656782108996
|
||||
12766721221621056521098478934321692183245891210105
|
||||
00875437876521245430167569035630013290194300121234
|
||||
21980356985430130101456122128754324389980215432101
|
||||
32341245234561221212340033439961015671271326990123
|
||||
41239832101676678703121542345872343760362347887654
|
||||
50146701098787569254035671096112654854454558943210
|
||||
69655410889693452164549389987003569943003967656787
|
||||
78789324989582543076678432176124578752112876545490
|
||||
49670123476451001289986581065437669801198743454321
|
||||
34565404560302654345677893034458954321034652345210
|
||||
21670313401212701238766732123361056700125601216787
|
||||
10781223304343870349676678901272341811098700305891
|
||||
87690433210154901234587565078980110925643212456730
|
||||
98521049873269100448996652169765223434756965569821
|
||||
83430656794378234567385543258894304589807874321034
|
||||
12345690185123247855434789043210113676212981012125
|
||||
04396783276030110982329872178901923494345891234596
|
||||
65287654896543225671012763561032876587436780989687
|
||||
70132108987652334430101654432945214306525891078765
|
||||
89945345456701498521012346547876305211014342569854
|
||||
67876276789876567677890107236521456523210213410743
|
||||
56940189678930438988743298101430567894765104323212
|
||||
45434328509821321089654340122334567765894101298701
|
||||
50125613410030012127763019831021998568903210345692
|
||||
23498701322147897898892123742340867478912653210789
|
||||
10567654213456786721089054654356789302801743105678
|
||||
01678123402110995437658766789210676211010892234109
|
||||
67569016567021874378941043212101245432346781103201
|
||||
58454323898134565632332456701234306011015490321232
|
||||
49323454234012906701454327890965412102367305410147
|
||||
31012365125643812898765410378876543233458216568758
|
||||
21009876034756763019034101269989100146569325679669
|
||||
21898745129829654323129654352123299656478012784578
|
||||
30743231065018760563238765543034788798329983693056
|
||||
45656189654323011056769894672145632347012674212147
|
||||
01218088745896522349850123283034701456981065100238
|
||||
14309893236787631438943210190129892123672578921109
|
||||
25456782101896540127654301012010181034543465433212
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
--- Day 11: Plutonian Pebbles ---
|
||||
|
||||
The ancient civilization on Pluto was known for its ability to manipulate spacetime, and while The Historians explore their infinite corridors, you've noticed a strange set of physics-defying stones.
|
||||
|
||||
At first glance, they seem like normal stones: they're arranged in a perfectly straight line, and each stone has a number engraved on it.
|
||||
|
||||
The strange part is that every time you blink, the stones change.
|
||||
|
||||
Sometimes, the number engraved on a stone changes. Other times, a stone might split in two, causing all the other stones to shift over a bit to make room in their perfectly straight line.
|
||||
|
||||
As you observe them for a while, you find that the stones have a consistent behavior. Every time you blink, the stones each simultaneously change according to the first applicable rule in this list:
|
||||
|
||||
If the stone is engraved with the number 0, it is replaced by a stone engraved with the number 1.
|
||||
If the stone is engraved with a number that has an even number of digits, it is replaced by two stones. The left half of the digits are engraved on the new left stone, and the right half of the digits are engraved on the new right stone. (The new numbers don't keep extra leading zeroes: 1000 would become stones 10 and 0.)
|
||||
If none of the other rules apply, the stone is replaced by a new stone; the old stone's number multiplied by 2024 is engraved on the new stone.
|
||||
|
||||
No matter how the stones change, their order is preserved, and they stay on their perfectly straight line.
|
||||
|
||||
How will the stones evolve if you keep blinking at them? You take a note of the number engraved on each stone in the line (your puzzle input).
|
||||
|
||||
If you have an arrangement of five stones engraved with the numbers 0 1 10 99 999 and you blink once, the stones transform as follows:
|
||||
|
||||
The first stone, 0, becomes a stone marked 1.
|
||||
The second stone, 1, is multiplied by 2024 to become 2024.
|
||||
The third stone, 10, is split into a stone marked 1 followed by a stone marked 0.
|
||||
The fourth stone, 99, is split into two stones marked 9.
|
||||
The fifth stone, 999, is replaced by a stone marked 2021976.
|
||||
|
||||
So, after blinking once, your five stones would become an arrangement of seven stones engraved with the numbers 1 2024 1 0 9 9 2021976.
|
||||
|
||||
Here is a longer example:
|
||||
|
||||
Initial arrangement:
|
||||
125 17
|
||||
|
||||
After 1 blink:
|
||||
253000 1 7
|
||||
|
||||
After 2 blinks:
|
||||
253 0 2024 14168
|
||||
|
||||
After 3 blinks:
|
||||
512072 1 20 24 28676032
|
||||
|
||||
After 4 blinks:
|
||||
512 72 2024 2 0 2 4 2867 6032
|
||||
|
||||
After 5 blinks:
|
||||
1036288 7 2 20 24 4048 1 4048 8096 28 67 60 32
|
||||
|
||||
After 6 blinks:
|
||||
2097446912 14168 4048 2 0 2 4 40 48 2024 40 48 80 96 2 8 6 7 6 0 3 2
|
||||
|
||||
In this example, after blinking six times, you would have 22 stones. After blinking 25 times, you would have 55312 stones!
|
||||
|
||||
Consider the arrangement of stones in front of you. How many stones will you have after blinking 25 times?
|
||||
|
||||
Your puzzle answer was 224529.
|
||||
--- Part Two ---
|
||||
|
||||
The Historians sure are taking a long time. To be fair, the infinite corridors are very large.
|
||||
|
||||
How many stones would you have after blinking a total of 75 times?
|
||||
|
||||
Your puzzle answer was 266820198587914.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
from copy import deepcopy
|
||||
import numpy as np
|
||||
|
||||
def memo(f):
|
||||
memo = {}
|
||||
|
||||
def f2(x,y):
|
||||
if (x,y) not in memo: memo[(x,y)] = f(x,y)
|
||||
return memo[(x,y)]
|
||||
return f2
|
||||
|
||||
|
||||
@memo
|
||||
def blink(stone, i):
|
||||
if i == 0: return 1
|
||||
else: i -= 1
|
||||
if stone == 0: return blink(1,i)
|
||||
elif len(str(stone)) % 2 == 0:
|
||||
ds = int(len(str(int(stone)))/2)
|
||||
return(blink(int(str(int(stone))[:ds]),i) + blink(int(str(int(stone))[ds:]),i))
|
||||
else: return blink(stone*2024, i)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
stones = [int(n) for n in open(sys.argv[1]).read().strip('\n').split(' ')]
|
||||
|
||||
res1, res2 = 0, 0
|
||||
for s in stones:
|
||||
res1 += blink(s, 25)
|
||||
res2 += blink(s, 75)
|
||||
|
||||
# challenge 1
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
0 1 10 99 999
|
||||
@@ -0,0 +1 @@
|
||||
125 17
|
||||
@@ -0,0 +1 @@
|
||||
1117 0 8 21078 2389032 142881 93 385
|
||||
@@ -0,0 +1,148 @@
|
||||
--- Day 12: Garden Groups ---
|
||||
|
||||
Why not search for the Chief Historian near the gardener and his massive farm? There's plenty of food, so The Historians grab something to eat while they search.
|
||||
|
||||
You're about to settle near a complex arrangement of garden plots when some Elves ask if you can lend a hand. They'd like to set up fences around each region of garden plots, but they can't figure out how much fence they need to order or how much it will cost. They hand you a map (your puzzle input) of the garden plots.
|
||||
|
||||
Each garden plot grows only a single type of plant and is indicated by a single letter on your map. When multiple garden plots are growing the same type of plant and are touching (horizontally or vertically), they form a region. For example:
|
||||
|
||||
AAAA
|
||||
BBCD
|
||||
BBCC
|
||||
EEEC
|
||||
|
||||
This 4x4 arrangement includes garden plots growing five different types of plants (labeled A, B, C, D, and E), each grouped into their own region.
|
||||
|
||||
In order to accurately calculate the cost of the fence around a single region, you need to know that region's area and perimeter.
|
||||
|
||||
The area of a region is simply the number of garden plots the region contains. The above map's type A, B, and C plants are each in a region of area 4. The type E plants are in a region of area 3; the type D plants are in a region of area 1.
|
||||
|
||||
Each garden plot is a square and so has four sides. The perimeter of a region is the number of sides of garden plots in the region that do not touch another garden plot in the same region. The type A and C plants are each in a region with perimeter 10. The type B and E plants are each in a region with perimeter 8. The lone D plot forms its own region with perimeter 4.
|
||||
|
||||
Visually indicating the sides of plots in each region that contribute to the perimeter using - and |, the above map's regions' perimeters are measured as follows:
|
||||
|
||||
+-+-+-+-+
|
||||
|A A A A|
|
||||
+-+-+-+-+ +-+
|
||||
|D|
|
||||
+-+-+ +-+ +-+
|
||||
|B B| |C|
|
||||
+ + + +-+
|
||||
|B B| |C C|
|
||||
+-+-+ +-+ +
|
||||
|C|
|
||||
+-+-+-+ +-+
|
||||
|E E E|
|
||||
+-+-+-+
|
||||
|
||||
Plants of the same type can appear in multiple separate regions, and regions can even appear within other regions. For example:
|
||||
|
||||
OOOOO
|
||||
OXOXO
|
||||
OOOOO
|
||||
OXOXO
|
||||
OOOOO
|
||||
|
||||
The above map contains five regions, one containing all of the O garden plots, and the other four each containing a single X plot.
|
||||
|
||||
The four X regions each have area 1 and perimeter 4. The region containing 21 type O plants is more complicated; in addition to its outer edge contributing a perimeter of 20, its boundary with each X region contributes an additional 4 to its perimeter, for a total perimeter of 36.
|
||||
|
||||
Due to "modern" business practices, the price of fence required for a region is found by multiplying that region's area by its perimeter. The total price of fencing all regions on a map is found by adding together the price of fence for every region on the map.
|
||||
|
||||
In the first example, region A has price 4 * 10 = 40, region B has price 4 * 8 = 32, region C has price 4 * 10 = 40, region D has price 1 * 4 = 4, and region E has price 3 * 8 = 24. So, the total price for the first example is 140.
|
||||
|
||||
In the second example, the region with all of the O plants has price 21 * 36 = 756, and each of the four smaller X regions has price 1 * 4 = 4, for a total price of 772 (756 + 4 + 4 + 4 + 4).
|
||||
|
||||
Here's a larger example:
|
||||
|
||||
RRRRIICCFF
|
||||
RRRRIICCCF
|
||||
VVRRRCCFFF
|
||||
VVRCCCJFFF
|
||||
VVVVCJJCFE
|
||||
VVIVCCJJEE
|
||||
VVIIICJJEE
|
||||
MIIIIIJJEE
|
||||
MIIISIJEEE
|
||||
MMMISSJEEE
|
||||
|
||||
It contains:
|
||||
|
||||
A region of R plants with price 12 * 18 = 216.
|
||||
A region of I plants with price 4 * 8 = 32.
|
||||
A region of C plants with price 14 * 28 = 392.
|
||||
A region of F plants with price 10 * 18 = 180.
|
||||
A region of V plants with price 13 * 20 = 260.
|
||||
A region of J plants with price 11 * 20 = 220.
|
||||
A region of C plants with price 1 * 4 = 4.
|
||||
A region of E plants with price 13 * 18 = 234.
|
||||
A region of I plants with price 14 * 22 = 308.
|
||||
A region of M plants with price 5 * 12 = 60.
|
||||
A region of S plants with price 3 * 8 = 24.
|
||||
|
||||
So, it has a total price of 1930.
|
||||
|
||||
What is the total price of fencing all regions on your map?
|
||||
|
||||
Your puzzle answer was 1415378.
|
||||
--- Part Two ---
|
||||
|
||||
Fortunately, the Elves are trying to order so much fence that they qualify for a bulk discount!
|
||||
|
||||
Under the bulk discount, instead of using the perimeter to calculate the price, you need to use the number of sides each region has. Each straight section of fence counts as a side, regardless of how long it is.
|
||||
|
||||
Consider this example again:
|
||||
|
||||
AAAA
|
||||
BBCD
|
||||
BBCC
|
||||
EEEC
|
||||
|
||||
The region containing type A plants has 4 sides, as does each of the regions containing plants of type B, D, and E. However, the more complex region containing the plants of type C has 8 sides!
|
||||
|
||||
Using the new method of calculating the per-region price by multiplying the region's area by its number of sides, regions A through E have prices 16, 16, 32, 4, and 12, respectively, for a total price of 80.
|
||||
|
||||
The second example above (full of type X and O plants) would have a total price of 436.
|
||||
|
||||
Here's a map that includes an E-shaped region full of type E plants:
|
||||
|
||||
EEEEE
|
||||
EXXXX
|
||||
EEEEE
|
||||
EXXXX
|
||||
EEEEE
|
||||
|
||||
The E-shaped region has an area of 17 and 12 sides for a price of 204. Including the two regions full of type X plants, this map has a total price of 236.
|
||||
|
||||
This map has a total price of 368:
|
||||
|
||||
AAAAAA
|
||||
AAABBA
|
||||
AAABBA
|
||||
ABBAAA
|
||||
ABBAAA
|
||||
AAAAAA
|
||||
|
||||
It includes two regions full of type B plants (each with 4 sides) and a single region full of type A plants (with 4 sides on the outside and 8 more sides on the inside, a total of 12 sides). Be especially careful when counting the fence around regions like the one full of type A plants; in particular, each section of fence has an in-side and an out-side, so the fence does not connect across the middle of the region (where the two B regions touch diagonally). (The Elves would have used the Möbius Fencing Company instead, but their contract terms were too one-sided.)
|
||||
|
||||
The larger example from before now has the following updated prices:
|
||||
|
||||
A region of R plants with price 12 * 10 = 120.
|
||||
A region of I plants with price 4 * 4 = 16.
|
||||
A region of C plants with price 14 * 22 = 308.
|
||||
A region of F plants with price 10 * 12 = 120.
|
||||
A region of V plants with price 13 * 10 = 130.
|
||||
A region of J plants with price 11 * 12 = 132.
|
||||
A region of C plants with price 1 * 4 = 4.
|
||||
A region of E plants with price 13 * 8 = 104.
|
||||
A region of I plants with price 14 * 16 = 224.
|
||||
A region of M plants with price 5 * 6 = 30.
|
||||
A region of S plants with price 3 * 6 = 18.
|
||||
|
||||
Adding these together produces its new total price of 1206.
|
||||
|
||||
What is the new total price of fencing all regions on your map?
|
||||
|
||||
Your puzzle answer was 862714.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+120
@@ -0,0 +1,120 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
def adjacent(x,y,pos):
|
||||
dirs = [(0,1), (1,0), (0,-1), (-1,0)]
|
||||
for p in pos:
|
||||
for d in dirs:
|
||||
if p[0] == d[0] + x and p[1] == d[1] + y:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def join(rs):
|
||||
if len(rs) == 1: return rs
|
||||
removable = []
|
||||
for i in range(len(rs)):
|
||||
if i in removable:
|
||||
continue
|
||||
r1 = rs[i]
|
||||
for j, r2 in enumerate(rs[i+1:]):
|
||||
if j+i+1 in removable: continue
|
||||
for r in r1:
|
||||
if adjacent(*r,r2):
|
||||
r1 += r2
|
||||
r2 = []
|
||||
removable.append(i+1+j)
|
||||
break
|
||||
for i in sorted(removable, reverse=True):
|
||||
rs.remove(rs[i])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
plots = [list(line.strip('\n')) for line in open(sys.argv[1])]
|
||||
|
||||
def fence(p):
|
||||
x,y = p
|
||||
dirs = [(0,1), (1,0), (0,-1), (-1,0)]
|
||||
fences = 0
|
||||
for d in dirs:
|
||||
nx = d[0] + x
|
||||
ny = d[1] + y
|
||||
if 0 <= nx < len(plots[0]) and 0 <= ny < len(plots):
|
||||
if plots[y][x] != plots[ny][nx]: fences += 1
|
||||
else: fences += 1
|
||||
return fences
|
||||
|
||||
def disc_fence(region):
|
||||
fences = 0
|
||||
horizontal = {}
|
||||
vertical = {}
|
||||
for (x,y) in region:
|
||||
v = [(1,0), (-1,0)]
|
||||
h = [(0,1), (0,-1)]
|
||||
for d in v:
|
||||
nx = d[0] + x
|
||||
if 0 <= nx < len(plots[0]):
|
||||
if plots[y][x] != plots[y][nx]:
|
||||
if (x, nx) in vertical: vertical[(x,nx)].append(y)
|
||||
else: vertical[(x, nx)] = [y]
|
||||
else:
|
||||
if (x, nx) in vertical: vertical[(x,nx)].append(y)
|
||||
else: vertical[(x, nx)] = [y]
|
||||
|
||||
for d in h:
|
||||
ny = d[1] + y
|
||||
if 0 <= ny < len(plots):
|
||||
if plots[y][x] != plots[ny][x]:
|
||||
if (y,ny) in horizontal: horizontal[(y, ny)].append(x)
|
||||
else: horizontal[(y, ny)] = [x]
|
||||
else:
|
||||
if (y,ny) in horizontal: horizontal[(y, ny)].append(x)
|
||||
else: horizontal[(y, ny)] = [x]
|
||||
|
||||
for ys in vertical.values():
|
||||
prev = -2
|
||||
for y in sorted(ys):
|
||||
if y - prev > 1: fences += 1
|
||||
prev = y
|
||||
for xs in horizontal.values():
|
||||
prev = -2
|
||||
for x in sorted(xs):
|
||||
if x - prev > 1: fences += 1
|
||||
prev = x
|
||||
return fences
|
||||
|
||||
|
||||
# 'A': [[(x,y), (x,y),..],...]
|
||||
regions = {}
|
||||
for y, pls in enumerate(plots):
|
||||
for x, p in enumerate(pls):
|
||||
if p not in regions:
|
||||
regions[p] = [[]]
|
||||
regions[p][0].append((x,y))
|
||||
else:
|
||||
t = False
|
||||
for l in regions[p]:
|
||||
if adjacent(x,y,l):
|
||||
l.append((x,y))
|
||||
t = True
|
||||
break
|
||||
if not t: regions[p].append([(x,y)])
|
||||
|
||||
res1, res2 = 0, 0
|
||||
|
||||
for p, rs in regions.items():
|
||||
join(rs)
|
||||
join(rs)
|
||||
for r in rs:
|
||||
res1 += sum(map(fence,r)) * len(r)
|
||||
res2 += disc_fence(r) * len(r)
|
||||
|
||||
# challenge 1
|
||||
# 1400060 is too low! -> double join.. not very nice xD
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
RRRRIICCFF
|
||||
RRRRIICCCF
|
||||
VVRRRCCFFF
|
||||
VVRCCCJFFF
|
||||
VVVVCJJCFE
|
||||
VVIVCCJJEE
|
||||
VVIIICJJEE
|
||||
MIIIIIJJEE
|
||||
MIIISIJEEE
|
||||
MMMISSJEEE
|
||||
@@ -0,0 +1,4 @@
|
||||
AAAA
|
||||
BBCD
|
||||
BBCC
|
||||
EEEC
|
||||
@@ -0,0 +1,5 @@
|
||||
OOOOO
|
||||
OXOXO
|
||||
OOOOO
|
||||
OXOXO
|
||||
OOOOO
|
||||
@@ -0,0 +1,5 @@
|
||||
EEEEE
|
||||
EXXXX
|
||||
EEEEE
|
||||
EXXXX
|
||||
EEEEE
|
||||
@@ -0,0 +1,140 @@
|
||||
IIIIIIIXXXXXXXXXXXXXCCCCCCCCCCCCCCCCCCXXXXXXXQQYYYYYYYYYFFFFFFFFFFFSSSSSUUUO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TTTTTTTTTTQQQQFQQQQQQQQDZZZZZZMZMMMMMMSSSSSSSXXXXXBBBBBBBLEEEEEEEEEEE
|
||||
MYYYYYYYYYYYAAAAAAAAAAAAAAAAVVVVVVVVVVVVCCCCCCCCCCCCCCDDDDDDEEEEEESSCCCSTTTTTTTTTQQQQFFQQQQQQQZZZZZZZZZZMMMMMMMYSSSSXXXXXXGBBBBEEEEEEEEEEEEE
|
||||
MYYYYYYYYYYMMAAAAAAAAAAAAAAAVVVVVVVVVVVCCCCCCCCCCCCCDDDDDDEEEEEEEESSSSSTTTTTTTTTTTFFFFFQQQQQQQZZZZZZZZZMMMMMMMWSSWWXXXXXXXGGMBBEEEEEEEEEEEEE
|
||||
MYYYYYYYYMMMMMAAAAAAAAAAAAAAVVVVVVVVVVCCCCCCCCCCCCCCCDDDDDEEEEEEEESSSSSTTTTTTTTTTFFFFFFFFQQQQQQQZZZZZZJMMMMMMMWSSWXXXXXXXXGMMMMEUEEEEEEEEEEE
|
||||
MYYYYYYMMMMMMMAAAAAAAAAUAAVVVVVVVVVVVVCCCCCCCCCCCCCCDDDDDDDEEEEEEEESRSEEETTTTYTFFFFFFFFFFQQQQQQQZZZZZZJMMMMMWWWWWWWXXGXGGGGGMMMEEEEEEEEEEEEE
|
||||
YYYXXYYMMMMMMMAAAAAAAAAAAIVVVVVVVVVVVVVCCCCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEETTTTYTFFFFFFFFFFQQQZZZZZZZZZJJJMMMMMMWWWWWXGGGGGGGMMMMEEEEEEEEEEEEE
|
||||
@@ -0,0 +1,80 @@
|
||||
--- Day 13: Claw Contraption ---
|
||||
|
||||
Next up: the lobby of a resort on a tropical island. The Historians take a moment to admire the hexagonal floor tiles before spreading out.
|
||||
|
||||
Fortunately, it looks like the resort has a new arcade! Maybe you can win some prizes from the claw machines?
|
||||
|
||||
The claw machines here are a little unusual. Instead of a joystick or directional buttons to control the claw, these machines have two buttons labeled A and B. Worse, you can't just put in a token and play; it costs 3 tokens to push the A button and 1 token to push the B button.
|
||||
|
||||
With a little experimentation, you figure out that each machine's buttons are configured to move the claw a specific amount to the right (along the X axis) and a specific amount forward (along the Y axis) each time that button is pressed.
|
||||
|
||||
Each machine contains one prize; to win the prize, the claw must be positioned exactly above the prize on both the X and Y axes.
|
||||
|
||||
You wonder: what is the smallest number of tokens you would have to spend to win as many prizes as possible? You assemble a list of every machine's button behavior and prize location (your puzzle input). For example:
|
||||
|
||||
Button A: X+94, Y+34
|
||||
Button B: X+22, Y+67
|
||||
Prize: X=8400, Y=5400
|
||||
|
||||
Button A: X+26, Y+66
|
||||
Button B: X+67, Y+21
|
||||
Prize: X=12748, Y=12176
|
||||
|
||||
Button A: X+17, Y+86
|
||||
Button B: X+84, Y+37
|
||||
Prize: X=7870, Y=6450
|
||||
|
||||
Button A: X+69, Y+23
|
||||
Button B: X+27, Y+71
|
||||
Prize: X=18641, Y=10279
|
||||
|
||||
This list describes the button configuration and prize location of four different claw machines.
|
||||
|
||||
For now, consider just the first claw machine in the list:
|
||||
|
||||
Pushing the machine's A button would move the claw 94 units along the X axis and 34 units along the Y axis.
|
||||
Pushing the B button would move the claw 22 units along the X axis and 67 units along the Y axis.
|
||||
The prize is located at X=8400, Y=5400; this means that from the claw's initial position, it would need to move exactly 8400 units along the X axis and exactly 5400 units along the Y axis to be perfectly aligned with the prize in this machine.
|
||||
|
||||
The cheapest way to win the prize is by pushing the A button 80 times and the B button 40 times. This would line up the claw along the X axis (because 80*94 + 40*22 = 8400) and along the Y axis (because 80*34 + 40*67 = 5400). Doing this would cost 80*3 tokens for the A presses and 40*1 for the B presses, a total of 280 tokens.
|
||||
|
||||
For the second and fourth claw machines, there is no combination of A and B presses that will ever win a prize.
|
||||
|
||||
For the third claw machine, the cheapest way to win the prize is by pushing the A button 38 times and the B button 86 times. Doing this would cost a total of 200 tokens.
|
||||
|
||||
So, the most prizes you could possibly win is two; the minimum tokens you would have to spend to win all (two) prizes is 480.
|
||||
|
||||
You estimate that each button would need to be pressed no more than 100 times to win a prize. How else would someone be expected to play?
|
||||
|
||||
Figure out how to win as many prizes as possible. What is the fewest tokens you would have to spend to win all possible prizes?
|
||||
|
||||
Your puzzle answer was 37128.
|
||||
--- Part Two ---
|
||||
|
||||
As you go to win the first prize, you discover that the claw is nowhere near where you expected it would be. Due to a unit conversion error in your measurements, the position of every prize is actually 10000000000000 higher on both the X and Y axis!
|
||||
|
||||
Add 10000000000000 to the X and Y position of every prize. After making this change, the example above would now look like this:
|
||||
|
||||
Button A: X+94, Y+34
|
||||
Button B: X+22, Y+67
|
||||
Prize: X=10000000008400, Y=10000000005400
|
||||
|
||||
Button A: X+26, Y+66
|
||||
Button B: X+67, Y+21
|
||||
Prize: X=10000000012748, Y=10000000012176
|
||||
|
||||
Button A: X+17, Y+86
|
||||
Button B: X+84, Y+37
|
||||
Prize: X=10000000007870, Y=10000000006450
|
||||
|
||||
Button A: X+69, Y+23
|
||||
Button B: X+27, Y+71
|
||||
Prize: X=10000000018641, Y=10000000010279
|
||||
|
||||
Now, it is only possible to win a prize on the second and fourth claw machines. Unfortunately, it will take many more than 100 presses to do so.
|
||||
|
||||
Using the corrected prize coordinates, figure out how to win as many prizes as possible. What is the fewest tokens you would have to spend to win all possible prizes?
|
||||
|
||||
Your puzzle answer was 74914228471331.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys, re
|
||||
from sympy import solve
|
||||
from sympy.abc import x, y
|
||||
|
||||
|
||||
def prizes(a, b, prize):
|
||||
sols = solve([a[0] * x + b[0] * y - prize[0], a[1] * x + b[1] * y - prize[1]], x, y, dict=True)
|
||||
if len(sols) > 1: print('help!', sols)
|
||||
if int(sols[0][x]) != sols[0][x] or int(sols[0][y]) != sols[0][y]: return 0
|
||||
else: return 3*sols[0][x]+sols[0][y]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
cms = open(sys.argv[1]).read().split('\n\n')
|
||||
res1, res2 = 0, 0
|
||||
for cm in cms:
|
||||
g = re.search(r'Button A: X\+(?P<xa>\d+), Y\+(?P<ya>\d+)\nButton B: X\+(?P<xb>\d+), Y\+(?P<yb>\d+)\nPrize: X=(?P<px>\d+), Y=(?P<py>\d+)', cm)
|
||||
button_a = (int(g['xa']), int(g['ya']))
|
||||
button_b = (int(g['xb']), int(g['yb']))
|
||||
prize = (int(g['px']), int(g['py']))
|
||||
res1 += prizes(button_a, button_b, prize)
|
||||
prize = (prize[0]+10000000000000, prize[1]+10000000000000)
|
||||
res2 += prizes(button_a, button_b, prize)
|
||||
|
||||
# challenge 1
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
Button A: X+94, Y+34
|
||||
Button B: X+22, Y+67
|
||||
Prize: X=8400, Y=5400
|
||||
|
||||
Button A: X+26, Y+66
|
||||
Button B: X+67, Y+21
|
||||
Prize: X=12748, Y=12176
|
||||
|
||||
Button A: X+17, Y+86
|
||||
Button B: X+84, Y+37
|
||||
Prize: X=7870, Y=6450
|
||||
|
||||
Button A: X+69, Y+23
|
||||
Button B: X+27, Y+71
|
||||
Prize: X=18641, Y=10279
|
||||
+1279
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,131 @@
|
||||
--- Day 14: Restroom Redoubt ---
|
||||
|
||||
One of The Historians needs to use the bathroom; fortunately, you know there's a bathroom near an unvisited location on their list, and so you're all quickly teleported directly to the lobby of Easter Bunny Headquarters.
|
||||
|
||||
Unfortunately, EBHQ seems to have "improved" bathroom security again after your last visit. The area outside the bathroom is swarming with robots!
|
||||
|
||||
To get The Historian safely to the bathroom, you'll need a way to predict where the robots will be in the future. Fortunately, they all seem to be moving on the tile floor in predictable straight lines.
|
||||
|
||||
You make a list (your puzzle input) of all of the robots' current positions (p) and velocities (v), one robot per line. For example:
|
||||
|
||||
p=0,4 v=3,-3
|
||||
p=6,3 v=-1,-3
|
||||
p=10,3 v=-1,2
|
||||
p=2,0 v=2,-1
|
||||
p=0,0 v=1,3
|
||||
p=3,0 v=-2,-2
|
||||
p=7,6 v=-1,-3
|
||||
p=3,0 v=-1,-2
|
||||
p=9,3 v=2,3
|
||||
p=7,3 v=-1,2
|
||||
p=2,4 v=2,-3
|
||||
p=9,5 v=-3,-3
|
||||
|
||||
Each robot's position is given as p=x,y where x represents the number of tiles the robot is from the left wall and y represents the number of tiles from the top wall (when viewed from above). So, a position of p=0,0 means the robot is all the way in the top-left corner.
|
||||
|
||||
Each robot's velocity is given as v=x,y where x and y are given in tiles per second. Positive x means the robot is moving to the right, and positive y means the robot is moving down. So, a velocity of v=1,-2 means that each second, the robot moves 1 tile to the right and 2 tiles up.
|
||||
|
||||
The robots outside the actual bathroom are in a space which is 101 tiles wide and 103 tiles tall (when viewed from above). However, in this example, the robots are in a space which is only 11 tiles wide and 7 tiles tall.
|
||||
|
||||
The robots are good at navigating over/under each other (due to a combination of springs, extendable legs, and quadcopters), so they can share the same tile and don't interact with each other. Visually, the number of robots on each tile in this example looks like this:
|
||||
|
||||
1.12.......
|
||||
...........
|
||||
...........
|
||||
......11.11
|
||||
1.1........
|
||||
.........1.
|
||||
.......1...
|
||||
|
||||
These robots have a unique feature for maximum bathroom security: they can teleport. When a robot would run into an edge of the space they're in, they instead teleport to the other side, effectively wrapping around the edges. Here is what robot p=2,4 v=2,-3 does for the first few seconds:
|
||||
|
||||
Initial state:
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
..1........
|
||||
...........
|
||||
...........
|
||||
|
||||
After 1 second:
|
||||
...........
|
||||
....1......
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
|
||||
After 2 seconds:
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
......1....
|
||||
...........
|
||||
|
||||
After 3 seconds:
|
||||
...........
|
||||
...........
|
||||
........1..
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
|
||||
After 4 seconds:
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
..........1
|
||||
|
||||
After 5 seconds:
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
.1.........
|
||||
...........
|
||||
...........
|
||||
...........
|
||||
|
||||
The Historian can't wait much longer, so you don't have to simulate the robots for very long. Where will the robots be after 100 seconds?
|
||||
|
||||
In the above example, the number of robots on each tile after 100 seconds has elapsed looks like this:
|
||||
|
||||
......2..1.
|
||||
...........
|
||||
1..........
|
||||
.11........
|
||||
.....1.....
|
||||
...12......
|
||||
.1....1....
|
||||
|
||||
To determine the safest area, count the number of robots in each quadrant after 100 seconds. Robots that are exactly in the middle (horizontally or vertically) don't count as being in any quadrant, so the only relevant robots are:
|
||||
|
||||
..... 2..1.
|
||||
..... .....
|
||||
1.... .....
|
||||
|
||||
..... .....
|
||||
...12 .....
|
||||
.1... 1....
|
||||
|
||||
In this example, the quadrants contain 1, 3, 4, and 1 robot. Multiplying these together gives a total safety factor of 12.
|
||||
|
||||
Predict the motion of the robots in your list within a space which is 101 tiles wide and 103 tiles tall. What will the safety factor be after exactly 100 seconds have elapsed?
|
||||
|
||||
Your puzzle answer was 209409792.
|
||||
--- Part Two ---
|
||||
|
||||
During the bathroom break, someone notices that these robots seem awfully similar to ones built and used at the North Pole. If they're the same type of robots, they should have a hard-coded Easter egg: very rarely, most of the robots should arrange themselves into a picture of a Christmas tree.
|
||||
|
||||
What is the fewest number of seconds that must elapse for the robots to display the Easter egg?
|
||||
|
||||
Your puzzle answer was 8006.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys, re
|
||||
|
||||
|
||||
def show(mp):
|
||||
for line in mp:
|
||||
print(''.join(line))
|
||||
|
||||
|
||||
def easter_egg(robots, w, h):
|
||||
for steps in range(7000, 10000):
|
||||
print('Steps: ', steps)
|
||||
m = [['.'] * w for _ in range(h)]
|
||||
for r in robots:
|
||||
px, py, vx, vy = map(int, r)
|
||||
nx = (px + steps*vx)%w
|
||||
ny = (py + steps*vy)%h
|
||||
m[ny][nx] = 'X'
|
||||
show(m)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
robot = re.compile(r'p=(?P<px>-?\d+),(?P<py>-?\d+) v=(?P<vx>-?\d+),(?P<vy>-?\d+)')
|
||||
robots = [robot.search(line.strip('\n')).groups() for line in open(sys.argv[1])]
|
||||
|
||||
# space: 11 x 7 for example and 101 x 103 for real input
|
||||
w, h = 101, 103
|
||||
steps = 100
|
||||
q1, q2, q3, q4 = 0,0,0,0
|
||||
for r in robots:
|
||||
px, py, vx, vy = map(int,r)
|
||||
nx = (px + 100*vx)%w
|
||||
ny = (py+100*vy)%h
|
||||
if nx in range(0, w//2):
|
||||
if ny in range(0,h//2): q1 += 1
|
||||
if ny in range(h//2+1,h): q2 += 1
|
||||
if nx in range(w//2+1,w):
|
||||
if ny in range(0,h//2): q3 += 1
|
||||
if ny in range(h//2+1,h): q4 += 1
|
||||
|
||||
# challenge 1
|
||||
res1 = q1 * q2 * q3 * q4
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
easter_egg( robots, w, h)
|
||||
res2 = "8006" # empirical solution
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
p=0,4 v=3,-3
|
||||
p=6,3 v=-1,-3
|
||||
p=10,3 v=-1,2
|
||||
p=2,0 v=2,-1
|
||||
p=0,0 v=1,3
|
||||
p=3,0 v=-2,-2
|
||||
p=7,6 v=-1,-3
|
||||
p=3,0 v=-1,-2
|
||||
p=9,3 v=2,3
|
||||
p=7,3 v=-1,2
|
||||
p=2,4 v=2,-3
|
||||
p=9,5 v=-3,-3
|
||||
@@ -0,0 +1,500 @@
|
||||
p=24,25 v=-48,-26
|
||||
p=7,8 v=-96,-2
|
||||
p=7,80 v=-66,22
|
||||
p=5,18 v=25,-98
|
||||
p=45,67 v=26,90
|
||||
p=54,71 v=3,67
|
||||
p=62,66 v=-5,81
|
||||
p=5,82 v=-7,-45
|
||||
p=66,89 v=93,-43
|
||||
p=70,51 v=33,-7
|
||||
p=75,59 v=-20,-77
|
||||
p=66,40 v=93,55
|
||||
p=32,79 v=79,45
|
||||
p=99,13 v=-18,50
|
||||
p=13,68 v=-43,-53
|
||||
p=84,85 v=-69,-65
|
||||
p=37,84 v=11,-57
|
||||
p=28,10 v=19,-93
|
||||
p=78,82 v=-56,36
|
||||
p=20,69 v=-3,-62
|
||||
p=39,78 v=27,-1
|
||||
p=51,87 v=-32,-17
|
||||
p=90,26 v=20,66
|
||||
p=35,89 v=-11,20
|
||||
p=71,2 v=-80,92
|
||||
p=41,40 v=-64,-30
|
||||
p=38,8 v=-71,54
|
||||
p=72,58 v=36,-80
|
||||
p=62,97 v=52,83
|
||||
p=96,74 v=90,-23
|
||||
p=76,75 v=-43,-9
|
||||
p=35,95 v=74,13
|
||||
p=90,17 v=99,6
|
||||
p=61,26 v=17,81
|
||||
p=43,71 v=-43,-51
|
||||
p=6,18 v=-62,-9
|
||||
p=37,62 v=-23,-11
|
||||
p=60,97 v=36,-64
|
||||
p=54,63 v=-23,-95
|
||||
p=76,85 v=24,-4
|
||||
p=38,54 v=-38,-95
|
||||
p=48,18 v=52,-49
|
||||
p=45,36 v=-75,-4
|
||||
p=31,87 v=64,50
|
||||
p=4,87 v=68,9
|
||||
p=25,40 v=99,53
|
||||
p=74,18 v=-73,-71
|
||||
p=5,22 v=76,65
|
||||
p=66,12 v=96,-64
|
||||
p=20,71 v=68,-3
|
||||
p=3,20 v=4,-77
|
||||
p=27,43 v=49,55
|
||||
p=25,70 v=-52,-84
|
||||
p=90,64 v=39,52
|
||||
p=32,69 v=82,88
|
||||
p=2,97 v=-78,76
|
||||
p=56,6 v=-71,-27
|
||||
p=91,31 v=84,-41
|
||||
p=25,12 v=-91,-51
|
||||
p=7,43 v=-11,59
|
||||
p=3,55 v=-6,-44
|
||||
p=83,102 v=9,-76
|
||||
p=54,40 v=-94,5
|
||||
p=3,77 v=80,45
|
||||
p=32,6 v=3,-35
|
||||
p=14,34 v=-74,-41
|
||||
p=16,30 v=-21,-86
|
||||
p=34,71 v=-75,-62
|
||||
p=79,11 v=67,-10
|
||||
p=80,11 v=61,9
|
||||
p=14,84 v=-59,-83
|
||||
p=73,66 v=-56,3
|
||||
p=26,61 v=41,-70
|
||||
p=45,35 v=-97,40
|
||||
p=84,39 v=-99,55
|
||||
p=95,50 v=-66,-56
|
||||
p=17,35 v=-33,-74
|
||||
p=33,51 v=4,-22
|
||||
p=6,77 v=-49,-45
|
||||
p=9,61 v=28,85
|
||||
p=14,91 v=-70,-12
|
||||
p=88,73 v=49,-14
|
||||
p=73,39 v=-16,73
|
||||
p=68,83 v=25,60
|
||||
p=3,31 v=83,62
|
||||
p=31,102 v=30,-49
|
||||
p=29,29 v=45,-23
|
||||
p=47,37 v=97,26
|
||||
p=35,46 v=87,39
|
||||
p=13,36 v=-74,-37
|
||||
p=81,33 v=81,-17
|
||||
p=6,20 v=-14,43
|
||||
p=94,41 v=89,-72
|
||||
p=55,44 v=-91,95
|
||||
p=92,87 v=-17,64
|
||||
p=54,79 v=-57,-58
|
||||
p=53,49 v=-19,-84
|
||||
p=25,21 v=56,-82
|
||||
p=82,53 v=51,-85
|
||||
p=75,27 v=69,-4
|
||||
p=21,87 v=61,-6
|
||||
p=6,63 v=-74,-77
|
||||
p=20,4 v=89,-33
|
||||
p=21,25 v=-78,62
|
||||
p=24,0 v=-74,43
|
||||
p=34,86 v=-43,74
|
||||
p=72,83 v=-35,85
|
||||
p=47,17 v=41,87
|
||||
p=3,73 v=-77,-36
|
||||
p=98,96 v=-73,75
|
||||
p=66,93 v=-26,20
|
||||
p=48,79 v=56,-69
|
||||
p=91,89 v=-47,9
|
||||
p=49,11 v=96,-47
|
||||
p=33,4 v=-86,-16
|
||||
p=76,45 v=-46,3
|
||||
p=12,28 v=-40,36
|
||||
p=64,99 v=-79,-83
|
||||
p=19,83 v=-10,-3
|
||||
p=87,57 v=84,-33
|
||||
p=47,69 v=-64,-58
|
||||
p=56,9 v=33,-60
|
||||
p=98,94 v=-14,-25
|
||||
p=60,59 v=-1,-41
|
||||
p=18,91 v=-93,-85
|
||||
p=24,21 v=98,-85
|
||||
p=51,83 v=-23,45
|
||||
p=12,41 v=-41,-34
|
||||
p=8,86 v=-55,-50
|
||||
p=23,48 v=-11,73
|
||||
p=46,24 v=-4,-75
|
||||
p=12,82 v=-6,-47
|
||||
p=78,37 v=-16,-55
|
||||
p=13,59 v=68,-66
|
||||
p=63,100 v=44,83
|
||||
p=99,66 v=31,-65
|
||||
p=21,97 v=17,-7
|
||||
p=1,101 v=91,-90
|
||||
p=16,74 v=90,8
|
||||
p=15,102 v=98,-9
|
||||
p=31,34 v=12,91
|
||||
p=49,65 v=-8,96
|
||||
p=48,62 v=-41,-58
|
||||
p=57,13 v=-72,61
|
||||
p=82,30 v=-69,47
|
||||
p=31,21 v=41,-44
|
||||
p=25,93 v=-30,-69
|
||||
p=33,45 v=4,-96
|
||||
p=57,15 v=59,10
|
||||
p=6,74 v=61,-43
|
||||
p=9,43 v=-64,51
|
||||
p=69,67 v=10,-51
|
||||
p=44,93 v=60,93
|
||||
p=39,77 v=94,-39
|
||||
p=38,86 v=86,12
|
||||
p=43,98 v=26,75
|
||||
p=64,49 v=-87,-84
|
||||
p=13,64 v=42,30
|
||||
p=69,91 v=-39,-91
|
||||
p=83,100 v=-12,61
|
||||
p=28,66 v=-62,-27
|
||||
p=15,90 v=-3,-46
|
||||
p=0,42 v=27,18
|
||||
p=56,99 v=-24,-67
|
||||
p=70,68 v=-61,74
|
||||
p=7,8 v=-70,35
|
||||
p=5,100 v=16,-13
|
||||
p=83,49 v=-22,73
|
||||
p=63,18 v=64,-56
|
||||
p=78,84 v=28,-57
|
||||
p=89,39 v=36,26
|
||||
p=72,31 v=-80,51
|
||||
p=72,88 v=8,70
|
||||
p=29,8 v=34,65
|
||||
p=36,11 v=-86,39
|
||||
p=16,27 v=12,-52
|
||||
p=63,63 v=59,63
|
||||
p=1,4 v=-21,-79
|
||||
p=95,86 v=-81,-79
|
||||
p=30,27 v=90,21
|
||||
p=17,40 v=81,-5
|
||||
p=47,24 v=47,93
|
||||
p=4,23 v=31,-49
|
||||
p=61,34 v=-42,-78
|
||||
p=34,61 v=-62,44
|
||||
p=48,18 v=-12,-97
|
||||
p=32,81 v=-74,-75
|
||||
p=61,15 v=96,-98
|
||||
p=8,86 v=87,-54
|
||||
p=26,95 v=-63,71
|
||||
p=94,61 v=13,48
|
||||
p=26,101 v=94,-57
|
||||
p=24,102 v=4,2
|
||||
p=83,56 v=-56,44
|
||||
p=96,37 v=91,-8
|
||||
p=60,43 v=-18,5
|
||||
p=93,68 v=92,1
|
||||
p=79,57 v=-9,77
|
||||
p=65,68 v=-16,-51
|
||||
p=26,28 v=-44,-80
|
||||
p=39,22 v=-75,-23
|
||||
p=90,0 v=-73,83
|
||||
p=66,88 v=10,75
|
||||
p=61,55 v=-87,52
|
||||
p=43,2 v=45,68
|
||||
p=85,25 v=-91,-12
|
||||
p=14,79 v=-50,-20
|
||||
p=32,98 v=22,21
|
||||
p=85,59 v=74,-5
|
||||
p=4,50 v=-14,8
|
||||
p=99,85 v=35,-28
|
||||
p=76,80 v=-2,64
|
||||
p=49,36 v=-8,14
|
||||
p=60,65 v=-12,67
|
||||
p=4,84 v=-98,-82
|
||||
p=0,92 v=-74,-50
|
||||
p=88,94 v=26,36
|
||||
p=20,37 v=-7,-8
|
||||
p=81,28 v=21,-59
|
||||
p=95,33 v=-39,36
|
||||
p=26,45 v=-86,23
|
||||
p=82,19 v=2,-12
|
||||
p=85,60 v=32,-44
|
||||
p=5,60 v=79,10
|
||||
p=53,33 v=-12,62
|
||||
p=40,79 v=-71,-47
|
||||
p=75,31 v=-95,95
|
||||
p=43,2 v=41,-86
|
||||
p=17,86 v=-81,82
|
||||
p=10,15 v=-31,46
|
||||
p=7,74 v=-25,89
|
||||
p=69,8 v=-61,32
|
||||
p=82,65 v=-39,74
|
||||
p=73,101 v=-12,-79
|
||||
p=51,9 v=93,-16
|
||||
p=95,56 v=13,15
|
||||
p=96,67 v=34,29
|
||||
p=19,91 v=-31,89
|
||||
p=2,43 v=-96,-55
|
||||
p=68,60 v=17,-91
|
||||
p=17,86 v=8,-43
|
||||
p=5,95 v=16,71
|
||||
p=49,20 v=37,21
|
||||
p=6,67 v=-40,96
|
||||
p=47,95 v=-32,-76
|
||||
p=45,71 v=-81,2
|
||||
p=46,31 v=-34,-89
|
||||
p=49,17 v=-79,-97
|
||||
p=66,82 v=18,-95
|
||||
p=69,86 v=81,-21
|
||||
p=5,87 v=-10,-21
|
||||
p=84,81 v=47,97
|
||||
p=89,9 v=13,-60
|
||||
p=34,15 v=-67,-38
|
||||
p=51,46 v=-28,-91
|
||||
p=94,99 v=-21,-35
|
||||
p=15,20 v=3,48
|
||||
p=26,72 v=-32,13
|
||||
p=80,5 v=-43,-20
|
||||
p=64,82 v=-49,-75
|
||||
p=56,58 v=-94,81
|
||||
p=29,86 v=79,16
|
||||
p=98,60 v=-36,4
|
||||
p=23,47 v=-37,77
|
||||
p=48,66 v=63,78
|
||||
p=48,92 v=-97,74
|
||||
p=58,86 v=85,27
|
||||
p=99,85 v=57,97
|
||||
p=98,53 v=-28,-25
|
||||
p=72,44 v=-48,31
|
||||
p=35,67 v=75,30
|
||||
p=22,11 v=38,13
|
||||
p=95,41 v=-85,36
|
||||
p=3,55 v=-85,-66
|
||||
p=50,57 v=-94,11
|
||||
p=58,2 v=-42,-64
|
||||
p=45,3 v=-97,10
|
||||
p=1,30 v=97,-31
|
||||
p=75,68 v=13,-58
|
||||
p=79,101 v=62,-98
|
||||
p=20,26 v=83,25
|
||||
p=49,4 v=25,-16
|
||||
p=46,54 v=89,7
|
||||
p=86,42 v=-43,-81
|
||||
p=6,3 v=-99,-5
|
||||
p=74,50 v=-61,22
|
||||
p=40,13 v=-38,-57
|
||||
p=5,54 v=-5,-65
|
||||
p=55,66 v=10,-25
|
||||
p=52,82 v=-55,-28
|
||||
p=70,18 v=-68,-49
|
||||
p=54,10 v=-38,-16
|
||||
p=79,35 v=54,-45
|
||||
p=95,64 v=80,6
|
||||
p=88,62 v=-56,78
|
||||
p=65,28 v=-39,43
|
||||
p=69,29 v=-35,-78
|
||||
p=68,99 v=-5,79
|
||||
p=37,22 v=30,-49
|
||||
p=98,55 v=-92,-84
|
||||
p=3,1 v=-10,-64
|
||||
p=56,60 v=49,26
|
||||
p=38,25 v=-56,91
|
||||
p=93,22 v=46,87
|
||||
p=97,11 v=13,-86
|
||||
p=16,15 v=23,76
|
||||
p=34,58 v=45,15
|
||||
p=20,59 v=-12,72
|
||||
p=30,78 v=-25,50
|
||||
p=61,59 v=-53,37
|
||||
p=33,2 v=75,-24
|
||||
p=36,5 v=81,43
|
||||
p=90,93 v=-10,50
|
||||
p=60,74 v=14,96
|
||||
p=56,40 v=-56,96
|
||||
p=79,6 v=77,-71
|
||||
p=87,64 v=-2,-62
|
||||
p=25,66 v=64,-47
|
||||
p=4,13 v=-66,54
|
||||
p=47,57 v=67,59
|
||||
p=39,64 v=90,-88
|
||||
p=81,68 v=-73,52
|
||||
p=59,36 v=-42,-89
|
||||
p=0,4 v=14,83
|
||||
p=20,5 v=-67,-9
|
||||
p=100,45 v=20,-44
|
||||
p=85,27 v=54,-48
|
||||
p=58,54 v=-16,-11
|
||||
p=71,4 v=-54,42
|
||||
p=22,98 v=83,-46
|
||||
p=32,7 v=-26,32
|
||||
p=33,52 v=37,-62
|
||||
p=82,33 v=-28,14
|
||||
p=90,11 v=-88,-97
|
||||
p=39,79 v=52,45
|
||||
p=60,15 v=70,-79
|
||||
p=3,38 v=-70,-29
|
||||
p=10,80 v=27,-10
|
||||
p=22,22 v=-89,7
|
||||
p=23,29 v=-74,49
|
||||
p=45,34 v=26,51
|
||||
p=59,63 v=-3,41
|
||||
p=9,28 v=-82,89
|
||||
p=18,42 v=-10,-67
|
||||
p=2,80 v=-3,-80
|
||||
p=94,73 v=13,89
|
||||
p=89,73 v=-50,-40
|
||||
p=22,85 v=71,-38
|
||||
p=20,99 v=52,-10
|
||||
p=40,89 v=52,27
|
||||
p=47,99 v=-18,59
|
||||
p=71,55 v=25,-47
|
||||
p=69,102 v=-31,-64
|
||||
p=67,43 v=-91,44
|
||||
p=79,27 v=69,-72
|
||||
p=43,53 v=89,22
|
||||
p=59,30 v=26,-46
|
||||
p=53,54 v=37,-33
|
||||
p=72,11 v=-80,-27
|
||||
p=56,63 v=33,-14
|
||||
p=53,61 v=24,86
|
||||
p=40,77 v=-17,-66
|
||||
p=88,88 v=53,33
|
||||
p=40,82 v=56,-76
|
||||
p=16,2 v=60,-94
|
||||
p=17,83 v=-78,-3
|
||||
p=16,99 v=-44,13
|
||||
p=88,19 v=-73,40
|
||||
p=61,16 v=36,-30
|
||||
p=1,90 v=-21,-80
|
||||
p=65,92 v=-95,-30
|
||||
p=100,98 v=24,31
|
||||
p=45,54 v=-42,30
|
||||
p=87,60 v=56,-57
|
||||
p=97,43 v=75,-96
|
||||
p=54,64 v=3,69
|
||||
p=73,29 v=-5,84
|
||||
p=69,5 v=-99,-27
|
||||
p=18,8 v=98,94
|
||||
p=9,4 v=92,61
|
||||
p=69,50 v=38,34
|
||||
p=9,52 v=-85,74
|
||||
p=33,16 v=34,-86
|
||||
p=38,68 v=15,45
|
||||
p=93,82 v=25,17
|
||||
p=22,34 v=6,-51
|
||||
p=40,81 v=79,-6
|
||||
p=62,20 v=23,86
|
||||
p=2,21 v=43,-60
|
||||
p=19,79 v=-74,38
|
||||
p=70,3 v=-20,-81
|
||||
p=57,66 v=-4,-22
|
||||
p=54,36 v=65,-30
|
||||
p=48,83 v=-60,-43
|
||||
p=71,41 v=92,-56
|
||||
p=90,66 v=-77,-62
|
||||
p=65,15 v=-24,-79
|
||||
p=49,48 v=-53,81
|
||||
p=41,15 v=71,-49
|
||||
p=59,58 v=83,18
|
||||
p=27,84 v=-38,64
|
||||
p=94,34 v=2,36
|
||||
p=12,34 v=-55,-30
|
||||
p=64,40 v=-27,29
|
||||
p=74,28 v=-91,-63
|
||||
p=81,86 v=-77,-10
|
||||
p=83,26 v=32,47
|
||||
p=20,44 v=-63,-96
|
||||
p=1,48 v=-51,-11
|
||||
p=69,18 v=-5,-82
|
||||
p=63,18 v=16,-28
|
||||
p=88,1 v=-2,46
|
||||
p=80,44 v=2,33
|
||||
p=10,35 v=72,10
|
||||
p=79,35 v=45,-72
|
||||
p=6,13 v=-18,3
|
||||
p=40,43 v=41,-4
|
||||
p=100,18 v=-51,-93
|
||||
p=71,54 v=94,37
|
||||
p=4,93 v=50,97
|
||||
p=9,56 v=76,-77
|
||||
p=89,38 v=-50,92
|
||||
p=96,31 v=35,58
|
||||
p=73,11 v=96,-86
|
||||
p=36,67 v=-60,27
|
||||
p=44,77 v=-82,71
|
||||
p=67,53 v=96,61
|
||||
p=14,82 v=72,42
|
||||
p=96,14 v=65,98
|
||||
p=91,8 v=78,-72
|
||||
p=44,80 v=-22,-67
|
||||
p=47,59 v=-75,48
|
||||
p=90,52 v=-65,-3
|
||||
p=10,41 v=-29,-70
|
||||
p=57,90 v=-75,13
|
||||
p=42,43 v=67,-85
|
||||
p=51,72 v=33,79
|
||||
p=33,87 v=60,56
|
||||
p=93,55 v=-77,-44
|
||||
p=31,29 v=64,-19
|
||||
p=91,81 v=21,86
|
||||
p=100,99 v=-66,-24
|
||||
p=68,90 v=29,23
|
||||
p=43,25 v=-6,-49
|
||||
p=62,37 v=-98,-74
|
||||
p=57,11 v=97,-83
|
||||
p=89,85 v=74,14
|
||||
p=29,18 v=48,-13
|
||||
p=84,92 v=-43,-93
|
||||
p=33,5 v=19,94
|
||||
p=2,85 v=-58,12
|
||||
p=18,95 v=-41,42
|
||||
p=75,59 v=34,91
|
||||
p=0,56 v=-51,-58
|
||||
p=85,10 v=-91,-37
|
||||
p=64,20 v=-42,-23
|
||||
p=28,30 v=-27,7
|
||||
p=18,46 v=-96,73
|
||||
p=33,93 v=-93,-53
|
||||
p=29,64 v=30,-29
|
||||
p=65,53 v=-42,15
|
||||
p=26,92 v=11,62
|
||||
p=69,34 v=-99,-4
|
||||
p=44,15 v=-94,-64
|
||||
p=24,42 v=-22,88
|
||||
p=37,8 v=41,87
|
||||
p=22,77 v=-54,-54
|
||||
p=9,13 v=-18,85
|
||||
p=90,97 v=46,36
|
||||
p=37,61 v=64,93
|
||||
p=96,78 v=80,-47
|
||||
p=92,62 v=6,74
|
||||
p=19,20 v=-44,-23
|
||||
p=63,43 v=-16,-4
|
||||
p=85,0 v=-73,-64
|
||||
p=37,53 v=-11,-81
|
||||
p=28,55 v=11,-40
|
||||
p=77,22 v=-72,-67
|
||||
p=88,86 v=47,60
|
||||
p=43,50 v=-19,-95
|
||||
p=46,28 v=11,3
|
||||
p=16,5 v=28,66
|
||||
p=85,85 v=-36,-98
|
||||
p=95,15 v=9,17
|
||||
p=46,70 v=-64,82
|
||||
p=24,49 v=38,-84
|
||||
p=94,5 v=-24,-83
|
||||
p=59,73 v=-98,49
|
||||
p=13,75 v=72,12
|
||||
p=68,27 v=-57,-5
|
||||
p=13,71 v=-55,-84
|
||||
p=57,12 v=-68,28
|
||||
p=21,90 v=-45,16
|
||||
p=38,4 v=-93,21
|
||||
p=66,96 v=-72,-13
|
||||
p=34,95 v=-41,-90
|
||||
p=85,39 v=-18,-30
|
||||
p=3,94 v=9,97
|
||||
p=89,12 v=5,-67
|
||||
p=44,58 v=-4,-62
|
||||
+1040020
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,419 @@
|
||||
--- Day 15: Warehouse Woes ---
|
||||
|
||||
You appear back inside your own mini submarine! Each Historian drives their mini submarine in a different direction; maybe the Chief has his own submarine down here somewhere as well?
|
||||
|
||||
You look up to see a vast school of lanternfish swimming past you. On closer inspection, they seem quite anxious, so you drive your mini submarine over to see if you can help.
|
||||
|
||||
Because lanternfish populations grow rapidly, they need a lot of food, and that food needs to be stored somewhere. That's why these lanternfish have built elaborate warehouse complexes operated by robots!
|
||||
|
||||
These lanternfish seem so anxious because they have lost control of the robot that operates one of their most important warehouses! It is currently running amok, pushing around boxes in the warehouse with no regard for lanternfish logistics or lanternfish inventory management strategies.
|
||||
|
||||
Right now, none of the lanternfish are brave enough to swim up to an unpredictable robot so they could shut it off. However, if you could anticipate the robot's movements, maybe they could find a safe option.
|
||||
|
||||
The lanternfish already have a map of the warehouse and a list of movements the robot will attempt to make (your puzzle input). The problem is that the movements will sometimes fail as boxes are shifted around, making the actual movements of the robot difficult to predict.
|
||||
|
||||
For example:
|
||||
|
||||
##########
|
||||
#..O..O.O#
|
||||
#......O.#
|
||||
#.OO..O.O#
|
||||
#..O@..O.#
|
||||
#O#..O...#
|
||||
#O..O..O.#
|
||||
#.OO.O.OO#
|
||||
#....O...#
|
||||
##########
|
||||
|
||||
<vv>^<v^>v>^vv^v>v<>v^v<v<^vv<<<^><<><>>v<vvv<>^v^>^<<<><<v<<<v^vv^v>^
|
||||
vvv<<^>^v^^><<>>><>^<<><^vv^^<>vvv<>><^^v>^>vv<>v<<<<v<^v>^<^^>>>^<v<v
|
||||
><>vv>v^v^<>><>>>><^^>vv>v<^^^>>v^v^<^^>v^^>v^<^v>v<>>v^v^<v>v^^<^^vv<
|
||||
<<v<^>>^^^^>>>v^<>vvv^><v<<<>^^^vv^<vvv>^>v<^^^^v<>^>vvvv><>>v^<<^^^^^
|
||||
^><^><>>><>^^<<^^v>>><^<v>^<vv>>v>>>^v><>^v><<<<v>>v<v<v>vvv>^<><<>^><
|
||||
^>><>^v<><^vvv<^^<><v<<<<<><^v<<<><<<^^<v<^^^><^>>^<v^><<<^>>^v<v^v<v^
|
||||
>^>>^v>vv>^<<^v<>><<><<v<<v><>v<^vv<<<>^^v^>^^>>><<^v>>v^v><^^>>^<>vv^
|
||||
<><^^>^^^<><vvvvv^v<v<<>^v<v>v<<^><<><<><<<^^<<<^<<>><<><^^^>^^<>^>v<>
|
||||
^^>vv<^v^v<vv>^<><v<^v>^^^>>>^^vvv^>vvv<>>>^<^>>>>>^<<^v>^vvv<>^<><<v>
|
||||
v^^>>><<^^<>>^v^<v^vv<>v^<<>^<^v^v><^<<<><<^<v><v<>vv>>v><v^<vv<>v^<<^
|
||||
|
||||
As the robot (@) attempts to move, if there are any boxes (O) in the way, the robot will also attempt to push those boxes. However, if this action would cause the robot or a box to move into a wall (#), nothing moves instead, including the robot. The initial positions of these are shown on the map at the top of the document the lanternfish gave you.
|
||||
|
||||
The rest of the document describes the moves (^ for up, v for down, < for left, > for right) that the robot will attempt to make, in order. (The moves form a single giant sequence; they are broken into multiple lines just to make copy-pasting easier. Newlines within the move sequence should be ignored.)
|
||||
|
||||
Here is a smaller example to get started:
|
||||
|
||||
########
|
||||
#..O.O.#
|
||||
##@.O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
<^^>>>vv<v>>v<<
|
||||
|
||||
Were the robot to attempt the given sequence of moves, it would push around the boxes as follows:
|
||||
|
||||
Initial state:
|
||||
########
|
||||
#..O.O.#
|
||||
##@.O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
Move <:
|
||||
########
|
||||
#..O.O.#
|
||||
##@.O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
Move ^:
|
||||
########
|
||||
#.@O.O.#
|
||||
##..O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
Move ^:
|
||||
########
|
||||
#.@O.O.#
|
||||
##..O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
Move >:
|
||||
########
|
||||
#..@OO.#
|
||||
##..O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
Move >:
|
||||
########
|
||||
#...@OO#
|
||||
##..O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
Move >:
|
||||
########
|
||||
#...@OO#
|
||||
##..O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
Move v:
|
||||
########
|
||||
#....OO#
|
||||
##..@..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move v:
|
||||
########
|
||||
#....OO#
|
||||
##..@..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move <:
|
||||
########
|
||||
#....OO#
|
||||
##.@...#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move v:
|
||||
########
|
||||
#....OO#
|
||||
##.....#
|
||||
#..@O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move >:
|
||||
########
|
||||
#....OO#
|
||||
##.....#
|
||||
#...@O.#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move >:
|
||||
########
|
||||
#....OO#
|
||||
##.....#
|
||||
#....@O#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move v:
|
||||
########
|
||||
#....OO#
|
||||
##.....#
|
||||
#.....O#
|
||||
#.#.O@.#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move <:
|
||||
########
|
||||
#....OO#
|
||||
##.....#
|
||||
#.....O#
|
||||
#.#O@..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move <:
|
||||
########
|
||||
#....OO#
|
||||
##.....#
|
||||
#.....O#
|
||||
#.#O@..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
The larger example has many more moves; after the robot has finished those moves, the warehouse would look like this:
|
||||
|
||||
##########
|
||||
#.O.O.OOO#
|
||||
#........#
|
||||
#OO......#
|
||||
#OO@.....#
|
||||
#O#.....O#
|
||||
#O.....OO#
|
||||
#O.....OO#
|
||||
#OO....OO#
|
||||
##########
|
||||
|
||||
The lanternfish use their own custom Goods Positioning System (GPS for short) to track the locations of the boxes. The GPS coordinate of a box is equal to 100 times its distance from the top edge of the map plus its distance from the left edge of the map. (This process does not stop at wall tiles; measure all the way to the edges of the map.)
|
||||
|
||||
So, the box shown below has a distance of 1 from the top edge of the map and 4 from the left edge of the map, resulting in a GPS coordinate of 100 * 1 + 4 = 104.
|
||||
|
||||
#######
|
||||
#...O..
|
||||
#......
|
||||
|
||||
The lanternfish would like to know the sum of all boxes' GPS coordinates after the robot finishes moving. In the larger example, the sum of all boxes' GPS coordinates is 10092. In the smaller example, the sum is 2028.
|
||||
|
||||
Predict the motion of the robot and boxes in the warehouse. After the robot is finished moving, what is the sum of all boxes' GPS coordinates?
|
||||
|
||||
Your puzzle answer was 1563092.
|
||||
--- Part Two ---
|
||||
|
||||
The lanternfish use your information to find a safe moment to swim in and turn off the malfunctioning robot! Just as they start preparing a festival in your honor, reports start coming in that a second warehouse's robot is also malfunctioning.
|
||||
|
||||
This warehouse's layout is surprisingly similar to the one you just helped. There is one key difference: everything except the robot is twice as wide! The robot's list of movements doesn't change.
|
||||
|
||||
To get the wider warehouse's map, start with your original map and, for each tile, make the following changes:
|
||||
|
||||
If the tile is #, the new map contains ## instead.
|
||||
If the tile is O, the new map contains [] instead.
|
||||
If the tile is ., the new map contains .. instead.
|
||||
If the tile is @, the new map contains @. instead.
|
||||
|
||||
This will produce a new warehouse map which is twice as wide and with wide boxes that are represented by []. (The robot does not change size.)
|
||||
|
||||
The larger example from before would now look like this:
|
||||
|
||||
####################
|
||||
##....[]....[]..[]##
|
||||
##............[]..##
|
||||
##..[][]....[]..[]##
|
||||
##....[]@.....[]..##
|
||||
##[]##....[]......##
|
||||
##[]....[]....[]..##
|
||||
##..[][]..[]..[][]##
|
||||
##........[]......##
|
||||
####################
|
||||
|
||||
Because boxes are now twice as wide but the robot is still the same size and speed, boxes can be aligned such that they directly push two other boxes at once. For example, consider this situation:
|
||||
|
||||
#######
|
||||
#...#.#
|
||||
#.....#
|
||||
#..OO@#
|
||||
#..O..#
|
||||
#.....#
|
||||
#######
|
||||
|
||||
<vv<<^^<<^^
|
||||
|
||||
After appropriately resizing this map, the robot would push around these boxes as follows:
|
||||
|
||||
Initial state:
|
||||
##############
|
||||
##......##..##
|
||||
##..........##
|
||||
##....[][]@.##
|
||||
##....[]....##
|
||||
##..........##
|
||||
##############
|
||||
|
||||
Move <:
|
||||
##############
|
||||
##......##..##
|
||||
##..........##
|
||||
##...[][]@..##
|
||||
##....[]....##
|
||||
##..........##
|
||||
##############
|
||||
|
||||
Move v:
|
||||
##############
|
||||
##......##..##
|
||||
##..........##
|
||||
##...[][]...##
|
||||
##....[].@..##
|
||||
##..........##
|
||||
##############
|
||||
|
||||
Move v:
|
||||
##############
|
||||
##......##..##
|
||||
##..........##
|
||||
##...[][]...##
|
||||
##....[]....##
|
||||
##.......@..##
|
||||
##############
|
||||
|
||||
Move <:
|
||||
##############
|
||||
##......##..##
|
||||
##..........##
|
||||
##...[][]...##
|
||||
##....[]....##
|
||||
##......@...##
|
||||
##############
|
||||
|
||||
Move <:
|
||||
##############
|
||||
##......##..##
|
||||
##..........##
|
||||
##...[][]...##
|
||||
##....[]....##
|
||||
##.....@....##
|
||||
##############
|
||||
|
||||
Move ^:
|
||||
##############
|
||||
##......##..##
|
||||
##...[][]...##
|
||||
##....[]....##
|
||||
##.....@....##
|
||||
##..........##
|
||||
##############
|
||||
|
||||
Move ^:
|
||||
##############
|
||||
##......##..##
|
||||
##...[][]...##
|
||||
##....[]....##
|
||||
##.....@....##
|
||||
##..........##
|
||||
##############
|
||||
|
||||
Move <:
|
||||
##############
|
||||
##......##..##
|
||||
##...[][]...##
|
||||
##....[]....##
|
||||
##....@.....##
|
||||
##..........##
|
||||
##############
|
||||
|
||||
Move <:
|
||||
##############
|
||||
##......##..##
|
||||
##...[][]...##
|
||||
##....[]....##
|
||||
##...@......##
|
||||
##..........##
|
||||
##############
|
||||
|
||||
Move ^:
|
||||
##############
|
||||
##......##..##
|
||||
##...[][]...##
|
||||
##...@[]....##
|
||||
##..........##
|
||||
##..........##
|
||||
##############
|
||||
|
||||
Move ^:
|
||||
##############
|
||||
##...[].##..##
|
||||
##...@.[]...##
|
||||
##....[]....##
|
||||
##..........##
|
||||
##..........##
|
||||
##############
|
||||
|
||||
This warehouse also uses GPS to locate the boxes. For these larger boxes, distances are measured from the edge of the map to the closest edge of the box in question. So, the box shown below has a distance of 1 from the top edge of the map and 5 from the left edge of the map, resulting in a GPS coordinate of 100 * 1 + 5 = 105.
|
||||
|
||||
##########
|
||||
##...[]...
|
||||
##........
|
||||
|
||||
In the scaled-up version of the larger example from above, after the robot has finished all of its moves, the warehouse would look like this:
|
||||
|
||||
####################
|
||||
##[].......[].[][]##
|
||||
##[]...........[].##
|
||||
##[]........[][][]##
|
||||
##[]......[]....[]##
|
||||
##..##......[]....##
|
||||
##..[]............##
|
||||
##..@......[].[][]##
|
||||
##......[][]..[]..##
|
||||
####################
|
||||
|
||||
The sum of these boxes' GPS coordinates is 9021.
|
||||
|
||||
Predict the motion of the robot and boxes in this new, scaled-up warehouse. What is the sum of all boxes' final GPS coordinates?
|
||||
|
||||
Your puzzle answer was 1582688.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+112
@@ -0,0 +1,112 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys, os, time
|
||||
from copy import deepcopy
|
||||
|
||||
|
||||
def show(m):
|
||||
for line in m:
|
||||
sys.stdout.write("\r"+''.join(line)+'\n')
|
||||
sys.stdout.flush()
|
||||
time.sleep(0.2)
|
||||
|
||||
|
||||
def gps(x, y):
|
||||
return 100*y + x
|
||||
|
||||
|
||||
def move_stone(m, x, y, move):
|
||||
dir = {'^': (0,-1), '>': (1,0), 'v': (0,1), '<': (-1,0)}
|
||||
nx, ny = x+dir[move][0], y+dir[move][1]
|
||||
if m[ny][nx] == '#': return
|
||||
if m[ny][nx] == 'O': move_stone(m, nx, ny, move)
|
||||
if m[ny][nx] == '.':
|
||||
m[ny][nx] = 'O'
|
||||
m[y][x] = '.'
|
||||
return
|
||||
|
||||
|
||||
def move_box_h(m, x, y, move):
|
||||
dir = {'^': (0,-1), '>': (1,0), 'v': (0,1), '<': (-1,0)}
|
||||
nx, ny = x+dir[move][0], y
|
||||
sym = m[y][x]
|
||||
if m[ny][nx] == '#': return
|
||||
if m[ny][nx] in ['[', ']']: move_box_h(m, nx, ny, move)
|
||||
if m[ny][nx] == '.':
|
||||
m[ny][nx] = sym
|
||||
m[y][x] = '.'
|
||||
return
|
||||
|
||||
|
||||
def move_box_v(m, x, y, move):
|
||||
dir = {'^': (0,-1), '>': (1,0), 'v': (0,1), '<': (-1,0)}
|
||||
if m[y][x] == '[': x1, x2 = x, x+1
|
||||
else: x1, x2 = x-1, x
|
||||
nx1, nx2, ny = x1+dir[move][0], x2+dir[move][0], y+dir[move][1]
|
||||
if m[ny][nx1] == '#' or m[ny][nx2] == '#': return m
|
||||
if m[ny][nx1] == ']' and m[ny][nx2] == '[':
|
||||
mp = deepcopy(m)
|
||||
mp = move_box_v(mp, nx1, ny, move)
|
||||
mp = move_box_v(mp, nx2, ny, move)
|
||||
if mp[ny][nx1] == '.' and mp[ny][nx2] == '.': m = deepcopy(mp)
|
||||
elif m[ny][nx1] in ['[', ']']: m = move_box_v(m, nx1, ny, move)
|
||||
elif m[ny][nx2] in ['[', ']']: m = move_box_v(m, nx2, ny, move)
|
||||
if m[ny][nx1] == '.' and m[ny][nx2] == '.':
|
||||
m[ny][nx1] = '['
|
||||
m[ny][nx2] = ']'
|
||||
m[y][x1] = '.'
|
||||
m[y][x2] = '.'
|
||||
return m
|
||||
return m
|
||||
|
||||
|
||||
def move(m, x, y, move):
|
||||
dir = {'^': (0,-1), '>': (1,0), 'v': (0,1), '<': (-1,0)}
|
||||
nx, ny = x+dir[move][0], y+dir[move][1]
|
||||
if m[ny][nx] == '#': return m, x, y
|
||||
if m[ny][nx] == 'O': move_stone(m, nx, ny, move)
|
||||
if m[ny][nx] in ['[',']'] and move in ['v', '^']:
|
||||
m = move_box_v(m, nx, ny, move)
|
||||
elif m[ny][nx] in ['[',']'] and move in ['<', '>']:
|
||||
move_box_h(m, nx, ny, move)
|
||||
if m[ny][nx] == '.':
|
||||
m[ny][nx] = '@'
|
||||
m[y][x] = '.'
|
||||
return m, nx, ny
|
||||
else: return m, x, y
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
mp, moves = open(sys.argv[1]).read().split('\n\n')
|
||||
mp = [list(y.strip('\n')) for y in mp.split('\n')]
|
||||
moves = list(''.join([m.strip('\n') for m in moves]))
|
||||
wm = []
|
||||
for y, l in enumerate(mp):
|
||||
line = []
|
||||
for x, r in enumerate(l):
|
||||
if r == '#': line += ['#', '#']
|
||||
elif r == '.': line += ['.', '.']
|
||||
elif r == 'O': line += ['[', ']']
|
||||
elif r == '@':
|
||||
wrx, wry = len(line), y
|
||||
line += ['@', '.']
|
||||
rx, ry = x, y
|
||||
wm.append(line)
|
||||
for mov in moves:
|
||||
mp, rx, ry = move(mp, rx, ry, mov)
|
||||
wm, wrx, wry = move(wm, wrx, wry, mov)
|
||||
|
||||
# challenge 1
|
||||
res1 = 0
|
||||
for y, m in enumerate(mp):
|
||||
for x, t in enumerate(m):
|
||||
if t == 'O': res1 += gps(x, y)
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
res2 = 0
|
||||
for y, m in enumerate(wm):
|
||||
for x, t in enumerate(m):
|
||||
if t == '[': res2 += gps(x, y)
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
##########
|
||||
#..O..O.O#
|
||||
#......O.#
|
||||
#.OO..O.O#
|
||||
#..O@..O.#
|
||||
#O#..O...#
|
||||
#O..O..O.#
|
||||
#.OO.O.OO#
|
||||
#....O...#
|
||||
##########
|
||||
|
||||
<vv>^<v^>v>^vv^v>v<>v^v<v<^vv<<<^><<><>>v<vvv<>^v^>^<<<><<v<<<v^vv^v>^
|
||||
vvv<<^>^v^^><<>>><>^<<><^vv^^<>vvv<>><^^v>^>vv<>v<<<<v<^v>^<^^>>>^<v<v
|
||||
><>vv>v^v^<>><>>>><^^>vv>v<^^^>>v^v^<^^>v^^>v^<^v>v<>>v^v^<v>v^^<^^vv<
|
||||
<<v<^>>^^^^>>>v^<>vvv^><v<<<>^^^vv^<vvv>^>v<^^^^v<>^>vvvv><>>v^<<^^^^^
|
||||
^><^><>>><>^^<<^^v>>><^<v>^<vv>>v>>>^v><>^v><<<<v>>v<v<v>vvv>^<><<>^><
|
||||
^>><>^v<><^vvv<^^<><v<<<<<><^v<<<><<<^^<v<^^^><^>>^<v^><<<^>>^v<v^v<v^
|
||||
>^>>^v>vv>^<<^v<>><<><<v<<v><>v<^vv<<<>^^v^>^^>>><<^v>>v^v><^^>>^<>vv^
|
||||
<><^^>^^^<><vvvvv^v<v<<>^v<v>v<<^><<><<><<<^^<<<^<<>><<><^^^>^^<>^>v<>
|
||||
^^>vv<^v^v<vv>^<><v<^v>^^^>>>^^vvv^>vvv<>>>^<^>>>>>^<<^v>^vvv<>^<><<v>
|
||||
v^^>>><<^^<>>^v^<v^vv<>v^<<>^<^v^v><^<<<><<^<v><v<>vv>>v><v^<vv<>v^<<
|
||||
@@ -0,0 +1,10 @@
|
||||
########
|
||||
#..O.O.#
|
||||
##@.O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
<^^>>>vv<v>>v<<
|
||||
@@ -0,0 +1,9 @@
|
||||
#######
|
||||
#...#.#
|
||||
#.....#
|
||||
#..OO@#
|
||||
#..O..#
|
||||
#.....#
|
||||
#######
|
||||
|
||||
<vv<<^^<<^^
|
||||
@@ -0,0 +1,71 @@
|
||||
##################################################
|
||||
#..OO..O.O....O...O..O...O.......O...OO##....O.OO#
|
||||
#O.#..#OOO#..O..OO...O.O.....OO..O#O#.OOO.....#..#
|
||||
#.....O.......OO.#OO....#O.OO.O..OO.O.O.O..##....#
|
||||
#.O....O...O#...#...OO..#..O........#O..#..O..O..#
|
||||
#O....O...O.O..OO..OO..#OO.#OO.O......##..O..O...#
|
||||
#..O.##..#O...O...#.#.O.O..O.#......O..#.#...O...#
|
||||
#O.O.........O..O........OO....OO......O.....O#..#
|
||||
#...O....#..O..O........O......O.#.....O..O#..O..#
|
||||
#.....#OOOOOOO.O.....O.OOO.#.#.........O#O....O..#
|
||||
#.........OO#...O.O.#.O..O.....O..#.O..OO.O.#..O.#
|
||||
#OOO...............#O.OOO..O#....O.....O...#....O#
|
||||
#....O...O.O.#....O.O.O.OO..#......OO..O.OO.O...O#
|
||||
#O.O..OO..#...........#O...O.O#...O...O..O..O.O..#
|
||||
#OOO...O...#O.O.O...OO..#OO.OO#..O...O..OO...O...#
|
||||
#..#........#...O..O...#.O..OO..#O.OO.#O......O..#
|
||||
#O.........O.#O.......O.#.O.O....O#...OO...O...OO#
|
||||
#.#...O.O....O.O....#...#.O...............O..#.OO#
|
||||
#...O.....O..OOO...O..#O..#.......#OO..O..#...O..#
|
||||
#OO.O#..O.#..O.#.........OO...O.OO..O....OO.O....#
|
||||
#.O..O...O.......OOO....OO....O.OOO........O..O..#
|
||||
#O..O..#..O.O.O..O.O.O..#O.......O..OO..O..O.....#
|
||||
##O#.....#.O.....O#......O.........OOO.O...#.OOO.#
|
||||
#O.#OO...O..#.O#.O..O.##OO......#..#OO.......O.#O#
|
||||
#..O...#..O....OOO..#...@....OO.#.O#..OO......O..#
|
||||
#.O#.....O...O..O#..O.OOO.OO.#O.O.O..O....O..OO.##
|
||||
#..#.#.O#....#..O.O.OOO.......OO......O.OOO......#
|
||||
#.....O....O...#.OO.OOO..#...O..O...O..#..O#OO.O.#
|
||||
#OO.O.......O#...O.O......OO....#.O...OO.O..O.O..#
|
||||
##O..O..O##..O..OOOO...O..#O..O.OO.O....O....#.#.#
|
||||
##..OO#O.##...#O.OOO.......O.....O..O..OO.O...OOO#
|
||||
#...#..OO.......O.O..OO..........O...OO....OO.O#.#
|
||||
#..O.O..#OO.....O.........O#O.#..#..O...O.OO..O..#
|
||||
#..O.#O...O............#O.O.O...O..O.O...#...OOO##
|
||||
#...#OO.O#.OO.......#.......O..O.##....OO....OOOO#
|
||||
#.O.....O..O...O.....#..O.....O...OO.O.O.......OO#
|
||||
#...#O...O.O.#O..O..#..OOO#....O##....#OO.#.#OOOO#
|
||||
#.O.#OOO......O...O..O.#O.OO..O.......O...O..O..##
|
||||
#O.....O.#....O.OOO..O...#O#O....OOOO........#...#
|
||||
#O...#.O...O.OO..O.O.O.............OO.O.#...#.O###
|
||||
#O....OO.O.OOO#...#..#.....O#O..O..O.O..O#.O...O.#
|
||||
#.........O#.##.OO..O..O..##..O........O..OOO....#
|
||||
#.#....O.....O.O......O.O.O...OO.O....O..#O..O...#
|
||||
#....O##O.O..#....O.OO.O...O..O..OOO..O...#..O...#
|
||||
#O#....#.......O..O..#..OO.......O.OO.....OO.O...#
|
||||
#O...O#OOO.O......O......OO..O.#.O.....O.O....OOO#
|
||||
##....O##...#O.....O.#........OOOOO#..O....#.O.O.#
|
||||
#O...O.....OO.....#O...O......O..OO.O..OOO.O#.O.O#
|
||||
#O.O..#.O.O.O.O#.O#....OO.O....O.OO......O#OO...##
|
||||
##################################################
|
||||
|
||||
>><^v><>^v<<vv<>vv><v><<^^>>>>^^><>^<^^vvv>>><><>v^^^^<<^<^><>>>v><><vv^v^<>>>^>><>v>v>^v>>v>>>v^<<^>v^<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>v<^<v<<^<^><^><><><^^<^<><>^>v^<^>><>>>^^<vv<<vv>^^v<<vv^^vvvv^v^^<^v^v^^^^><v^<>^^v>vv<<^<>v<^>v><>^^^<<<^><<v>>v<<v<v><v^<v^vv^<vv<>^<^<>^>v>v<<^^^>>^^<>^<<^^<^^v^v^^v^^<^<<v>^<v>^^>^>^>v><^v^^^v>v^v>>v^>^>>v<>^<^v^^^^^<v>v<v^<^><^>>v^<^<<>^v^v^><<v
|
||||
@@ -0,0 +1,71 @@
|
||||
##################################################
|
||||
#..OO..O.O....O...O..O...O.......O...OO##....O.OO#
|
||||
#O.#..#OOO#..O..OO...O.O.....OO..O#O#.OOO.....#..#
|
||||
#.....O.......OO.#OO....#O.OO.O..OO.O.O.O..##....#
|
||||
#.O....O...O#...#...OO..#..O........#O..#..O..O..#
|
||||
#O....O...O.O..OO..OO..#OO.#OO.O......##..O..O...#
|
||||
#..O.##..#O...O...#.#.O.O..O.#......O..#.#...O...#
|
||||
#O.O.........O..O........OO....OO......O.....O#..#
|
||||
#...O....#..O..O........O......O.#.....O..O#..O..#
|
||||
#.....#OOOOOOO.O.....O.OOO.#.#.........O#O....O..#
|
||||
#.........OO#...O.O.#.O..O.....O..#.O..OO.O.#..O.#
|
||||
#OOO...............#O.OOO..O#....O.....O...#....O#
|
||||
#....O...O.O.#....O.O.O.OO..#......OO..O.OO.O...O#
|
||||
#O.O..OO..#...........#O...O.O#...O...O..O..O.O..#
|
||||
#OOO...O...#O.O.O...OO..#OO.OO#..O...O..OO...O...#
|
||||
#..#........#...O..O...#.O..OO..#O.OO.#O......O..#
|
||||
#O.........O.#O.......O.#.O.O....O#...OO...O...OO#
|
||||
#.#...O.O....O.O....#...#.O...............O..#.OO#
|
||||
#...O.....O..OOO...O..#O..#.......#OO..O..#...O..#
|
||||
#OO.O#..O.#..O.#.........OO...O.OO..O....OO.O....#
|
||||
#.O..O...O.......OOO....OO....O.OOO........O..O..#
|
||||
#O..O..#..O.O.O..O.O.O..#O.......O..OO..O..O.....#
|
||||
##O#.....#.O.....O#......O.........OOO.O...#.OOO.#
|
||||
#O.#OO...O..#.O#.O..O.##OO......#..#OO.......O.#O#
|
||||
#..O...#..O....OOO..#...@....OO.#.O#..OO......O..#
|
||||
#.O#.....O...O..O#..O.OOO.OO.#O.O.O..O....O..OO.##
|
||||
#..#.#.O#....#..O.O.OOO.......OO......O.OOO......#
|
||||
#.....O....O...#.OO.OOO..#...O..O...O..#..O#OO.O.#
|
||||
#OO.O.......O#...O.O......OO....#.O...OO.O..O.O..#
|
||||
##O..O..O##..O..OOOO...O..#O..O.OO.O....O....#.#.#
|
||||
##..OO#O.##...#O.OOO.......O.....O..O..OO.O...OOO#
|
||||
#...#..OO.......O.O..OO..........O...OO....OO.O#.#
|
||||
#..O.O..#OO.....O.........O#O.#..#..O...O.OO..O..#
|
||||
#..O.#O...O............#O.O.O...O..O.O...#...OOO##
|
||||
#...#OO.O#.OO.......#.......O..O.##....OO....OOOO#
|
||||
#.O.....O..O...O.....#..O.....O...OO.O.O.......OO#
|
||||
#...#O...O.O.#O..O..#..OOO#....O##....#OO.#.#OOOO#
|
||||
#.O.#OOO......O...O..O.#O.OO..O.......O...O..O..##
|
||||
#O.....O.#....O.OOO..O...#O#O....OOOO........#...#
|
||||
#O...#.O...O.OO..O.O.O.............OO.O.#...#.O###
|
||||
#O....OO.O.OOO#...#..#.....O#O..O..O.O..O#.O...O.#
|
||||
#.........O#.##.OO..O..O..##..O........O..OOO....#
|
||||
#.#....O.....O.O......O.O.O...OO.O....O..#O..O...#
|
||||
#....O##O.O..#....O.OO.O...O..O..OOO..O...#..O...#
|
||||
#O#....#.......O..O..#..OO.......O.OO.....OO.O...#
|
||||
#O...O#OOO.O......O......OO..O.#.O.....O.O....OOO#
|
||||
##....O##...#O.....O.#........OOOOO#..O....#.O.O.#
|
||||
#O...O.....OO.....#O...O......O..OO.O..OOO.O#.O.O#
|
||||
#O.O..#.O.O.O.O#.O#....OO.O....O.OO......O#OO...##
|
||||
##################################################
|
||||
|
||||
>><^v><>^v<<vv<>vv><v><<^^>>>>^^><>^<^^vvv>>><><>v^^^^<<^<^><>>>v><><vv^v^<>>>^>><>v>v>^v>>v>>>v^<<^>v^<v<v<v^^>>v<^v>vv^><vvv<<^<><>^<>vv>^>^^^v<^^>v^>v>v<<^>>>^^vvv<>v>><^^<><<>v>>>^<v>vvv^^v>^^v<>^^<^^v^><>>><<<v^>v^>v^><v<^<<>^v^><v<^><^<>>>>v^<><^^>>>^^v^^<v^^>^v^v>>v<><<<vv^<<>^>^v>>v^v^<^<<><^>>^vv>>vvv^<v>v^<vv><^<<<vv>vv>^<^^>v>>^^^<^^^^<<^<<<<<<v>^v>^^v>>>^<>vvvv>>><<><>^v>>vvvvv^<<^<>^>v>>^>>>v<v><>^v^v><<^v<vv<v^<v^v>><^v<^>>^>>v<^v>>v>>v^v^v<<>v>><<><^<v<^<<v<<v>>^vv^vv<>v<v^<^^>^^^vv^<<>^>^^vv>^^<>>v^<v>>>><v<vv<v<^><^v<^vvvv><v>><<><>v<^<^vv<<<>><^<>^<^<>^<vv^>>><v<^^>vv<>v^>^<<^<^>^<^vvv>>v^>>>^<^>vv^<<^^<<>>>v><>v>^>^v>><><^<<>v^>>^<<>^v^<^<><^^^v<>^<v^v^v^<<^^<<<^>v>v<>^^^^^>>v>^v^v>><>^<<>^<v>>v^><v><<<>v^<<^^><>v<<v><vv^^<>v<<v<>>>v>v<<^v<vv><v<v>>^<<>vvv<<^>vv<<vvv>v>^>>^^^^^^^vv^v>>>vvvvv>^>^v<>v>><^v^^v^^v><>vv>><v<^<^>^v>^^^<<^><v>v^<^v<>><<^v^<^><v^v^^><<^v><><^^v<v><v>^><<^<<<^v<^>><>^^vv<^<<^^^^^v<vv^<v<^<<>>>^><^^>^v^v>v^<v^v^v^^>^v>^^><>v^v>vv>^>v^><v<>v<v<
|
||||
>>v<v^<vv<v<><<>><^<^<^>><^<>>^>^^<^v^^^<v<^^vv^^^>>^>v>>v<<v^<>vv^<<>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v<v><><><v>^<>^<vv<^>^^v>^^^^^^v^>^<v<><^^^^<>><v>>>>>><<>>>>^<vv><<^>>>>>^>vv>^<<<<>v^><v>>>v^<vv^>vv^>>v>>v^^<><^<>v<^<v<<^<^><^><><><^^<^<><>^>v^<^>><>>>^^<vv<<vv>^^v<<vv^^vvvv^v^^<^v^v^^^^><v^<>^^v>vv<<^<>v<^>v><>^^^<<<^><<v>>v<<v<v><v^<v^vv^<vv<>^<^<>^>v>v<<^^^>>^^<>^<<^^<^^v^v^^v^^<^<<v>^<v>^^>^>^>v><^v^^^v>v^v>>v^>^>>v<>^<^v^^^^^<v>v<v^<^><^>>v^<^<<>^v^v^><<v
|
||||
+1020055
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,9 @@
|
||||
#####
|
||||
#...#
|
||||
#.O.#
|
||||
#.O@#
|
||||
#OO.#
|
||||
#...#
|
||||
#####
|
||||
|
||||
<>^<^<v
|
||||
@@ -0,0 +1,7 @@
|
||||
#######
|
||||
#.....#
|
||||
#.OO@.#
|
||||
#.....#
|
||||
#######
|
||||
|
||||
<<
|
||||
@@ -0,0 +1,8 @@
|
||||
#######
|
||||
#.....#
|
||||
#.O#..#
|
||||
#..O@.#
|
||||
#.....#
|
||||
#######
|
||||
|
||||
<v<<^
|
||||
@@ -0,0 +1,11 @@
|
||||
#######
|
||||
#.....#
|
||||
#.....#
|
||||
#.@O..#
|
||||
#..#O.#
|
||||
#...O.#
|
||||
#..O..#
|
||||
#.....#
|
||||
#######
|
||||
|
||||
>><vvv>v>^^^
|
||||
@@ -0,0 +1,13 @@
|
||||
######
|
||||
#....#
|
||||
#....#
|
||||
#.O..#
|
||||
#.OO@#
|
||||
#.O..#
|
||||
#.O..#
|
||||
#.O..#
|
||||
#....#
|
||||
#....#
|
||||
######
|
||||
|
||||
<^^<<vvv
|
||||
@@ -0,0 +1,11 @@
|
||||
########
|
||||
#......#
|
||||
#OO....#
|
||||
#.O....#
|
||||
#.O....#
|
||||
##O....#
|
||||
#O..O@.#
|
||||
#......#
|
||||
########
|
||||
|
||||
<^^<<>^^^<v
|
||||
@@ -0,0 +1,141 @@
|
||||
--- Day 16: Reindeer Maze ---
|
||||
|
||||
It's time again for the Reindeer Olympics! This year, the big event is the Reindeer Maze, where the Reindeer compete for the lowest score.
|
||||
|
||||
You and The Historians arrive to search for the Chief right as the event is about to start. It wouldn't hurt to watch a little, right?
|
||||
|
||||
The Reindeer start on the Start Tile (marked S) facing East and need to reach the End Tile (marked E). They can move forward one tile at a time (increasing their score by 1 point), but never into a wall (#). They can also rotate clockwise or counterclockwise 90 degrees at a time (increasing their score by 1000 points).
|
||||
|
||||
To figure out the best place to sit, you start by grabbing a map (your puzzle input) from a nearby kiosk. For example:
|
||||
|
||||
###############
|
||||
#.......#....E#
|
||||
#.#.###.#.###.#
|
||||
#.....#.#...#.#
|
||||
#.###.#####.#.#
|
||||
#.#.#.......#.#
|
||||
#.#.#####.###.#
|
||||
#...........#.#
|
||||
###.#.#####.#.#
|
||||
#...#.....#.#.#
|
||||
#.#.#.###.#.#.#
|
||||
#.....#...#.#.#
|
||||
#.###.#.#.#.#.#
|
||||
#S..#.....#...#
|
||||
###############
|
||||
|
||||
There are many paths through this maze, but taking any of the best paths would incur a score of only 7036. This can be achieved by taking a total of 36 steps forward and turning 90 degrees a total of 7 times:
|
||||
|
||||
|
||||
###############
|
||||
#.......#....E#
|
||||
#.#.###.#.###^#
|
||||
#.....#.#...#^#
|
||||
#.###.#####.#^#
|
||||
#.#.#.......#^#
|
||||
#.#.#####.###^#
|
||||
#..>>>>>>>>v#^#
|
||||
###^#.#####v#^#
|
||||
#>>^#.....#v#^#
|
||||
#^#.#.###.#v#^#
|
||||
#^....#...#v#^#
|
||||
#^###.#.#.#v#^#
|
||||
#S..#.....#>>^#
|
||||
###############
|
||||
|
||||
Here's a second example:
|
||||
|
||||
#################
|
||||
#...#...#...#..E#
|
||||
#.#.#.#.#.#.#.#.#
|
||||
#.#.#.#...#...#.#
|
||||
#.#.#.#.###.#.#.#
|
||||
#...#.#.#.....#.#
|
||||
#.#.#.#.#.#####.#
|
||||
#.#...#.#.#.....#
|
||||
#.#.#####.#.###.#
|
||||
#.#.#.......#...#
|
||||
#.#.###.#####.###
|
||||
#.#.#...#.....#.#
|
||||
#.#.#.#####.###.#
|
||||
#.#.#.........#.#
|
||||
#.#.#.#########.#
|
||||
#S#.............#
|
||||
#################
|
||||
|
||||
In this maze, the best paths cost 11048 points; following one such path would look like this:
|
||||
|
||||
#################
|
||||
#...#...#...#..E#
|
||||
#.#.#.#.#.#.#.#^#
|
||||
#.#.#.#...#...#^#
|
||||
#.#.#.#.###.#.#^#
|
||||
#>>v#.#.#.....#^#
|
||||
#^#v#.#.#.#####^#
|
||||
#^#v..#.#.#>>>>^#
|
||||
#^#v#####.#^###.#
|
||||
#^#v#..>>>>^#...#
|
||||
#^#v###^#####.###
|
||||
#^#v#>>^#.....#.#
|
||||
#^#v#^#####.###.#
|
||||
#^#v#^........#.#
|
||||
#^#v#^#########.#
|
||||
#S#>>^..........#
|
||||
#################
|
||||
|
||||
Note that the path shown above includes one 90 degree turn as the very first move, rotating the Reindeer from facing East to facing North.
|
||||
|
||||
Analyze your map carefully. What is the lowest score a Reindeer could possibly get?
|
||||
|
||||
Your puzzle answer was 143564.
|
||||
--- Part Two ---
|
||||
|
||||
Now that you know what the best paths look like, you can figure out the best spot to sit.
|
||||
|
||||
Every non-wall tile (S, ., or E) is equipped with places to sit along the edges of the tile. While determining which of these tiles would be the best spot to sit depends on a whole bunch of factors (how comfortable the seats are, how far away the bathrooms are, whether there's a pillar blocking your view, etc.), the most important factor is whether the tile is on one of the best paths through the maze. If you sit somewhere else, you'd miss all the action!
|
||||
|
||||
So, you'll need to determine which tiles are part of any best path through the maze, including the S and E tiles.
|
||||
|
||||
In the first example, there are 45 tiles (marked O) that are part of at least one of the various best paths through the maze:
|
||||
|
||||
###############
|
||||
#.......#....O#
|
||||
#.#.###.#.###O#
|
||||
#.....#.#...#O#
|
||||
#.###.#####.#O#
|
||||
#.#.#.......#O#
|
||||
#.#.#####.###O#
|
||||
#..OOOOOOOOO#O#
|
||||
###O#O#####O#O#
|
||||
#OOO#O....#O#O#
|
||||
#O#O#O###.#O#O#
|
||||
#OOOOO#...#O#O#
|
||||
#O###.#.#.#O#O#
|
||||
#O..#.....#OOO#
|
||||
###############
|
||||
|
||||
In the second example, there are 64 tiles that are part of at least one of the best paths:
|
||||
|
||||
#################
|
||||
#...#...#...#..O#
|
||||
#.#.#.#.#.#.#.#O#
|
||||
#.#.#.#...#...#O#
|
||||
#.#.#.#.###.#.#O#
|
||||
#OOO#.#.#.....#O#
|
||||
#O#O#.#.#.#####O#
|
||||
#O#O..#.#.#OOOOO#
|
||||
#O#O#####.#O###O#
|
||||
#O#O#..OOOOO#OOO#
|
||||
#O#O###O#####O###
|
||||
#O#O#OOO#..OOO#.#
|
||||
#O#O#O#####O###.#
|
||||
#O#O#OOOOOOO..#.#
|
||||
#O#O#O#########.#
|
||||
#O#OOO..........#
|
||||
#################
|
||||
|
||||
Analyze your map further. How many tiles are part of at least one of the best paths through the maze?
|
||||
|
||||
Your puzzle answer was 593.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+75
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys, math
|
||||
import numpy as np
|
||||
|
||||
|
||||
def dijkstra(graph, v, a):
|
||||
Q = [n for n in graph.keys()]
|
||||
lq = len(Q)
|
||||
while len(Q) > 0:
|
||||
u = min([u for u in Q], key=lambda x: a[x])
|
||||
Q.remove(u)
|
||||
for vo in graph[u]:
|
||||
if vo in Q:
|
||||
distance_update(graph, u,vo,a,v)
|
||||
return v, a
|
||||
|
||||
|
||||
def distance_update(g, u, vo, a, v):
|
||||
dist = 1 if vo[2] == u[2] else 1000
|
||||
alt = a[u] + dist
|
||||
# joining the sets does not work because we never remove the older nodes!
|
||||
if alt <= a[vo]:
|
||||
if alt < a[vo]:
|
||||
v[vo] = set([])
|
||||
a[vo] = alt
|
||||
v[vo].add(u)
|
||||
v[vo] = v[vo].union(set(v[u]))
|
||||
|
||||
|
||||
def count_set(edges, lab):
|
||||
edg = set([])
|
||||
for e in edges:
|
||||
edg.add((e[0], e[1]))
|
||||
lab[e[1]][e[0]] = 'O'
|
||||
return edg
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
lab = [list(line.strip('\n')) for line in open(sys.argv[1])]
|
||||
rot90 = {(0,-1): [(-1,0),(1,0)], (1,0): [(0,-1),(0,1)], (0,1): [(1,0),(-1, 0)], (-1,0): [(0,1),(0,-1)]}
|
||||
|
||||
start = (1, len(lab)-2, (1,0))
|
||||
end = (len(lab[0])-2, 1, (0,-1))
|
||||
graph = {}
|
||||
distance = {}
|
||||
pred = {}
|
||||
for y, l in enumerate(lab):
|
||||
for x, f in enumerate(lab[y]):
|
||||
if f == '#': continue
|
||||
for d in [(0,1), (0,-1), (1,0), (-1,0)]:
|
||||
distance[(x,y,d)] = math.inf
|
||||
pred[(x,y,d)] = set([])
|
||||
graph[(x,y,d)] = []
|
||||
for d1 in rot90[d]:
|
||||
if not lab[y+d1[1]][x+d1[0]] == '#': graph[(x,y,d)].append((x,y,d1))
|
||||
if lab[y+d[1]][x+d[0]] != '#':
|
||||
graph[(x,y,d)].append((x+d[0], y+d[1], d))
|
||||
distance[start] = 0
|
||||
v1, a1 = dijkstra(graph, pred, distance)
|
||||
d1 = count_set(v1[end], lab)
|
||||
|
||||
# challenge 1
|
||||
res1 = a1[end]
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2, needed some reddit help again...
|
||||
d1.add((end[0],end[1]))
|
||||
d1.add((start[0], start[1]))
|
||||
res2 = len(d1)
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
for line in lab:
|
||||
print(''.join(line))
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
###############
|
||||
#.......#....E#
|
||||
#.#.###.#.###.#
|
||||
#.....#.#...#.#
|
||||
#.###.#####.#.#
|
||||
#.#.#.......#.#
|
||||
#.#.#####.###.#
|
||||
#...........#.#
|
||||
###.#.#####.#.#
|
||||
#...#.....#.#.#
|
||||
#.#.#.###.#.#.#
|
||||
#.....#...#.#.#
|
||||
#.###.#.#.#.#.#
|
||||
#S..#.....#...#
|
||||
###############
|
||||
@@ -0,0 +1,17 @@
|
||||
#################
|
||||
#...#...#...#..E#
|
||||
#.#.#.#.#.#.#.#.#
|
||||
#.#.#.#...#...#.#
|
||||
#.#.#.#.###.#.#.#
|
||||
#...#.#.#.....#.#
|
||||
#.#.#.#.#.#####.#
|
||||
#.#...#.#.#.....#
|
||||
#.#.#####.#.###.#
|
||||
#.#.#.......#...#
|
||||
#.#.###.#####.###
|
||||
#.#.#...#.....#.#
|
||||
#.#.#.#####.###.#
|
||||
#.#.#.........#.#
|
||||
#.#.#.#########.#
|
||||
#S#.............#
|
||||
#################
|
||||
@@ -0,0 +1,141 @@
|
||||
#############################################################################################################################################
|
||||
#...#.....#.......#...........#...#.............#.......#.........#.....................#.............#.........#.....#.......#.........#..E#
|
||||
#.#.#.#.###.#.###.#####.#.#.#.#.#.#.###.#######.#######.#.#####.###.#.#######.###.#.#.#.#.#.###.#####.###.#####.#.###.#.###.#.#######.#.#.#.#
|
||||
#.#...................#.....#...#.#.#.#.......#.........#.....#.....#.........#...#.#.#.#.#.........#.....#...#...#...#.#...#...#.....#...#.#
|
||||
###.#.#.#.#####.#####.#.#.#######.#.#.#######.#######.#######.###########.#####.#.###.#.#.#########.#######.#.#.###.#####.#####.#.###.#####.#
|
||||
#...#.#...#...#.#.#...#...#...#...#...#.....#.....#.#.#...#.............#...#...#.#...#...#.......#.....................#.#.....#...#.....#.#
|
||||
#.###.#####.#.#.#.#.###.#.###.#.#####.#.###.#####.#.#.#.#.#.#####.#.###.#####.#####.#########.#.#.#####.#.#####.#.###.#.#.#.#######.#.###.#.#
|
||||
#.....#...#.#.#.#...#...#...#.......#.#...#...#...#...#.#...#...#.#...#.......#.....#.........#...#.....#.....#.#.#...#...#.#.......#...#.#.#
|
||||
#.#####.###.#.#.#.###.#.###.#.#######.###.#.#.#.#.#####.#####.#.#.###.###.#####.#####.#############.#####.###.#.#.###.#####.###.#####.#.#.#.#
|
||||
#.......#...#...#...#...#...#.#.....#.....#...#.#.#.....#.....#...#...#...#...#.....#...#...........#.#...#.#...#...#...#.....#...#.....#...#
|
||||
#####.###.#####.###.###.#.#.###.###.#######.###.#.#.#########.#.###.#######.#.#####.###.#.###########.#.###.###.###.#.#.#####.###.#.#.#.###.#
|
||||
#...#.#...#.......#.......#.#...#...#.....#.#.#.#.#...#...#...#.#...#.....#.#.........#.#.....#.........#.....#.....#.#.....#.....#.#.#.#...#
|
||||
#.###.#.###.###.###########.#.###.#.#.#.#.#.#.#.#####.#.#.#.###.#.#.#.###.#.#########.#.#####.#.#####.###.###.#######.#####.#######.#.#.#.###
|
||||
#.....#.#.......#.......................#.#.....................#.#.#...#...#.......#.......#.#.#...#.#...#.#.#.#.........#.#.....#.#.#.#...#
|
||||
#.#####.#.#####.#.#.#.#######.#.#.#.#.#.#.#.#.###.#######.#####.#.#####.#####.###.#.#######.#.###.#.#.###.#.#.#.#.#########.#.###.###.#.###.#
|
||||
#.....#.#.....#...#.#.#.........#.#.#.#.....#...#.........#...#.#.........#...#.....#...#...#.#...#.#...#.#.#.#...#.....#...#...#...#.......#
|
||||
#######.#####.#####.#.#####.###.#.###.###.#.#.#####.#######.#.###########.#.###.#####.###.###.#.###.###.#.#.#.#####.###.#.###.#.###.#.###.###
|
||||
#.......#...#.#...#...#...#...#.#.....#...#...#...#.......#.#.#.......#...#.#.#.#...#.....#.#...#.#.#.#...#...#.....#...#.#...#.#.#...#...#.#
|
||||
#.#######.#.#.###.#####.#.#.#.#.#######.#######.#.#.#######.#.#.#####.###.#.#.#.#.#.#.#####.#.#.#.#.#.#####.###.#.###.###.#.###.#.###.#.###.#
|
||||
#...#...#.#.............#.#...#...#.....#...#...#...#.........#...#.#...#.#.#.....#.#.......#.....#.#.....#.....#...#.#...#...#.#.....#.....#
|
||||
###.#.#.#.#########.#.###.###.###.###.###.#.#.#.###.#.#######.###.#.###.###.#.###.#.#######.#######.#.###.#######.#.#.#.#######.#.#########.#
|
||||
#...#.#...#...#.......#.........#...#.#...#.#.....#...#.....#...#.#.........#.....#.............#...#...#.#.....#.#.....#.......#.........#.#
|
||||
#.#####.###.#.###############.#####.#.#.###.#####.#######.#####.#.#####################.#########.#####.#.#.#####.#####.#.#.###.#######.###.#
|
||||
#.#...#.#...#.......#.....#.......#...#...#.......#.......#.....#.#...#.....#.........#...........#.....#.#.#.....#.....#.#...#.........#...#
|
||||
#.#.#.###.#########.#.###.#.###.###.#.###.#.#######.#.#####.###.#.#.#.###.#.#.#####.#.#.#########.#.#.#.#.#.#.#####.#.#####.#.#.#####.###.###
|
||||
#...#...#.#.....#.#.#...#...#.#.......#.....#.....#.#.....#...#.....#...#.#.#.#...#.#.#.............#...#...#.#...#.#.#...#.#.......#.#...#.#
|
||||
#.#####.#.#.###.#.#.###.#####.#########.#####.###.###.#.#.###.#.#######.#.###.#.#.#.###.#############.#.#.#.#.#.###.#.#.#.#######.#.###.###.#
|
||||
#.#...#.....#.....#.....#.....#.......#.....#...#...#...#...#.#.....#...#.......#.#.#...#...#.......#.#.#.#...#.#...#...#.#.....#.#.#...#...#
|
||||
#.#.#.#.#########.###########.#.###.#######.###.###.#######.#.###.###.#############.#.#####.#.#####.###.#.#.###.#.#######.#.###.#.#.#.###.#.#
|
||||
#.#.#.#...#...#.#.....#.....#...#.#.#.....#...#.#.#.#.......#...#.#...#.........#...#.......#.#...#...#.#.#.#...#.#.....#.#.#...#.#...#...#.#
|
||||
#.#.#.#.###.#.#.#####.###.#.#.###.#.#.###.#.#.#.#.#.#.#####.###.#.#.###.#######.#.#######.###.#.#.###.#.#.#.#.#.#.#.###.#.#.#.###.#####.###.#
|
||||
#.#.#.#.#...#.#.#...#.#...#.#.#...#.....#...#.....#.#.....#.#.#.#.#.#.......#...#.......#.#...#.#...#.#.#.#.#.#...#.#...#...#...#.#.....#...#
|
||||
###.#.###.###.#.#.#.#.#.###.#.#.#.#########.#######.#.###.#.#.#.###.#######.#.#######.###.#.#####.###.#.###.#.###.#.###.#######.#.#.#######.#
|
||||
#...#.....#.#.#.#.#...#.#...#.#.#...#.......#.......#...#.....#.....#...#.....#.......#...#.#.....#...#.#...#.....#...#.........#.#...#...#.#
|
||||
#.#########.#.#.#.#####.###.#.###.#.#.#####.#.#########.#.#########.#.#.#.###.#.#######.###.#.#.###.#.#.#.#########.#.#########.#.###.#.#.#.#
|
||||
#...#.......#.#.#.#.......#.#...#.#...#.....#...........#.#...#.............#.#.#.......#.#.#.#...#...#.#.#.......#.#...#.......#.....#.#.#.#
|
||||
###.#.#####.#.#.#.#######.#.###.#.#.#####.###########.#.###.#.#.#####.#####.#.#.#.#######.#.###.#.###.#.#.###.###.#.###.#.#####.#.#####.#.#.#
|
||||
#...#.....#...#.......#...#...#...#.#...#...#...#.....#.....#.#.#...#.#...#.....#.........#...#.#...#...#.....#.#.#.#.#.#.#.#...#.#.....#.#.#
|
||||
#.#######.###########.#.#.###.###.#.#.#.###.#.#.#.#.#######.#.#.#.#.#.###.#.#######.#####.###.#.###.###.#####.#.#.#.#.#.#.#.#.#.###.#####.#.#
|
||||
#.#.......#.........#...#...#...#.#...#...#.#.#...#.#.....#.#.......#...#.#...#.....#...#.#.#.#...#...#.#.......#.#...#...#.#.#.......#...#.#
|
||||
#.#.#########.###.#.#######.###.#########.#.#.#####.#.#.#.#####.#.###.#.#.#.###.###.#.#.#.#.#.#####.#.#.#.#####.#.#######.#.#.#.#######.###.#
|
||||
#.#.#.........#...#...#.....#...#.........#.#.#.....#.#.#.....#.#...........#...#.....#.#...#.....#.#.#.#.#...#.#.#.....#...#.#.....#...#.#.#
|
||||
#.#.###.#########.###.#.#.###.###.###.#####.#.###.###.#.#####.###.#####.#.###.###.#####.#.#######.#.###.#.#.#.#.#.#.###.#####.#.###.#.###.#.#
|
||||
#.#.....#.#.........#.#.........#.#...#.....#.....#...#.....#...#.#...#.#...#.#...#.....#.#.......#...#.#...#.#.#...#...#...#.......#.#...#.#
|
||||
#.#######.#.#.#.#.###.#.#######.#.#.###.#####.#.#.#.#######.###.#.#.###.#.#.#.#.###.#######.#######.#.#.#####.#.#####.###.#.###.#####.#.###.#
|
||||
#.............#.#.#...#.#.....#...#.....#...#.#.#.#.#...#.........#.....#.#...#...#.......#...#.....#.......#.#.#...#.......#.........#.....#
|
||||
#.#.#.#.#####.#.#.#.###.#.###.#####.#####.#.#.#.#.#.#.###.#.#######.###.#.#.#####.#######.#.#.###########.#.#.#.#.#.###.###.#.#.#.#####.#####
|
||||
#.#.#.#.#...#.#.#.#.#...#.#...#.....#...#.#.#.#.#.#.#...#.......#.#.....#...#...#...#...#.#.#...........#.....#...#...#...#.#.#.#.....#.#...#
|
||||
#.#.#.#.#.#.#.#.#.#.#.###.#.###.#####.#.#.#.#.#.#.#.###.#######.#.#####.###.#.#####.###.#.#####.#######.###.#######.#.###.#.#.#.#####.#.#.#.#
|
||||
#.....#...#...#...#.#...#.#...#...#...#...#...#.#.#...#.......#.....#.....#.#.....#...#.......#.#.....#...#...#.....#.....#.#.#.#.....#...#.#
|
||||
#.#.#.#.#####.###.#.###.#.###.###.###.###.###.#.#####.#.#.###.#.###.#.###.#.###.#####.#######.#.#.###.###.#.#.#.###.#.#.#.#.#.#.#.#########.#
|
||||
#.#.#.#.#...#.....#...#.#.#.#.#.......#...#...#.#.....#.#...#.#...#.....#.......#...#.......#.#.#...#.....#.#...#...#...#.#...#...#.........#
|
||||
#.#.#.###.#.#.###.###.###.#.#.#.#######.###.###.#.#####.#.#.#.###.###.###.#######.#.#######.#.###.#.#.#####.#.#.#.#######.#####.###.#########
|
||||
#.#.#.#...#...#...#...#...#...#.#...#...#...#.....#.....#...#...#...#.#...#.......#.........#...#.#.#.#...#.#...#.......#...#.....#.#.....#.#
|
||||
#.###.#.#.###.#.###.###.###.#####.#.###.#.#######.#####.#.###.#####.###.###.###################.###.###.#.#.###########.###.#.#.#.#.#.#.#.#.#
|
||||
#...#...#...#.#.#...#.....#.......#...#.#.......#.....#.#.#...#...#.....#...#...#...........#.....#.#...#.#...........#.....#.#.#...#.#.#.#.#
|
||||
###.#####.#.#.#.#.#.#.###.###########.#.#######.#####.###.#####.#.#######.###.#.#.#####.#.#.#.###.#.#.###.###.#######.#######.#.#######.#.#.#
|
||||
#...#...#.#.#.#...#.#...#.#.......#...#...#.....#...#.....#...#.#.....#...#...#...#...#.#.#...#...#.#...#.#...#.....#.#.....#.#.........#.#.#
|
||||
#.###.#.#.#.#.###.#.###.#.#.#####.#.#####.#.#######.###.#.#.#.#.#####.#.###.#########.#.#.#####.###.#.###.#####.###.###.###.#.#.#########.#.#
|
||||
#.#...#.#.#...#.....#.#.#.#.#...#.#.......#.......#.#...#...#.....#...#.#.....#.......#.#.#...#.#.....#...#.....#.#.....#.#...#.............#
|
||||
#.#.#.#.#.###.#.#####.#.#.#.###.#.#######.#.#####.#.#.#####.#######.###.#####.#.#####.#.#.#.#.#.#######.###.#####.#######.#######.###.#.###.#
|
||||
#...#.#...#...#.#.......#.#...#.....#...#.#.....#.#.#.#...#.......#...#.....#.#.#...#.#...#.#...#.....#...#.#.#.......#.........#.#...#.....#
|
||||
#.###.###.#.#.#.#########.###.#.#####.#.#.#######.#.#.#.#.#.#####.#.#.#####.#.#.#.#.#.#.###.#####.###.###.#.#.#.###.###.#.#.###.#.#.###.#####
|
||||
#.#...#...#.#.............#...#.#.....#...#.......#.#...#...#...#.#.#.#.....#.#.#.#.#.#.....#.#...#.#.....#.#.#.#.#.....#...#.#.#.#.#.#...#.#
|
||||
#.#.###.#.#.#.###.#.#.#####.#####.#######.#.#######.#########.###.#.#.#.#####.#.#.#.###.#.###.#.#.#.#####.#.#.#.#.###.###.###.#.#.#.#.###.#.#
|
||||
#.#...#.#...#...#...#.#...#.........#...#...#.#.............#...#...#.#.#.....#...#.....#...#...#.#.....#.#.#.....#...#...#.#...#.#.#.....#.#
|
||||
#.###.#######.#.#.#.###.#.###########.#.#####.#.#########.###.#.###.#.#.###.###.#####.#####.###.#.#.###.#.#.#######.#.#.###.#.###.#.#.#####.#
|
||||
#.....#.......#...#.....#.#...........#.#...#...#.....#.#...#.#.....#.#...#...#.#...#.#...#...#.#.#...#...#.#.....#.#.#.#...#.......#.#.....#
|
||||
#.#.###.#######.#########.#.#####.#####.#.#.#.###.###.#.###.#.#######.###.###.#.#.#.#.###.###.###.###.#####.#.###.#.#.#.#.###.#.#####.#.#####
|
||||
#.#.....#.....#.#.#.....#...#...#...#...#.#.#.#...#.#...#.#.#.........#...#...#.#.#.#.#.....#.#...#.#.#.....#...#...#.#.#.....#...#...#.....#
|
||||
#.#.#######.#.#.#.#.###.###.#.#.#####.###.#.#.###.#.###.#.#.#########.#.###.###.#.#.#.#.#####.#.###.#.#.#####.#.#####.#.#####.#.#.#.#######.#
|
||||
#.#.......#.#...#.#.#.#...#.#.#...#.......#.....#.#.....#.#.....#.....#.#.....#.#.#.#...#.....#.#.....#.#...#.#...#.#.......#.#.#.#.........#
|
||||
#.#######.#.#####.#.#.###.#.#.###.#.#######.###.#.###.###.#####.#.#######.###.###.#.###.#.#####.#.#####.#.###.###.#.#.#####.###.#.#########.#
|
||||
#...#.#...#...#...#.#...#.#.#.#...#.#.....#...#.#...#.....#.....#.......#.#...#.......#.#...#...#.#.....#.......#.#.#.......#...#.#...#...#.#
|
||||
#.#.#.#.#####.#.#.#.#.###.###.#.#.#.#.###.###.#.#.#.#####.#.#.#########.#.#.###.#####.#.###.#.#####.#########.###.#.#.#.###.#.#.#.#.#.#.#.#.#
|
||||
#.#.#.#...#.....#.#.#...#.....#.#...#...#.....#.#.#...#...#.#.#.........#.....#.#.#...#.#.#.#.......#.......#.#...#.#.#.#...#.#.#.#.#.#.#...#
|
||||
###.#.###.#######.#.#.#.#######.###.###.#######.#.###.#####.###.#.###.#.#.###.#.#.#.###.#.#.#####.###.#####.###.###.#.#.###.#.#.#.#.###.#####
|
||||
#...#...#.......#...#.#.......#...#...#.........#...#.....#.....#...#.#.#...#.#...#.#.#...#.....#.#.....#.......#.....#...#.#.#...#...#...#.#
|
||||
#.#####.#######.#.###.#####.#####.###.#.#####.###.#######.#########.#.#.#####.#.###.#.#.#######.#.###.#.#########.#######.#.#.#.#.###.###.#.#
|
||||
#.#...#.......#.#...#.#...#.#...#.....#.#.........#.......#...#...#.#.#.....#...#...#...#.....#.#...#.#...#.............#.#.........#.....#.#
|
||||
#.#.#.#.###.#.#.#.#.#.#.#.#.#.#.###.###.###########.#####.#.#.#.###.#.#####.#####.###.###.###.#.###.#.###.#############.#.###.#.#.#.#.#####.#
|
||||
#.#.#.#.#...#.#.#.#.#.#.#...#.#.......#.#...........#.....#.#...#...#.#...#.....#.#.#...#.#.#...#.#.#.#...#.......#.......#...#...#.#.#...#.#
|
||||
#.#.#.#.#.#####.#.#.###.###.#.#######.#.#.#.#########.#####.#####.###.###.#####.#.#.###.#.#.#####.#.###.###.#####.#########.#####.#.#.#.#.#.#
|
||||
#...#.#.#.......#.#...#...#.#.#.....#.....#.#...#...........#.....#.#.........#...#...#.#.#...#...#.#...#...#.#...#.......#.#.#...#.#...#...#
|
||||
#.#.#.#.#.#########.#.###.###.#####.#########.#.#.#########.#.#####.#####.###########.#.#.#.#.#.#.#.#.#.#.###.#.###.#####.#.#.#.#.#.#####.#.#
|
||||
#...#...#.#.......#.#...#.#...#...#.....#.............#.....#...#.#.......#...........#.#.#.#.#.#.#...#...#...#.#...#...#.#.#.......#.......#
|
||||
#.#.###.#.###.###.#####.#.#.###.#.#.#####.###########.###.#.###.#.#.#######.###.#######.#.#.#.#.#.#####.#.#.###.#.###.#.#.#.###.#.#.#######.#
|
||||
#.#...#.#...#...#.......#...#...#.#.....#...#...#.....#...#.#.#.......#.....#.#.....#.....#.#.#.#...#.....#.....#.#...#...#...#.#.#.#.....#.#
|
||||
#.###.#.###.###.#########.###.###.#####.###.#.#.#.#.#.#.###.#.#.#.#####.#####.#####.#.###.#.#.#.###.#.#.#.#.#####.#####.#####.###.#.#.###.###
|
||||
#...............#.#.....#.#...#...#.......#...#.#.#.#.#.......#.#.#.....#.........#...#.#.#.#.#.........#.#.....#.....#.......#...#.#.#.#...#
|
||||
#.#####.#.#######.#.###.#.#.#.###.#.#.#.#.#####.#.#.#.#####.#.#.###.#####.###.#.#.#####.#.#.#####.#######.#####.#.###.#########.#.#.#.#.###.#
|
||||
#.#...#...#.....#...#.#...#.#...#.#.#.#.......#.#.#.#.#...#...#.....#...#...#.#.#.#.......#.........#...#.#.....#...#.......#...#.#.#.#.#...#
|
||||
#.#.#.#.###.#.###.###.#########.#.#.#.#.#.#####.#.###.#.#.###.#######.#####.#.#.#.#####.#.#.#########.#.#.###.#########.###.#.#.###.#.#.#.#.#
|
||||
#.#.#.#...#.#.#...#.....#.......#...#...#.#.....#...#.#.#.#.#.#.....#.#.....#.#.......#.#.#.#...#.....#.#...#...#.....#...#.#.#...#...#.#...#
|
||||
#.#.#.#.#.###.#.#####.#.###.#############.#.#####.#.#.#.#.#.#.#.###.#.#.#.###.#.#####.#.#.###.#.#.#####.###.#.#.#.###.#####.#.###.#####.###.#
|
||||
#.#.#...#...#.........#.....#.....#.....#.#.#.....#.#...#.#.#...#.....#.#.#...#.......#.#.....#...#...#.....#.#...#.#.....#.#...#.........#.#
|
||||
#.###.#.###.#.###.#.#########.###.#.#####.#.#.#####.#####.#.#.#.#######.#.#.###.#######.###########.#.#######.#####.#####.#.###.#########.#.#
|
||||
#...#.#.#...#.#...#...#.........#.#.......#.#.#...#.......#.#.#.#.....#.#.#.#.#.......#...........#.#.#.#.......#.......#.#.#...#.......#.#.#
|
||||
#.#.#.#.#.###.#####.#.#.#########.#.###.###.###.#.###.###.#.#.#.#.###.#.#.#.#.#######.#.#########.#.#.#.#.#.#####.#.###.#.#.#.###.#####.#.#.#
|
||||
#.#.#.#.#.#.......#.#.....#.......#.......#.....#.#...#...#.#.#...#...#...#.#...........#.......#.#.#...#.#.......#.#...#.#.#...#.....#.#...#
|
||||
#.#.###.#.#######.#########.#.#####.#######.#####.#.#.#.###.#.#.###.###.###.#.###########.#.#.#.#.#.#.###.###.#.###.#.###.#.###.#####.#.#####
|
||||
#.#.#...#.....#.......#.....#...#...#.......#...#...#.#.#.#...#.#.#.....#.....#.#...........#.......#.........#.#...#...#.#.#...#.....#.#...#
|
||||
#.#.#.#.#####.#######.#.#####.#.#####.#.#.###.#.#####.#.#.#.###.#.#######.###.#.#.###########.#######.#####.#.#.#.#.#.#.#.#.#.###.#######.#.#
|
||||
#.#.#.......#.....#.....#.....#.....#.#.....#.#...#...#.#...#.#.....#.#...#.....#...#.....#...#.....#.#.....#.#...#.....#...#...#.#.......#.#
|
||||
#.#.#.###.#.###.#.#######.#########.#.#######.###.#####.#.###.#####.#.#.###########.#####.#.###.###.#.#.###.#.###.#.###.#######.#.#.#######.#
|
||||
#...#.#.#.#.#...#.#...#...#.#.....#...#...#...#.#...#...#.#...#.....#.#.#...........#.....#...#.#.#...#.#...#.....#...#...#...#.#.#.#.....#.#
|
||||
#.###.#.#.###.#.#.#.#.#.###.#.###.#####.###.###.###.#.###.#.###.#####.#.#.#########.#.#####.#.#.#.#####.#.#####.#####.###.#.###.#.#.#.###.#.#
|
||||
#...#.#.#...#.#.#...#...#.....#.#.....#...#.#.....#.#.#.#.#.........#.#.......#...#...#...#.#.#.#...#...#...#...#...#.#.....#...#...#.#...#.#
|
||||
###.#.#.###.#.#.###########.###.#####.#.#.#.#.#.###.#.#.#.#########.#.#########.#.#.###.#.###.#.#.#.###.###.#.#####.#.#######.###.#####.#.#.#
|
||||
#...#.#...#...#.....#.....#.........#...#.#.#.#.......#...#.......#...#.........#.#.#...#...#.#.#.#.....#.#...#.....#.......#.#.#.#...#.#.#.#
|
||||
#.#.#.###.#####.###.###.#.#####.#########.#.###########.###.#####.###.#.#########.###.#####.#.#.#.#####.#.#####.###.#####.#.#.#.#.#.#.#.###.#
|
||||
#...#.....#...#.#.#.#...#.#.#...#.........#.#.......#.....#.#.....#...#...#...........#.......#...#...#.........#.#.....#...#.#.....#...#...#
|
||||
#.#.#####.#.#.#.#.#.#.###.#.#.###.#######.#.#.#####.#####.#.#.#####.#####.#.###.#######.#######.#.###.###########.#.###.#.###.###########.#.#
|
||||
#...#.....#.#.#.#.#...#...#.#.#...#...#.#.#.#.#...#.....#...#.#...#.#.....#.....#...#...#.......#...#.......#.......#...#.....#...#.....#.#.#
|
||||
###.###.###.#.#.#.#####.###.#.#.###.#.#.#.#.#.#.###.#.#.#####.#.#.#.#.#.#####.#.#.#.#####.#########.#.#####.#.#####.#.#########.#.#.###.#.#.#
|
||||
#.#...#.#.#.#...#.....#.#.....#.....#...#.#.....#...#.#...#.......#.#.#.#.....#.#.#.......#.#.......#.....#.#.#...#.#.#...#.....#...#.#.#.#.#
|
||||
#.#.#.#.#.#.#####.#.###.#######.#.#.#.#.#.#####.#.#.#.###.#######.#.#.###.#####.#.#########.#.###.#######.#.#.###.#.#.#.#.###.#######.#.#.#.#
|
||||
#.....#...#.....#.#.#...#.....#.#.#.#...#.......#.#.#...#...#...#.#.#.#.....#...#.......#...#.#.#.....#...#.#.....#...#.#...#.....#.......#.#
|
||||
#.#.#####.#####.#.###.###.###.#.#.#.#########.###.#.#######.#.#.#.###.#.#####.#########.#.###.#.#####.#.###.#.#.#######.###.#.###.#########.#
|
||||
#.....#...#...#.#...#.#.....#.....#.......#...#...#.........#.#.#...#.#.#.#...#.......#.#...#.......#.#...#.#.#.........#.#.#.#.#.....#.....#
|
||||
#####.###.###.#.###.#.#.###.#####.#####.###.###.#############.#####.#.#.#.#.###.#.#####.#.#.###.#####.#####.#.#####.#.###.#.#.#.#####.###.###
|
||||
#...#...#.....#.....#.#.#...#...#.....#...#.#...#.....#...........#.#.#...........#...#.#.#.....#.....#.....#.....#.#.#.....#...#...#...#...#
|
||||
#.#.###.#########.#.#.###.###.###.###.###.#.#.#####.#.#.#########.#.#.###.#######.#.#.#.#.#######.###.#.#.#.###.#.###.#.#####.###.#.#.#.###.#
|
||||
#.#...#...........#.#.#...#.......#.....#.#.#.....#.#.#...#...#.#.#.#.#...#.....#.#.#...#.......#.#...#.#.#.....#.....#.#...#.#...#.#.#.#.#.#
|
||||
#.#.###############.#.#.###.#######.###.#.#.#####.#.#####.#.#.#.#.#.#.#.#.#.###.#.#.#####.###.###.#.###.#.#.###.#######.#.#.#.#.###.###.#.#.#
|
||||
#.#.#.......#.....#...#...#.......#...#...#.......#.....#...#...#.....#.#...#...#.#.......#.#.#...#.#...#.#...#.#.....#.....#.#.............#
|
||||
#.###.###.###.###.#.#####.#######.#.#.#########.#.#.#.###.###.#.#######.#.#.#.###.#######.#.#.#.#####.###.###.###.#.#######.#.#.#########.#.#
|
||||
#...#.#.#.......#.#.#...#...#...#...#.......#...#.#.#.......#.#.#.......#.#.#.#...#...#...#...#...#.....#.#...#...#.......#.#.#.....#...#...#
|
||||
#.#.#.#.#########.#.#.#.###.#.#####.#######.#.###.#.#.#.#.#.#.#.#.#######.#.#.#.###.#.#.#########.#.#####.#.#.#.#####.#####.#.#####.#.#.#.###
|
||||
#.#.#.....#...#...................#.....#.#.#.#.#.#...#.#.#...#.#...#.....#.#.#.....#...#.......#.....#...#.#.#.#...................#.#.#...#
|
||||
#.#.#####.#.###.#.###.#######.#.#.#####.#.#.#.#.#.#.#.#.#.#.###.###.#######.#.#############.###.#######.###.#.#.###.#.#.#.#.#####.#####.###.#
|
||||
#.#.........#...#.#...#.......#.#.....#...#.#...#.#.#...#...#...#...#.......#.........#...#.#...........#...#.#.....#.#.#...#...#.#.....#...#
|
||||
#.###########.###.#.#.#.###.###.#.#.#####.#.###.#.###.###.###.###.###.#######.#######.#.#.#.#############.#####.#####.#.#####.#.#.#.#.###.###
|
||||
#...#...#.#...#...#.#.#...#.#...#.#.#.....#.#...#...#...........#.....#.......#...#...#.#.#...#...........#.....#.....#.#.....#...#.#...#.#.#
|
||||
###.#.#.#.#.###.###.#.###.#.#.###.#.#.#####.#.#####.#.###.#############.#.#.###.#.#.###.#.###.#######.#####.#####.###.#.#.###.#####.###.#.#.#
|
||||
#.#...#...#.#.#.#...#.#...#...#...#.#.....#.#...#.#.#...#...#.....#.....#.#.#...#.#.....#...#.......#.#.....#...#.#...#.#...#.#...#.#.#.#...#
|
||||
#.#####.###.#.#.#.###.#.#######.#.###.#####.###.#.#.#####.#.#.#.###.#####.#.#.###.#########.#.#####.#.#.#####.###.#.###.###.#.#.#.#.#.#.###.#
|
||||
#.....#.#...#...#.#.#...#.....#...#...#.................#.#...........................#...#.#.#.....#.#.#.....#...#.#...#...#.#.#.#.#.#.....#
|
||||
#.###.#.#.#######.#.#######.#.###.#.###.#########.#.#.#.#.#######.###.#.###.###.#####.#.#.#.#.#.#####.#.#####.#.#####.#######.#.#.#.#.#######
|
||||
#S..#...#...................#...#.....#...........#...#.........#.....#.............#...#.......#.............#...............#.#...........#
|
||||
#############################################################################################################################################
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
#############################################################################################################################################
|
||||
#...#.....#.......#...........#...#.............#.......#.........#.....................#.............#.........#.....#.......#.........#..E#
|
||||
#.#.#.#.###.#.###.#####.#.#.#.#.#.#.###.#######.#######.#.#####.###.#.#######.###.#.#.#.#.#.###.#####.###.#####.#.###.#.###.#.#######.#.#.#O#
|
||||
#.#...................#.....#...#.#.#.#.......#.........#.....#.....#.........#...#.#.#.#.#.........#.....#...#...#...#.#...#...#.....#...#O#
|
||||
###.#.#.#.#####.#####.#.#.#######.#.#.#######.#######.#######.###########.#####.#.###.#.#.#########.#######.#.#.###.#####.#####.#.###.#####O#
|
||||
#...#.#...#...#.#.#...#...#...#...#...#.....#.....#.#.#...#.............#...#...#.#...#...#.......#.....................#.#.....#...#OOOOO#O#
|
||||
#.###.#####.#.#.#.#.###.#.###.#.#####.#.###.#####.#.#.#.#.#.#####.#.###.#####.#####.#########.#.#.#####.#.#####.#.###.#.#.#.#######.#O###O#O#
|
||||
#.....#...#.#.#.#...#...#...#.......#.#...#...#...#...#.#...#...#.#...#.......#.....#.........#...#.....#.....#.#.#...#...#.#.......#O..#O#O#
|
||||
#.#####.###.#.#.#.###.#.###.#.#######.###.#.#.#.#.#####.#####.#.#.###.###.#####.#####.#############.#####.###.#.#.###.#####.###.#####O#.#O#O#
|
||||
#.......#...#...#...#...#...#.#.....#.....#...#.#.#.....#.....#...#...#...#...#.....#...#...........#.#...#.#...#...#...#.....#...#..O..#OOO#
|
||||
#####.###.#####.###.###.#.#.###.###.#######.###.#.#.#########.#.###.#######.#.#####.###.#.###########.#.###.###.###.#.#.#####.###.#.#O#.###.#
|
||||
#...#.#...#.......#.......#.#...#...#.....#.#.#.#.#...#...#...#.#...#.....#.#.........#.#.....#.........#.....#.....#.#.....#.....#.#O#.#...#
|
||||
#.###.#.###.###.###########.#.###.#.#.#.#.#.#.#.#####.#.#.#.###.#.#.#.###.#.#########.#.#####.#.#####.###.###.#######.#####.#######.#O#.#.###
|
||||
#.....#.#.......#.......................#.#.....................#.#.#...#...#.......#.......#.#.#...#.#...#.#.#.#.........#.#.....#.#O#.#...#
|
||||
#.#####.#.#####.#.#.#.#######.#.#.#.#.#.#.#.#.###.#######.#####.#.#####.#####.###.#.#######.#.###.#.#.###.#.#.#.#.#########.#.###.###O#.###.#
|
||||
#.....#.#.....#...#.#.#.........#.#.#.#.....#...#.........#...#.#.........#...#.....#...#...#.#...#.#...#.#.#.#...#.....#...#...#...#O......#
|
||||
#######.#####.#####.#.#####.###.#.###.###.#.#.#####.#######.#.###########.#.###.#####.###.###.#.###.###.#.#.#.#####.###.#.###.#.###.#O###.###
|
||||
#.......#...#.#...#...#...#...#.#.....#...#...#...#.......#.#.#.......#...#.#.#.#...#.....#.#...#.#.#.#...#...#.....#...#.#...#.#.#..O#...#.#
|
||||
#.#######.#.#.###.#####.#.#.#.#.#######.#######.#.#.#######.#.#.#####.###.#.#.#.#.#.#.#####.#.#.#.#.#.#####.###.#.###.###.#.###.#.###O#.###.#
|
||||
#...#...#.#.............#.#...#...#.....#...#...#...#.........#...#.#...#.#.#.....#.#.......#.....#.#.....#.....#...#.#...#...#.#OOOOO#.....#
|
||||
###.#.#.#.#########.#.###.###.###.###.###.#.#.#.###.#.#######.###.#.###.###.#.###.#.#######.#######.#.###.#######.#.#.#.#######.#O#########.#
|
||||
#...#.#...#...#.......#.........#...#.#...#.#.....#...#.....#...#.#.........#.....#.............#...#...#.#.....#.#.....#.......#OOOOOOO..#.#
|
||||
#.#####.###.#.###############.#####.#.#.###.#####.#######.#####.#.#####################.#########.#####.#.#.#####.#####.#.#.###.#######O###.#
|
||||
#.#...#.#...#.......#.....#.......#...#...#.......#.......#.....#.#...#.....#.........#...........#.....#.#.#.....#.....#.#...#OOOOOOOOO#...#
|
||||
#.#.#.###.#########.#.###.#.###.###.#.###.#.#######.#.#####.###.#.#.#.###.#.#.#####.#.#.#########.#.#.#.#.#.#.#####.#.#####.#.#O#####.###.###
|
||||
#...#...#.#.....#.#.#...#...#.#.......#.....#.....#.#.....#...#.....#...#.#.#.#...#.#.#.............#...#...#.#...#.#.#...#.#..OOO..#.#...#.#
|
||||
#.#####.#.#.###.#.#.###.#####.#########.#####.###.###.#.#.###.#.#######.#.###.#.#.#.###.#############.#.#.#.#.#.###.#.#.#.#######O#.###.###.#
|
||||
#.#...#.....#.....#.....#.....#.......#.....#...#...#...#...#.#.....#...#.......#.#.#...#...#.......#.#.#.#...#.#...#...#.#.....#O#.#...#OOO#
|
||||
#.#.#.#.#########.###########.#.###.#######.###.###.#######.#.###.###.#############.#.#####.#.#####.###.#.#.###.#.#######.#.###.#O#.#.###O#O#
|
||||
#.#.#.#...#...#.#.....#.....#...#.#.#.....#...#.#.#.#.......#...#.#...#.........#...#.......#.#...#...#.#.#.#...#.#.....#.#.#...#O#...#OOO#O#
|
||||
#.#.#.#.###.#.#.#####.###.#.#.###.#.#.###.#.#.#.#.#.#.#####.###.#.#.###.#######.#.#######.###.#.#.###.#.#.#.#.#.#.#.###.#.#.#.###O#####O###O#
|
||||
#.#.#.#.#...#.#.#...#.#...#.#.#...#.....#...#.....#.#.....#.#.#.#.#.#.......#...#.......#.#...#.#...#.#.#.#.#.#...#.#...#...#...#O#OOOOO#..O#
|
||||
###.#.###.###.#.#.#.#.#.###.#.#.#.#########.#######.#.###.#.#.#.###.#######.#.#######.###.#.#####.###.#.###.#.###.#.###.#######.#O#O#######O#
|
||||
#...#.....#.#.#.#.#...#.#...#.#.#...#.......#.......#...#.....#.....#...#.....#.......#...#.#.....#...#.#...#.....#...#.........#O#OOO#...#O#
|
||||
#.#########.#.#.#.#####.###.#.###.#.#.#####.#.#########.#.#########.#.#.#.###.#.#######.###.#.#.###.#.#.#.#########.#.#########.#O###O#.#.#O#
|
||||
#...#.......#.#.#.#.......#.#...#.#...#.....#...........#.#...#.............#.#.#.......#.#.#.#...#...#.#.#.......#.#...#.......#OOOOO#.#.#O#
|
||||
###.#.#####.#.#.#.#######.#.###.#.#.#####.###########.#.###.#.#.#####.#####.#.#.#.#######.#.###.#.###.#.#.###.###.#.###.#.#####.#.#####.#.#O#
|
||||
#...#.....#...#.......#...#...#...#.#...#...#...#.....#.....#.#.#...#.#...#.....#.........#...#.#...#...#.....#.#.#.#.#.#.#.#...#.#.....#.#O#
|
||||
#.#######.###########.#.#.###.###.#.#.#.###.#.#.#.#.#######.#.#.#.#.#.###.#.#######.#####.###.#.###.###.#####.#.#.#.#.#.#.#.#.#.###.#####.#O#
|
||||
#.#.......#.........#...#...#...#.#...#...#.#.#...#.#.....#.#.......#...#.#...#.....#...#.#.#.#...#...#.#.......#.#...#...#.#.#.......#...#O#
|
||||
#.#.#########.###.#.#######.###.#########.#.#.#####.#.#.#.#####.#.###.#.#.#.###.###.#.#.#.#.#.#####.#.#.#.#####.#.#######.#.#.#.#######.###O#
|
||||
#.#.#.........#...#...#.....#...#.........#.#.#.....#.#.#.....#.#...........#...#.....#.#...#.....#.#.#.#.#...#.#.#.....#...#.#.....#...#.#O#
|
||||
#.#.###.#########.###.#.#.###.###.###.#####.#.###.###.#.#####.###.#####.#.###.###.#####.#.#######.#.###.#.#.#.#.#.#.###.#####.#.###.#.###.#O#
|
||||
#.#.....#.#.........#.#.........#.#...#.....#.....#...#.....#...#.#...#.#...#.#...#.....#.#.......#...#.#...#.#.#...#...#...#.......#.#...#O#
|
||||
#.#######.#.#.#.#.###.#.#######.#.#.###.#####.#.#.#.#######.###.#.#.###.#.#.#.#.###.#######.#######.#.#.#####.#.#####.###.#.###.#####.#.###O#
|
||||
#.............#.#.#...#.#.....#...#.....#...#.#.#.#.#...#.........#.....#.#...#...#.......#...#.....#.......#.#.#...#.......#.........#OOOOO#
|
||||
#.#.#.#.#####.#.#.#.###.#.###.#####.#####.#.#.#.#.#.#.###.#.#######.###.#.#.#####.#######.#.#.###########.#.#.#.#.#.###.###.#.#.#.#####O#####
|
||||
#.#.#.#.#...#.#.#.#.#...#.#...#.....#...#.#.#.#.#.#.#...#.......#.#.....#...#...#...#...#.#.#...........#.....#...#...#...#.#.#.#.....#O#OOO#
|
||||
#.#.#.#.#.#.#.#.#.#.#.###.#.###.#####.#.#.#.#.#.#.#.###.#######.#.#####.###.#.#####.###.#.#####.#######.###.#######.#.###.#.#.#.#####.#O#O#O#
|
||||
#.....#...#...#...#.#...#.#...#...#...#...#...#.#.#...#.......#.....#.....#.#.....#...#.......#.#.....#...#...#.....#.....#.#.#.#.....#OOO#O#
|
||||
#.#.#.#.#####.###.#.###.#.###.###.###.###.###.#.#####.#.#.###.#.###.#.###.#.###.#####.#######.#.#.###.###.#.#.#.###.#.#.#.#.#.#.#.#########O#
|
||||
#.#.#.#.#...#.....#...#.#.#.#.#.......#...#...#.#.....#.#...#.#...#.....#.......#...#.......#.#.#...#.....#.#...#...#...#.#...#...#OOOOOOOOO#
|
||||
#.#.#.###.#.#.###.###.###.#.#.#.#######.###.###.#.#####.#.#.#.###.###.###.#######.#.#######.#.###.#.#.#####.#.#.#.#######.#####.###O#########
|
||||
#.#.#.#...#...#...#...#...#...#.#...#...#...#.....#.....#...#...#...#.#...#.......#.........#...#.#.#.#...#.#...#.......#...#..OOO#O#.....#.#
|
||||
#.###.#.#.###.#.###.###.###.#####.#.###.#.#######.#####.#.###.#####.###.###.###################.###.###.#.#.###########.###.#.#O#O#O#.#.#.#.#
|
||||
#...#...#...#.#.#...#.....#.......#...#.#.......#.....#.#.#...#...#.....#...#...#...........#.....#.#...#.#...........#.....#.#O#OOO#.#.#.#.#
|
||||
###.#####.#.#.#.#.#.#.###.###########.#.#######.#####.###.#####.#.#######.###.#.#.#####.#.#.#.###.#.#.###.###.#######.#######.#O#######.#.#.#
|
||||
#...#...#.#.#.#...#.#...#.#.......#...#...#.....#...#.....#...#.#.....#...#...#...#...#.#.#...#...#.#...#.#...#.....#.#.....#.#O........#.#.#
|
||||
#.###.#.#.#.#.###.#.###.#.#.#####.#.#####.#.#######.###.#.#.#.#.#####.#.###.#########.#.#.#####.###.#.###.#####.###.###.###.#.#O#########.#.#
|
||||
#.#...#.#.#...#.....#.#.#.#.#...#.#.......#.......#.#...#...#.....#...#.#.....#.......#.#.#...#.#.....#...#.....#.#.....#.#...#OOO..........#
|
||||
#.#.#.#.#.###.#.#####.#.#.#.###.#.#######.#.#####.#.#.#####.#######.###.#####.#.#####.#.#.#.#.#.#######.###.#####.#######.#######O###.#.###.#
|
||||
#...#.#...#...#.#.......#.#...#.....#...#.#.....#.#.#.#...#.......#...#.....#.#.#...#.#...#.#...#.....#...#.#.#.......#.........#O#...#.....#
|
||||
#.###.###.#.#.#.#########.###.#.#####.#.#.#######.#.#.#.#.#.#####.#.#.#####.#.#.#.#.#.#.###.#####.###.###.#.#.#.###.###.#.#.###.#O#.###.#####
|
||||
#.#...#...#.#.............#...#.#.....#...#.......#.#...#...#...#.#.#.#.....#.#.#.#.#.#.....#.#...#.#.....#.#.#.#.#.....#...#.#.#O#.#.#...#.#
|
||||
#.#.###.#.#.#.###.#.#.#####.#####.#######.#.#######.#########.###.#.#.#.#####.#.#.#.###.#.###.#.#.#.#####.#.#.#.#.###.###.###.#.#O#.#.###.#.#
|
||||
#.#...#.#...#...#...#.#...#.........#...#...#.#.............#...#...#.#.#.....#...#.....#...#...#.#.....#.#.#.....#...#...#.#...#O#.#.....#.#
|
||||
#.###.#######.#.#.#.###.#.###########.#.#####.#.#########.###.#.###.#.#.###.###.#####.#####.###.#.#.###.#.#.#######.#.#.###.#.###O#.#.#####.#
|
||||
#.....#.......#...#.....#.#...........#.#...#...#.....#.#...#.#.....#.#...#...#.#...#.#...#...#.#.#...#...#.#.....#.#.#.#...#..OOO..#.#.....#
|
||||
#.#.###.#######.#########.#.#####.#####.#.#.#.###.###.#.###.#.#######.###.###.#.#.#.#.###.###.###.###.#####.#.###.#.#.#.#.###.#O#####.#.#####
|
||||
#.#.....#.....#.#.#.....#...#...#...#...#.#.#.#...#.#...#.#.#.........#...#...#.#.#.#.#.....#.#...#.#.#.....#...#...#.#.#.....#OOO#...#.....#
|
||||
#.#.#######.#.#.#.#.###.###.#.#.#####.###.#.#.###.#.###.#.#.#########.#.###.###.#.#.#.#.#####.#.###.#.#.#####.#.#####.#.#####.#O#O#.#######.#
|
||||
#.#.......#.#...#.#.#.#...#.#.#...#.......#.....#.#.....#.#.....#.....#.#.....#.#.#.#...#.....#.#.....#.#...#.#...#.#.......#.#O#O#.........#
|
||||
#.#######.#.#####.#.#.###.#.#.###.#.#######.###.#.###.###.#####.#.#######.###.###.#.###.#.#####.#.#####.#.###.###.#.#.#####.###O#O#########.#
|
||||
#...#.#...#...#...#.#...#.#.#.#...#.#.....#...#.#...#.....#.....#.......#.#...#.......#.#...#...#.#.....#.......#.#.#.......#..O#O#...#...#.#
|
||||
#.#.#.#.#####.#.#.#.#.###.###.#.#.#.#.###.###.#.#.#.#####.#.#.#########.#.#.###.#####.#.###.#.#####.#########.###.#.#.#.###.#.#O#O#.#.#.#.#.#
|
||||
#.#.#.#...#.....#.#.#...#.....#.#...#...#.....#.#.#...#...#.#.#.........#.....#.#.#...#.#.#.#.......#.......#.#...#.#.#.#...#.#O#O#.#.#.#...#
|
||||
###.#.###.#######.#.#.#.#######.###.###.#######.#.###.#####.###.#.###.#.#.###.#.#.#.###.#.#.#####.###.#####.###.###.#.#.###.#.#O#O#.###.#####
|
||||
#...#...#.......#...#.#.......#...#...#.........#...#.....#.....#...#.#.#...#.#...#.#.#...#.....#.#.....#.......#.....#...#.#.#OOO#...#...#.#
|
||||
#.#####.#######.#.###.#####.#####.###.#.#####.###.#######.#########.#.#.#####.#.###.#.#.#######.#.###.#.#########.#######.#.#.#O#O###.###.#.#
|
||||
#.#...#.......#.#...#.#...#.#...#.....#.#.........#.......#...#...#.#.#.....#...#...#...#.....#.#...#.#...#.............#.#....OOO..#.....#.#
|
||||
#.#.#.#.###.#.#.#.#.#.#.#.#.#.#.###.###.###########.#####.#.#.#.###.#.#####.#####.###.###.###.#.###.#.###.#############.#.###.#O#O#.#.#####.#
|
||||
#.#.#.#.#...#.#.#.#.#.#.#...#.#.......#.#...........#.....#.#...#...#.#...#.....#.#.#...#.#.#...#.#.#.#...#.......#.......#...#OOO#.#.#...#.#
|
||||
#.#.#.#.#.#####.#.#.###.###.#.#######.#.#.#.#########.#####.#####.###.###.#####.#.#.###.#.#.#####.#.###.###.#####.#########.#####O#.#.#.#.#.#
|
||||
#...#.#.#.......#.#...#...#.#.#.....#.....#.#...#...........#.....#.#.........#...#...#.#.#...#...#.#...#...#.#...#.......#.#.#..O#.#...#...#
|
||||
#.#.#.#.#.#########.#.###.###.#####.#########.#.#.#########.#.#####.#####.###########.#.#.#.#.#.#.#.#.#.#.###.#.###.#####.#.#.#.#O#.#####.#.#
|
||||
#...#...#.#.......#.#...#.#...#...#.....#.............#.....#...#.#.......#...........#.#.#.#.#.#.#...#...#...#.#...#...#.#.#....O..#.......#
|
||||
#.#.###.#.###.###.#####.#.#.###.#.#.#####.###########.###.#.###.#.#.#######.###.#######.#.#.#.#.#.#####.#.#.###.#.###.#.#.#.###.#O#.#######.#
|
||||
#.#...#.#...#...#.......#...#...#.#.....#...#...#.....#...#.#.#.......#.....#.#.....#.....#.#.#.#...#.....#.....#.#...#...#...#.#O#.#.....#.#
|
||||
#.###.#.###.###.#########.###.###.#####.###.#.#.#.#.#.#.###.#.#.#.#####.#####.#####.#.###.#.#.#.###.#.#.#.#.#####.#####.#####.###O#.#.###.###
|
||||
#...............#.#.....#.#...#...#.......#...#.#.#.#.#.......#.#.#.....#.........#...#.#.#.#.#.........#.#.....#.....#.......#OOO#.#.#.#...#
|
||||
#.#####.#.#######.#.###.#.#.#.###.#.#.#.#.#####.#.#.#.#####.#.#.###.#####.###.#.#.#####.#.#.#####.#######.#####.#.###.#########O#.#.#.#.###.#
|
||||
#.#...#...#.....#...#.#...#.#...#.#.#.#.......#.#.#.#.#...#...#.....#...#...#.#.#.#.......#.........#...#.#.....#...#.......#OOO#.#.#.#.#...#
|
||||
#.#.#.#.###.#.###.###.#########.#.#.#.#.#.#####.#.###.#.#.###.#######.#####.#.#.#.#####.#.#.#########.#.#.###.#########.###.#O#.###.#.#.#.#.#
|
||||
#.#.#.#...#.#.#...#.....#.......#...#...#.#.....#...#.#.#.#.#.#.....#.#.....#.#.......#.#.#.#...#.....#.#...#...#.....#...#.#O#...#...#.#...#
|
||||
#.#.#.#.#.###.#.#####.#.###.#############.#.#####.#.#.#.#.#.#.#.###.#.#.#.###.#.#####.#.#.###.#.#.#####.###.#.#.#.###.#####.#O###.#####.###.#
|
||||
#.#.#...#...#.........#.....#.....#.....#.#.#.....#.#...#.#.#...#.....#.#.#...#.......#.#.....#...#OOO#.....#.#...#.#.....#.#OOO#.........#.#
|
||||
#.###.#.###.#.###.#.#########.###.#.#####.#.#.#####.#####.#.#.#.#######.#.#.###.#######.###########O#O#######.#####.#####.#.###O#########.#.#
|
||||
#...#.#.#...#.#...#...#.........#.#.......#.#.#...#.......#.#.#.#.....#.#.#.#.#.......#...........#O#O#.#.......#OOO....#.#.#OOO#.......#.#.#
|
||||
#.#.#.#.#.###.#####.#.#.#########.#.###.###.###.#.###.###.#.#.#.#.###.#.#.#.#.#######.#.#########.#O#O#.#.#.#####O#O###.#.#.#O###.#####.#.#.#
|
||||
#.#.#.#.#.#.......#.#.....#.......#.......#.....#.#...#...#.#.#...#...#...#.#...........#.......#.#O#O..#.#..OOOOO#O#...#.#.#OOO#.....#.#...#
|
||||
#.#.###.#.#######.#########.#.#####.#######.#####.#.#.#.###.#.#.###.###.###.#.###########.#.#.#.#.#O#O###.###O#.###O#.###.#.###O#####.#.#####
|
||||
#.#.#...#.....#.......#.....#...#...#.......#...#...#.#.#.#...#.#.#.....#.....#.#...........#OOOOOOO#OOOOOOOOO#.#OOO#...#.#.#OOO#.....#.#...#
|
||||
#.#.#.#.#####.#######.#.#####.#.#####.#.#.###.#.#####.#.#.#.###.#.#######.###.#.#.###########O#######.#####.#O#.#O#O#.#.#.#.#O###.#######.#.#
|
||||
#.#.#.......#.....#.....#.....#.....#.#.....#.#...#...#.#...#.#.....#.#...#.....#...#.....#OOO#.....#.#.....#O#..O#O....#...#OOO#.#.......#.#
|
||||
#.#.#.###.#.###.#.#######.#########.#.#######.###.#####.#.###.#####.#.#.###########.#####.#O###.###.#.#.###.#O###O#O###.#######O#.#.#######.#
|
||||
#...#.#.#.#.#...#.#...#...#.#.....#...#...#...#.#...#...#.#...#.....#.#.#...........#.....#OOO#.#.#...#.#...#OOOOO#OOO#...#...#O#.#.#.....#.#
|
||||
#.###.#.#.###.#.#.#.#.#.###.#.###.#####.###.###.###.#.###.#.###.#####.#.#.#########.#.#####.#O#.#.#####.#.#####.#####O###.#.###O#.#.#.###.#.#
|
||||
#...#.#.#...#.#.#...#...#.....#.#.....#...#.#.....#.#.#.#.#.........#.#.......#OOO#...#OOO#.#O#.#...#...#...#...#...#O#.....#OOO#...#.#...#.#
|
||||
###.#.#.###.#.#.###########.###.#####.#.#.#.#.#.###.#.#.#.#########.#.#########O#O#.###O#O###O#.#.#.###.###.#.#####.#O#######O###.#####.#.#.#
|
||||
#...#.#...#...#.....#.....#.........#...#.#.#.#.......#...#.......#...#OOOOOOOOO#O#.#OOO#OOO#O#.#.#.....#.#...#.....#OOOOO..#O#.#.#...#.#.#.#
|
||||
#.#.#.###.#####.###.###.#.#####.#########.#.###########.###.#####.###.#O#########O###O#####O#O#.#.#####.#.#####.###.#####O#.#O#.#.#.#.#.###.#
|
||||
#...#.....#...#.#.#.#...#.#.#...#.........#.#.......#.....#.#.....#...#OOO#......OOOOO#....OOO#...#...#.........#.#.....#O..#O#.....#...#...#
|
||||
#.#.#####.#.#.#.#.#.#.###.#.#.###.#######.#.#.#####.#####.#.#.#####.#####O#.###.#######.#######.#.###.###########.#.###.#O###O###########.#.#
|
||||
#...#.....#.#.#.#.#...#...#.#.#...#...#.#.#.#.#...#.....#...#.#...#.#OOOOO#.....#...#...#.......#...#.......#.......#...#OOOOO#...#.....#.#.#
|
||||
###.###.###.#.#.#.#####.###.#.#.###.#.#.#.#.#.#.###.#.#.#####.#.#.#.#O#.#####.#.#.#.#####.#########.#.#####.#.#####.#.#########.#.#.###.#.#.#
|
||||
#.#...#.#.#.#...#.....#.#.....#.....#...#.#.....#...#.#...#.......#.#O#.#.....#.#.#.......#.#.......#.....#.#.#...#.#.#...#.....#...#.#.#.#.#
|
||||
#.#.#.#.#.#.#####.#.###.#######.#.#.#.#.#.#####.#.#.#.###.#######.#.#O###.#####.#.#########.#.###.#######.#.#.###.#.#.#.#.###.#######.#.#.#.#
|
||||
#.....#...#.....#.#.#...#.....#.#.#.#...#.......#.#.#...#...#...#.#.#O#.....#...#.......#...#.#.#.....#...#.#.....#...#.#...#.....#.......#.#
|
||||
#.#.#####.#####.#.###.###.###.#.#.#.#########.###.#.#######.#.#.#.###O#.#####.#########.#.###.#.#####.#.###.#.#.#######.###.#.###.#########.#
|
||||
#.....#...#...#.#...#.#.....#.....#.......#...#...#.........#.#.#...#O#.#.#...#.......#.#...#.......#.#...#.#.#.........#.#.#.#.#.....#.....#
|
||||
#####.###.###.#.###.#.#.###.#####.#####.###.###.#############.#####.#O#.#.#.###.#.#####.#.#.###.#####.#####.#.#####.#.###.#.#.#.#####.###.###
|
||||
#...#...#.....#.....#.#.#...#...#.....#...#.#...#.....#OOOOOOOOOOO#.#O#...........#...#.#.#.....#.....#.....#.....#.#.#.....#...#...#...#...#
|
||||
#.#.###.#########.#.#.###.###.###.###.###.#.#.#####.#.#O#########O#.#O###.#######.#.#.#.#.#######.###.#.#.#.###.#.###.#.#####.###.#.#.#.###.#
|
||||
#.#...#...........#.#.#...#.......#.....#.#.#.....#.#.#OOO#...#.#O#.#O#...#.....#.#.#...#.......#.#...#.#.#.....#.....#.#...#.#...#.#.#.#.#.#
|
||||
#.#.###############.#.#.###.#######.###.#.#.#####.#.#####O#.#.#.#O#.#O#.#.#.###.#.#.#####.###.###.#.###.#.#.###.#######.#.#.#.#.###.###.#.#.#
|
||||
#.#.#OOOOO..#OOOOO#...#...#.......#OOO#...#.......#.....#O..#...#OOOOO#.#...#...#.#.......#.#.#...#.#...#.#...#.#.....#.....#.#.............#
|
||||
#.###O###O###O###O#.#####.#######.#O#O#########.#.#.#.###O###.#.#######.#.#.#.###.#######.#.#.#.#####.###.###.###.#.#######.#.#.#########.#.#
|
||||
#OOO#O#.#OOOOO..#O#.#...#...#...#..O#OOOOOOO#...#.#.#....O..#.#.#.......#.#.#.#...#...#...#...#...#.....#.#...#...#.......#.#.#.....#...#...#
|
||||
#O#O#O#.#########O#.#.#.###.#.#####O#######O#.###.#.#.#.#O#.#.#.#.#######.#.#.#.###.#.#.#########.#.#####.#.#.#.#####.#####.#.#####.#.#.#.###
|
||||
#O#O#OOOOO#...#..OOOOOOOOOOOOOOOOO#OOOOO#.#O#.#.#.#...#.#O#...#.#...#.....#.#.#.....#...#.......#.....#...#.#.#.#...................#.#.#...#
|
||||
#O#O#####O#.###.#.###.#######.#.#O#####O#.#O#.#.#.#.#.#.#O#.###.###.#######.#.#############.###.#######.###.#.#.###.#.#.#.#.#####.#####.###.#
|
||||
#O#OOOOOOO..#...#.#...#.......#.#O....#OOO#O#...#.#.#...#O..#...#...#.......#.........#...#.#...........#...#.#.....#.#.#...#...#.#.....#...#
|
||||
#O###########.###.#.#.#.###.###.#O#.#####O#O###.#.###.###O###.###.###.#######.#######.#.#.#.#############.#####.#####.#.#####.#.#.#.#.###.###
|
||||
#OOO#OOO#.#...#...#.#.#...#.#...#O#.#OOOOO#O#...#...#....O......#.....#.......#...#...#.#.#...#...........#.....#.....#.#.....#...#.#...#.#.#
|
||||
###O#O#O#.#.###.###.#.###.#.#.###O#.#O#####O#.#####.#.###O#############.#.#.###.#.#.###.#.###.#######.#####.#####.###.#.#.###.#####.###.#.#.#
|
||||
#.#OOO#O..#.#.#.#...#.#...#...#..O#.#O....#O#...#.#.#...#O..#.....#.....#.#.#...#.#.....#...#.......#.#.....#...#.#...#.#...#.#...#.#.#.#...#
|
||||
#.#####O###.#.#.#.###.#.#######.#O###O#####O###.#.#.#####O#.#.#.###.#####.#.#.###.#########.#.#####.#.#.#####.###.#.###.###.#.#.#.#.#.#.###.#
|
||||
#OOOOO#O#...#...#.#.#...#.....#..O#OOO#....OOOOOOOOOOOOO#O#...........................#...#.#.#.....#.#.#.....#...#.#...#...#.#.#.#.#.#.....#
|
||||
#O###O#O#.#######.#.#######.#.###O#O###.#########.#.#.#O#O#######.###.#.###.###.#####.#.#.#.#.#.#####.#.#####.#.#####.#######.#.#.#.#.#######
|
||||
#O..#OOO#...................#...#OOO..#...........#...#OOO......#.....#.............#...#.......#.............#...............#.#...........#
|
||||
#############################################################################################################################################
|
||||
@@ -0,0 +1,79 @@
|
||||
from collections import namedtuple
|
||||
from math import sqrt
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
Point = namedtuple('Point', ['y', 'x'])
|
||||
Node = namedtuple('Node', ['p', 'd'])
|
||||
|
||||
# set up inputs
|
||||
text = Path('input').read_text('utf-8')
|
||||
board_lines = text.splitlines()
|
||||
width = len(board_lines[0])
|
||||
board = list(map(list, board_lines))
|
||||
start, end = Point(*divmod(text.find('S'), width + 1)), Point(*divmod(text.find('E'), width + 1))
|
||||
|
||||
# simple cost heuristic based on distance to end node
|
||||
def cost_heuristic(p: Point) -> float:
|
||||
return sqrt((p.x - end.x) ** 2 + (p.y - end.y) ** 2)
|
||||
|
||||
# walks path backwards, scans for nodes with incoming paths of equal cost, and traverses all recursively
|
||||
def equal_cost_backtrace(parent: dict, node_cost: dict, current: Node) -> set[Point]:
|
||||
last_direction = current.d
|
||||
|
||||
trace = {current.p}
|
||||
while current := parent.get(current):
|
||||
trace.add(current.p)
|
||||
for d in map(lambda o: (current.d + o) & 3, [1, -1]):
|
||||
test = Node(current.p, d)
|
||||
if last_direction != current.d and (node_cost.get(test, 0) - node_cost[current]) == 1000:
|
||||
trace.update(equal_cost_backtrace(parent, node_cost, parent.get(test)))
|
||||
|
||||
last_direction = current.d
|
||||
|
||||
return trace
|
||||
|
||||
# simple A star
|
||||
def a_star() -> tuple[int, int]:
|
||||
t_start = Node(start, 0)
|
||||
|
||||
pending: set[Node] = {t_start}
|
||||
parent: dict[Node, Node] = {}
|
||||
node_cost: dict[Node, float] = {t_start: 0.0}
|
||||
total_cost: dict[Node, float] = {t_start: cost_heuristic(t_start.p)}
|
||||
|
||||
while len(pending):
|
||||
current = min(pending, key=lambda t: total_cost[t])
|
||||
|
||||
if current.p == end:
|
||||
return int(node_cost[current]), len(equal_cost_backtrace(parent, node_cost, current))
|
||||
|
||||
pending.remove(current)
|
||||
|
||||
# scan in all directions
|
||||
for i, vector in enumerate([(0, 1), (1, 0), (0, -1), (-1, 0)]):
|
||||
neighbor = Node(Point(current.p.y + vector[0], current.p.x + vector[1]), i)
|
||||
if board[neighbor.p.y][neighbor.p.x] == '#':
|
||||
continue
|
||||
|
||||
# assign new cost based on rotation and step
|
||||
new_cost = node_cost[current] + [0, 1000, 2000, 1000][(i - current.d) & 3] + 1
|
||||
if new_cost >= node_cost.get(neighbor, 1e13):
|
||||
continue
|
||||
|
||||
parent[neighbor] = current
|
||||
node_cost[neighbor] = new_cost
|
||||
total_cost[neighbor] = new_cost + cost_heuristic(neighbor.p)
|
||||
|
||||
if neighbor in pending:
|
||||
continue
|
||||
|
||||
pending.add(neighbor)
|
||||
|
||||
return 0, 0
|
||||
|
||||
|
||||
lowest_cost, nodes = a_star()
|
||||
|
||||
print("Part 1:", lowest_cost)
|
||||
print("Part 2:", nodes)
|
||||
Binary file not shown.
@@ -0,0 +1,82 @@
|
||||
--- Day 17: Chronospatial Computer ---
|
||||
|
||||
The Historians push the button on their strange device, but this time, you all just feel like you're falling.
|
||||
|
||||
"Situation critical", the device announces in a familiar voice. "Bootstrapping process failed. Initializing debugger...."
|
||||
|
||||
The small handheld device suddenly unfolds into an entire computer! The Historians look around nervously before one of them tosses it to you.
|
||||
|
||||
This seems to be a 3-bit computer: its program is a list of 3-bit numbers (0 through 7), like 0,1,2,3. The computer also has three registers named A, B, and C, but these registers aren't limited to 3 bits and can instead hold any integer.
|
||||
|
||||
The computer knows eight instructions, each identified by a 3-bit number (called the instruction's opcode). Each instruction also reads the 3-bit number after it as an input; this is called its operand.
|
||||
|
||||
A number called the instruction pointer identifies the position in the program from which the next opcode will be read; it starts at 0, pointing at the first 3-bit number in the program. Except for jump instructions, the instruction pointer increases by 2 after each instruction is processed (to move past the instruction's opcode and its operand). If the computer tries to read an opcode past the end of the program, it instead halts.
|
||||
|
||||
So, the program 0,1,2,3 would run the instruction whose opcode is 0 and pass it the operand 1, then run the instruction having opcode 2 and pass it the operand 3, then halt.
|
||||
|
||||
There are two types of operands; each instruction specifies the type of its operand. The value of a literal operand is the operand itself. For example, the value of the literal operand 7 is the number 7. The value of a combo operand can be found as follows:
|
||||
|
||||
Combo operands 0 through 3 represent literal values 0 through 3.
|
||||
Combo operand 4 represents the value of register A.
|
||||
Combo operand 5 represents the value of register B.
|
||||
Combo operand 6 represents the value of register C.
|
||||
Combo operand 7 is reserved and will not appear in valid programs.
|
||||
|
||||
The eight instructions are as follows:
|
||||
|
||||
The adv instruction (opcode 0) performs division. The numerator is the value in the A register. The denominator is found by raising 2 to the power of the instruction's combo operand. (So, an operand of 2 would divide A by 4 (2^2); an operand of 5 would divide A by 2^B.) The result of the division operation is truncated to an integer and then written to the A register.
|
||||
|
||||
The bxl instruction (opcode 1) calculates the bitwise XOR of register B and the instruction's literal operand, then stores the result in register B.
|
||||
|
||||
The bst instruction (opcode 2) calculates the value of its combo operand modulo 8 (thereby keeping only its lowest 3 bits), then writes that value to the B register.
|
||||
|
||||
The jnz instruction (opcode 3) does nothing if the A register is 0. However, if the A register is not zero, it jumps by setting the instruction pointer to the value of its literal operand; if this instruction jumps, the instruction pointer is not increased by 2 after this instruction.
|
||||
|
||||
The bxc instruction (opcode 4) calculates the bitwise XOR of register B and register C, then stores the result in register B. (For legacy reasons, this instruction reads an operand but ignores it.)
|
||||
|
||||
The out instruction (opcode 5) calculates the value of its combo operand modulo 8, then outputs that value. (If a program outputs multiple values, they are separated by commas.)
|
||||
|
||||
The bdv instruction (opcode 6) works exactly like the adv instruction except that the result is stored in the B register. (The numerator is still read from the A register.)
|
||||
|
||||
The cdv instruction (opcode 7) works exactly like the adv instruction except that the result is stored in the C register. (The numerator is still read from the A register.)
|
||||
|
||||
Here are some examples of instruction operation:
|
||||
|
||||
If register C contains 9, the program 2,6 would set register B to 1.
|
||||
If register A contains 10, the program 5,0,5,1,5,4 would output 0,1,2.
|
||||
If register A contains 2024, the program 0,1,5,4,3,0 would output 4,2,5,6,7,7,7,7,3,1,0 and leave 0 in register A.
|
||||
If register B contains 29, the program 1,7 would set register B to 26.
|
||||
If register B contains 2024 and register C contains 43690, the program 4,0 would set register B to 44354.
|
||||
|
||||
The Historians' strange device has finished initializing its debugger and is displaying some information about the program it is trying to run (your puzzle input). For example:
|
||||
|
||||
Register A: 729
|
||||
Register B: 0
|
||||
Register C: 0
|
||||
|
||||
Program: 0,1,5,4,3,0
|
||||
|
||||
Your first task is to determine what the program is trying to output. To do this, initialize the registers to the given values, then run the given program, collecting any output produced by out instructions. (Always join the values produced by out instructions with commas.) After the above program halts, its final output will be 4,6,3,5,6,3,5,2,1,0.
|
||||
|
||||
Using the information provided by the debugger, initialize the registers to the given values, then run the program. Once it halts, what do you get if you use commas to join the values it output into a single string?
|
||||
|
||||
Your puzzle answer was 7,1,5,2,4,0,7,6,1.
|
||||
--- Part Two ---
|
||||
|
||||
Digging deeper in the device's manual, you discover the problem: this program is supposed to output another copy of the program! Unfortunately, the value in register A seems to have been corrupted. You'll need to find a new value to which you can initialize register A so that the program's output instructions produce an exact copy of the program itself.
|
||||
|
||||
For example:
|
||||
|
||||
Register A: 2024
|
||||
Register B: 0
|
||||
Register C: 0
|
||||
|
||||
Program: 0,3,5,4,3,0
|
||||
|
||||
This program outputs a copy of itself if register A is instead initialized to 117440. (The original initial value of register A, 2024, is ignored.)
|
||||
|
||||
What is the lowest positive initial value for register A that causes the program to output a copy of itself?
|
||||
|
||||
Your puzzle answer was 37222273957364.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+79
@@ -0,0 +1,79 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys, re, math
|
||||
|
||||
|
||||
out = []
|
||||
|
||||
|
||||
def output(i):
|
||||
out.append(i)
|
||||
|
||||
|
||||
def instr(opc, op, ra, rb, rc, p):
|
||||
cop = op
|
||||
if op in [4,5,6]: cop = [ra,rb,rc][op-4]
|
||||
if op == 7: cop = 'ERROR'
|
||||
if opc == 0: # 'adv' instruction
|
||||
ra = math.trunc(ra / 2**cop)
|
||||
p += 2
|
||||
elif opc == 1: # 'bxl' instruction
|
||||
rb = rb ^ op
|
||||
p += 2
|
||||
elif opc == 2: # 'bst' instruction
|
||||
rb = cop % 8
|
||||
p += 2
|
||||
elif opc == 3: # 'jnz' instruction
|
||||
if ra != 0:
|
||||
p = op
|
||||
else:
|
||||
p += 2
|
||||
elif opc == 4: # 'bxc' instruction
|
||||
rb = rb ^ rc
|
||||
p += 2
|
||||
elif opc == 5: # 'out' instruction
|
||||
output(cop % 8)
|
||||
p += 2
|
||||
elif opc == 6: # 'bdv' instruction
|
||||
rb = math.trunc(ra / 2**cop)
|
||||
p += 2
|
||||
elif opc == 7: # 'cdv' instruction
|
||||
rc = math.trunc(ra / 2**cop)
|
||||
p += 2
|
||||
return ra, rb, rc, p
|
||||
|
||||
|
||||
def step(lb, ub, i, exp):
|
||||
for ra in range(lb, ub):
|
||||
if (((ra//8**i)%8) ^ 1 ^ int((ra//8**i) / 2**((ra//8** i%8)^2)) % 8) == exp: yield ra
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
ins = open(sys.argv[1]).read()
|
||||
g = re.search(r'Register A: (?P<ra>\d+)\nRegister B: (?P<rb>\d+)\nRegister C: (?P<rc>\d+)\n\nProgram: (?P<prog>(\d+,?)*)', ins)
|
||||
ra, rb, rc = int(g['ra']), int(g['rb']), int(g['rc'])
|
||||
prog = [int(p) for p in g['prog'].split(',')]
|
||||
pointer = 0
|
||||
while True:
|
||||
if pointer >= len(prog): break
|
||||
ra, rb, rc, pointer = instr(prog[pointer], prog[pointer+1], ra, rb, rc, pointer)
|
||||
|
||||
possible_bounds = [(0,8)]
|
||||
for i in range(15,-1,-1):
|
||||
exp = prog[i]
|
||||
possible_x = []
|
||||
for lb, ub in possible_bounds:
|
||||
possible_x += [i for i in step(lb, ub, 0, exp)]
|
||||
possible_bounds = [(x*8,(x+1)*8) for x in possible_x]
|
||||
ra = min(possible_x)
|
||||
|
||||
|
||||
|
||||
# challenge 1
|
||||
res1 = ','.join([str(o) for o in out])
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
res2 = ra
|
||||
print(f"challenge 2 (only works for my input):\n{res2}")
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
Register A: 2024
|
||||
Register B: 0
|
||||
Register C: 0
|
||||
|
||||
Program: 0,1,5,4,3,0
|
||||
@@ -0,0 +1,5 @@
|
||||
Register A: 117440
|
||||
Register B: 0
|
||||
Register C: 0
|
||||
|
||||
Program: 0,3,5,4,3,0
|
||||
@@ -0,0 +1,5 @@
|
||||
Register A: 729
|
||||
Register B: 0
|
||||
Register C: 0
|
||||
|
||||
Program: 0,1,5,4,3,0
|
||||
@@ -0,0 +1,5 @@
|
||||
Register A: 0
|
||||
Register B: 2024
|
||||
Register C: 43690
|
||||
|
||||
Program: 4,0
|
||||
@@ -0,0 +1,20 @@
|
||||
Register A: 48744869
|
||||
Register B: 0
|
||||
Register C: 0
|
||||
|
||||
Program: 2,4,1,2,7,5,1,3,4,4,5,5,0,3,3,0
|
||||
|
||||
bst ra (rb = ra % 8)
|
||||
bxl 2 (rb = rb ^ 2)
|
||||
cdv rb (rc = int(ra / 2**rb))
|
||||
bxl 3 (rb = rb ^ 3)
|
||||
bxc _ (rb = rb ^ rc)
|
||||
out rb (print rb % 8)
|
||||
adv 3 (ra = int(ra / 8))
|
||||
jnz 0 (loop if ra != 0)
|
||||
|
||||
print rb%8 = rb^rc % 8 = rb ^ 3 ^ rc % 8 = rb ^ 3 ^ int(ra / 2^rb) % 8 = rb ^ 2 ^ 3 ^ int(ra / 2**(rb^2)) % 8 =
|
||||
(ra%8) ^ 2 ^ 3 ^ int(ra / 2**((ra%8)^2)) % 8 = 2
|
||||
((ra//8**1)%8) ^ 2 ^ 3 ^ int((ra//8**1) / 2**((ra%8**1)^2)) % 8 = 4
|
||||
-> must loop 16 times, so ra must be around 8^15 to 8^16?
|
||||
prints out
|
||||
@@ -0,0 +1,98 @@
|
||||
--- Day 18: RAM Run ---
|
||||
|
||||
You and The Historians look a lot more pixelated than you remember. You're inside a computer at the North Pole!
|
||||
|
||||
Just as you're about to check out your surroundings, a program runs up to you. "This region of memory isn't safe! The User misunderstood what a pushdown automaton is and their algorithm is pushing whole bytes down on top of us! Run!"
|
||||
|
||||
The algorithm is fast - it's going to cause a byte to fall into your memory space once every nanosecond! Fortunately, you're faster, and by quickly scanning the algorithm, you create a list of which bytes will fall (your puzzle input) in the order they'll land in your memory space.
|
||||
|
||||
Your memory space is a two-dimensional grid with coordinates that range from 0 to 70 both horizontally and vertically. However, for the sake of example, suppose you're on a smaller grid with coordinates that range from 0 to 6 and the following list of incoming byte positions:
|
||||
|
||||
5,4
|
||||
4,2
|
||||
4,5
|
||||
3,0
|
||||
2,1
|
||||
6,3
|
||||
2,4
|
||||
1,5
|
||||
0,6
|
||||
3,3
|
||||
2,6
|
||||
5,1
|
||||
1,2
|
||||
5,5
|
||||
2,5
|
||||
6,5
|
||||
1,4
|
||||
0,4
|
||||
6,4
|
||||
1,1
|
||||
6,1
|
||||
1,0
|
||||
0,5
|
||||
1,6
|
||||
2,0
|
||||
|
||||
Each byte position is given as an X,Y coordinate, where X is the distance from the left edge of your memory space and Y is the distance from the top edge of your memory space.
|
||||
|
||||
You and The Historians are currently in the top left corner of the memory space (at 0,0) and need to reach the exit in the bottom right corner (at 70,70 in your memory space, but at 6,6 in this example). You'll need to simulate the falling bytes to plan out where it will be safe to run; for now, simulate just the first few bytes falling into your memory space.
|
||||
|
||||
As bytes fall into your memory space, they make that coordinate corrupted. Corrupted memory coordinates cannot be entered by you or The Historians, so you'll need to plan your route carefully. You also cannot leave the boundaries of the memory space; your only hope is to reach the exit.
|
||||
|
||||
In the above example, if you were to draw the memory space after the first 12 bytes have fallen (using . for safe and # for corrupted), it would look like this:
|
||||
|
||||
...#...
|
||||
..#..#.
|
||||
....#..
|
||||
...#..#
|
||||
..#..#.
|
||||
.#..#..
|
||||
#.#....
|
||||
|
||||
You can take steps up, down, left, or right. After just 12 bytes have corrupted locations in your memory space, the shortest path from the top left corner to the exit would take 22 steps. Here (marked with O) is one such path:
|
||||
|
||||
OO.#OOO
|
||||
.O#OO#O
|
||||
.OOO#OO
|
||||
...#OO#
|
||||
..#OO#.
|
||||
.#.O#..
|
||||
#.#OOOO
|
||||
|
||||
Simulate the first kilobyte (1024 bytes) falling onto your memory space. Afterward, what is the minimum number of steps needed to reach the exit?
|
||||
|
||||
Your puzzle answer was 446.
|
||||
--- Part Two ---
|
||||
|
||||
The Historians aren't as used to moving around in this pixelated universe as you are. You're afraid they're not going to be fast enough to make it to the exit before the path is completely blocked.
|
||||
|
||||
To determine how fast everyone needs to go, you need to determine the first byte that will cut off the path to the exit.
|
||||
|
||||
In the above example, after the byte at 1,1 falls, there is still a path to the exit:
|
||||
|
||||
O..#OOO
|
||||
O##OO#O
|
||||
O#OO#OO
|
||||
OOO#OO#
|
||||
###OO##
|
||||
.##O###
|
||||
#.#OOOO
|
||||
|
||||
However, after adding the very next byte (at 6,1), there is no longer a path to the exit:
|
||||
|
||||
...#...
|
||||
.##..##
|
||||
.#..#..
|
||||
...#..#
|
||||
###..##
|
||||
.##.###
|
||||
#.#....
|
||||
|
||||
So, in this example, the coordinates of the first byte that prevents the exit from being reachable are 6,1.
|
||||
|
||||
Simulate more of the bytes that are about to corrupt your memory space. What are the coordinates of the first byte that will prevent the exit from being reachable from your starting position? (Provide the answer as two integers separated by a comma with no other characters.)
|
||||
|
||||
Your puzzle answer was 39,40.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+80
@@ -0,0 +1,80 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
from copy import deepcopy
|
||||
|
||||
|
||||
def dijkstra(graph, s):
|
||||
a = {}
|
||||
v = {}
|
||||
Q = initG(graph, s, a, v)
|
||||
lq = len(Q)
|
||||
while len(Q) > 0:
|
||||
u = min([u for u in Q], key=lambda x: a[x])
|
||||
Q.remove(u)
|
||||
for vo in nb(*u):
|
||||
if vo in Q:
|
||||
distance_update(graph, u,vo,a,v)
|
||||
return v
|
||||
|
||||
def initG(graph, s, a, v):
|
||||
for vo in graph.keys():
|
||||
a[vo] = 9999999999999999
|
||||
v[vo] = 'null'
|
||||
a[s] = 0
|
||||
Q = [n for n in graph.keys()]
|
||||
return Q
|
||||
|
||||
def distance_update(g, u,vo,a,v):
|
||||
alt = a[u] + g[u]
|
||||
if alt < a[vo]:
|
||||
a[vo] = alt
|
||||
v[vo] = u
|
||||
|
||||
def shortest_path(g, d, v):
|
||||
w = [d]
|
||||
u = d
|
||||
r = 0
|
||||
while v[u] != 'null':
|
||||
r += g[u]
|
||||
u = v[u]
|
||||
w.append(u)
|
||||
return w.reverse(), r
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
size = 71 # 7 for example, 71 for real input
|
||||
pos = (0,0)
|
||||
end = (70,70) # 6,6 for example, 70,70 for real input
|
||||
blocks = [(int(l) for l in line.strip('\n').split(',')) for line in open(sys.argv[1])]
|
||||
|
||||
def nb(sx, sy):
|
||||
n = [(0,1), (1,0), (0,-1), (-1,0)]
|
||||
return [(min(size,max(0,sx+x)), min(size,max(0,sy+y))) for x,y in n]
|
||||
|
||||
g1 = {(x,y) : 1 for x in range(size) for y in range(size)}
|
||||
|
||||
for x,y in blocks[:1024]:
|
||||
g1.pop((x,y))
|
||||
|
||||
# challenge 1
|
||||
v = dijkstra(g1, (0,0))
|
||||
w, r = shortest_path(g1, end, v)
|
||||
res1 = r
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
# i did some binary search to figure out the index would be
|
||||
# between 2800 and 2900
|
||||
for x,y in blocks[1024:2800]:
|
||||
g1.pop((x,y))
|
||||
for x,y in blocks[2800:]:
|
||||
g1.pop((x,y))
|
||||
g = deepcopy(g1)
|
||||
v = dijkstra(g, (0,0))
|
||||
w, r = shortest_path(g, end, v)
|
||||
if r == 0:
|
||||
res2 = str(x) + "," + str(y)
|
||||
break
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
5,4
|
||||
4,2
|
||||
4,5
|
||||
3,0
|
||||
2,1
|
||||
6,3
|
||||
2,4
|
||||
1,5
|
||||
0,6
|
||||
3,3
|
||||
2,6
|
||||
5,1
|
||||
1,2
|
||||
5,5
|
||||
2,5
|
||||
6,5
|
||||
1,4
|
||||
0,4
|
||||
6,4
|
||||
1,1
|
||||
6,1
|
||||
1,0
|
||||
0,5
|
||||
1,6
|
||||
2,0
|
||||
+3450
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,84 @@
|
||||
--- Day 19: Linen Layout ---
|
||||
|
||||
Today, The Historians take you up to the hot springs on Gear Island! Very suspiciously, absolutely nothing goes wrong as they begin their careful search of the vast field of helixes.
|
||||
|
||||
Could this finally be your chance to visit the onsen next door? Only one way to find out.
|
||||
|
||||
After a brief conversation with the reception staff at the onsen front desk, you discover that you don't have the right kind of money to pay the admission fee. However, before you can leave, the staff get your attention. Apparently, they've heard about how you helped at the hot springs, and they're willing to make a deal: if you can simply help them arrange their towels, they'll let you in for free!
|
||||
|
||||
Every towel at this onsen is marked with a pattern of colored stripes. There are only a few patterns, but for any particular pattern, the staff can get you as many towels with that pattern as you need. Each stripe can be white (w), blue (u), black (b), red (r), or green (g). So, a towel with the pattern ggr would have a green stripe, a green stripe, and then a red stripe, in that order. (You can't reverse a pattern by flipping a towel upside-down, as that would cause the onsen logo to face the wrong way.)
|
||||
|
||||
The Official Onsen Branding Expert has produced a list of designs - each a long sequence of stripe colors - that they would like to be able to display. You can use any towels you want, but all of the towels' stripes must exactly match the desired design. So, to display the design rgrgr, you could use two rg towels and then an r towel, an rgr towel and then a gr towel, or even a single massive rgrgr towel (assuming such towel patterns were actually available).
|
||||
|
||||
To start, collect together all of the available towel patterns and the list of desired designs (your puzzle input). For example:
|
||||
|
||||
r, wr, b, g, bwu, rb, gb, br
|
||||
|
||||
brwrr
|
||||
bggr
|
||||
gbbr
|
||||
rrbgbr
|
||||
ubwu
|
||||
bwurrg
|
||||
brgr
|
||||
bbrgwb
|
||||
|
||||
The first line indicates the available towel patterns; in this example, the onsen has unlimited towels with a single red stripe (r), unlimited towels with a white stripe and then a red stripe (wr), and so on.
|
||||
|
||||
After the blank line, the remaining lines each describe a design the onsen would like to be able to display. In this example, the first design (brwrr) indicates that the onsen would like to be able to display a black stripe, a red stripe, a white stripe, and then two red stripes, in that order.
|
||||
|
||||
Not all designs will be possible with the available towels. In the above example, the designs are possible or impossible as follows:
|
||||
|
||||
brwrr can be made with a br towel, then a wr towel, and then finally an r towel.
|
||||
bggr can be made with a b towel, two g towels, and then an r towel.
|
||||
gbbr can be made with a gb towel and then a br towel.
|
||||
rrbgbr can be made with r, rb, g, and br.
|
||||
ubwu is impossible.
|
||||
bwurrg can be made with bwu, r, r, and g.
|
||||
brgr can be made with br, g, and r.
|
||||
bbrgwb is impossible.
|
||||
|
||||
In this example, 6 of the eight designs are possible with the available towel patterns.
|
||||
|
||||
To get into the onsen as soon as possible, consult your list of towel patterns and desired designs carefully. How many designs are possible?
|
||||
|
||||
Your puzzle answer was 265.
|
||||
--- Part Two ---
|
||||
|
||||
The staff don't really like some of the towel arrangements you came up with. To avoid an endless cycle of towel rearrangement, maybe you should just give them every possible option.
|
||||
|
||||
Here are all of the different ways the above example's designs can be made:
|
||||
|
||||
brwrr can be made in two different ways: b, r, wr, r or br, wr, r.
|
||||
|
||||
bggr can only be made with b, g, g, and r.
|
||||
|
||||
gbbr can be made 4 different ways:
|
||||
|
||||
g, b, b, r
|
||||
g, b, br
|
||||
gb, b, r
|
||||
gb, br
|
||||
|
||||
rrbgbr can be made 6 different ways:
|
||||
|
||||
r, r, b, g, b, r
|
||||
r, r, b, g, br
|
||||
r, r, b, gb, r
|
||||
r, rb, g, b, r
|
||||
r, rb, g, br
|
||||
r, rb, gb, r
|
||||
|
||||
bwurrg can only be made with bwu, r, r, and g.
|
||||
|
||||
brgr can be made in two different ways: b, r, g, r or br, g, r.
|
||||
|
||||
ubwu and bbrgwb are still impossible.
|
||||
|
||||
Adding up all of the ways the towels in this example could be arranged into the desired designs yields 16 (2 + 1 + 4 + 6 + 1 + 2).
|
||||
|
||||
They'll let you into the onsen as soon as you have the list. What do you get if you add up the number of different ways you could make each design?
|
||||
|
||||
Your puzzle answer was 752461716635602.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
|
||||
def memo(f):
|
||||
memo = {}
|
||||
|
||||
def f2(x,y):
|
||||
if x not in memo: memo[x] = f(x,y)
|
||||
return memo[x]
|
||||
return f2
|
||||
|
||||
@memo
|
||||
def count(p, ts):
|
||||
poss = 0
|
||||
for t in [t for t in ts if p.startswith(t)]:
|
||||
if t == p: poss += 1
|
||||
poss += count(p[len(t):],ts)
|
||||
return poss
|
||||
|
||||
|
||||
def possible(p, ts):
|
||||
poss = False
|
||||
for t in [t for t in ts if p.startswith(t)]:
|
||||
if t == p: return True
|
||||
poss = poss or possible(p[len(t):],ts)
|
||||
if poss: return True
|
||||
return poss
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
towels, patterns = open(sys.argv[1]).read().split('\n\n')
|
||||
towels = [t for t in towels.strip('\n').split(', ')]
|
||||
patterns = patterns.strip('\n').split('\n')
|
||||
|
||||
res1, res2 = 0, 0
|
||||
for pattern in patterns:
|
||||
res1 += possible(pattern, towels)
|
||||
if possible(pattern, towels):
|
||||
res2 += count(pattern, towels)
|
||||
|
||||
# challenge 1
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
r, wr, b, g, bwu, rb, gb, br
|
||||
|
||||
brwrr
|
||||
bggr
|
||||
gbbr
|
||||
rrbgbr
|
||||
ubwu
|
||||
bwurrg
|
||||
brgr
|
||||
bbrgwb
|
||||
@@ -0,0 +1,402 @@
|
||||
urubgur, buwu, wbr, gwbw, gg, urgw, uubruwu, brb, urr, buu, wgu, gwuwg, urwb, ruwgr, wgguwgg, wur, ggrub, rwg, gbwb, wbw, ruww, grgub, wwg, ugrrrurg, wbgbbug, ubbr, ugbu, bwwggwr, ruugrr, bub, bwr, rbuu, urwbgur, grb, uwbwrw, ubrurw, rgwu, rrg, bruw, brgb, wwuwur, uugg, gbrb, uwuwuur, uugwwwb, rr, urug, ubbb, urgrw, rgr, bubr, uww, bbw, grbww, ubgwg, ugrrb, ubwwu, wub, urggu, wbww, bugwww, gwwugw, ggbugr, uru, uwwwubr, gugb, bw, rrubb, wrbub, ggw, bwgb, ubw, gbbw, gbb, wugbgb, rbr, bgw, wrw, rbgurg, gbw, ggg, uggw, rwgrub, bbgwg, uug, wbgbwbg, ub, wbbgr, br, wgrrgg, urubgr, wwuw, ruu, rrwguug, bg, bgrwbbu, ubg, ubugu, gwr, rbuwg, gw, b, rgubw, wuru, rbgu, gur, r, gww, grwrg, wwrggguu, grugwrw, bb, uwbgb, wwrbu, bbr, ubgwwuu, ubrr, uubwrub, ruw, bgbrr, grr, wrr, bwwww, ug, wggbgrb, uwwg, wbgbbu, rrurgu, rbrr, rguwrgub, wuurb, brwu, rgw, ggb, ugbr, wwwuu, gguu, urbrug, ggr, wrrbg, brg, uwuggb, wuuggwr, burg, ruwgg, bgbwubur, grbrg, wbbrb, bgwbr, wbrugbgb, rwgr, wguu, gruugwr, gbu, brru, grurgw, ugbw, wgbb, rb, gbgrrur, bbgrg, gguwr, ugguwgg, rbbwbr, uruubugw, gbubw, guubg, bgub, wuuuu, wwr, bur, bwb, uwu, bu, ugbrgr, wubu, bbu, rgbbu, wuu, g, ggu, uwrrrr, wuw, rgg, brbuwg, wubuwwbr, bbwwuwbw, wbb, bgrug, rgrgbbg, bwruwr, rwug, guwbr, gugrb, gwuuuu, rrrwr, ubb, gggwrbu, wwugb, ww, gwbwg, bgbr, bgwbrg, bbbb, ubrgwb, bubb, bgurg, rgrwwr, urwbru, u, ugrg, bgburw, ugggb, grrrwrg, ugrgrr, brwb, rugbwg, wgg, ugbgru, urguu, uu, ubbbug, uguwguu, gu, rub, uur, gguuwu, uw, bwbwgrg, gbgwb, rru, rwurw, uwwu, rbrur, brr, uwgrb, ggur, wuwu, uwwr, buwugww, rggug, www, ur, rrr, rbwggb, bwubg, wuugubu, gbwwgug, urw, uwb, ugu, gub, wbu, wrgu, gwwbbuur, rwwg, ggrgbgbw, rw, gwg, grg, wggb, urbug, wruw, wrbbwwru, rwuu, gubu, uuwu, rwuwub, ugbg, guu, uwrug, bwwrg, gggr, bwrw, gbr, gbrr, bggbwr, bbrbwug, rurbru, wgw, uub, gggrwug, rrbbrrg, wru, gb, rrgw, rwr, urwrg, gr, ubbw, rugww, bwbg, ruwu, rwu, gbbr, rgrwbw, wwbbrw, urwggrub, rbb, bwwu, buubbrg, urwr, gbbrb, ugb, rgb, rgug, brw, bgbguugr, rbwgu, uuw, rug, rg, ruuurb, bgbgwrr, wuwg, urb, rgrrur, bbuww, bgubg, bbbu, ubu, ggbrg, gbwbr, gru, wwbuww, rbu, bgu, bugr, rwuuu, bgwrrr, rugw, ubuub, buur, wrg, gwu, bgr, bug, wgr, rurwwwg, ugrrgwww, wb, wwbb, gbgr, uuwrb, bgbbgb, uuwb, ubub, bwu, guggb, gbbrww, uuub, urbb, wbuuwu, ubbgb, rrw, brwgwr, bgubb, urg, bgg, ubrg, rrrur, grbb, rwrbur, wrgrg, grwubg, wbwggbrb, rww, gurg, bbb, wbg, wwbur, rubuguw, rgu, rgbu, ggwr, brruw, gurub, buw, gubb, gggg, wuur, gbbbwgb, uurg, ubrrg, guw, ugwggr, rrbbw, gubwwruw, gbgu, bwwg, uwbugg, ugw, bbggbgr, uggwu, uwwb, uuu, bww, gwb, bwububwg, grubbw, bbgb, uubwgwwu, wbrugw, rugbb, gbg, ubr, gwurru, ugg, rwb, wrwu, bwg, wug, rbg, brbg, rugrw, bbg, bbggubww, bgb, wgrrg, urww, wwu, rbw, urbbuw, wg, wuwbww, urwgguuw, wubbwr, brgrwg, rur, bwuwgu, uwr, rrb, rbww, gruwr, uwg, wu, bgugu, urgg, bru, ggruuub, wbbuugw, rgbg, grw, grgrur, rubbrub, guwb, rrwu
|
||||
|
||||
bgrwuwurrubbrrguwwgrrguguwgbwrruuurgwbwbrguwggrubu
|
||||
uuguuruggugbgrwuggrubbbrggururrugwgbgbbwwrrguw
|
||||
urugwwbbwwgbuubwrugbggrguwgwgwgwurgbubbwrrbuugugr
|
||||
wggugugubgrbwuugbbbuwuuugguugwrwwgugrruuubgwggguww
|
||||
wrbbrrurggbwbgbgbgwrwrrugwuwrrgugwggburugrggurrgbr
|
||||
rbuwugbgggurggugurrbgururbbwuurrrguwugruwuwgubw
|
||||
rrrburggbbwurgbbrbbwubrbgbwubuwrburubbrwwb
|
||||
uruwwggubgwbubbgwgbrrbbgggbggugrgwbbubbgugrrbw
|
||||
wrbugwbggruwgbgbugurruurrggggbgrrgwubggrguwrgruwu
|
||||
wrbuguwrrrbuwuuwgrrrbgurrbwrgruuuruuurggbbwrrbruwu
|
||||
bwgbrgbgurrgwrgugrubwgrrbrwububbgurrgrbbggrwbbururgwbbuuru
|
||||
wruubugugrurrgguugurwwwubguburbrgwgggugwgbbbubuwgbguguuguu
|
||||
wrbbrrururwuwgbruwguurrbgbbwrrbgbwggrbguuugw
|
||||
wbbwgggbrurgwrrugbbgbrubrwuwwrrbbruubrbbrugurwrrwbwrwg
|
||||
wrbwwwbwrwuwrgbwgrwuuwruwwgrurggruubruruuruugbgu
|
||||
wrbwrrwrgurrrrgrbuuwwgwbbgguubwbrrrwgwgggrbwrbrbugggrbugub
|
||||
bguuuguwrbubwrwguwurbuggwgbwbrruuruguwwwbgwuugwrugwurggbgr
|
||||
wrbgbbrwgwugrwurwbbuubgrwrubrwruwrgrguuruwuwbugurgubrb
|
||||
wrburwrggwbbrwgggwrguwrgubbggrbgrurgrburrbbuwgrugu
|
||||
rggububwwwgrggurgwwgbrbugrggggwwgguwggwgrrurrruwwwww
|
||||
wrbuwburugrubuuugwwwwwbbwrwuugurgrgrbbbgwgrgrrurrbbgrbruwwwu
|
||||
urgburburubgwruwbwuruuwrrbbubbgbwuuruuugrwwbwgggbbrbgubuur
|
||||
wwuguwuwwgbuugggubgbwbwurggwubrgbubwwuggurg
|
||||
wrbwuwrbgugwwrbgbrrrruurwggugubgguwrwgurgrrg
|
||||
grwbbrbwrurgubbugwrbgburgwbwwbbbggwurgbwbbuguuwuwrgbguw
|
||||
bgrurgbrugbbgwwrrrugwrbugrbuuguruwbbbrwbbwwrg
|
||||
wrbrgubbbrbbgwwbbrrwbggrrgbgbbbwubuubrwbgg
|
||||
rwwurwwwwbwrgbrwwgwwrurrbbwgrbugugwrbwguwgurwrb
|
||||
ugggrwrrrubgurrrwbgruwugubgugbwruuwgrgwwwugbbbguurwbwugr
|
||||
wrbbwwwggrbbguurbrurgruubugbubbguugugbggubwbuuugbguuuwwgbrrg
|
||||
uuwurrbwrbbbrrbgbuuwuwwbrbgrgwbgrrwgurwubr
|
||||
gwurgwuwbbbbwruwrrrwbugwguburubgbbuugrgrrwwwrgbw
|
||||
wrbrgbwbgwururgwuwggbbbgbbubgrugbwgggugugbugwbrwugwbrrwurbgr
|
||||
wrbbbwuruugrurgbwuwrgrrbubgbwuburrrbbgwbrgrrwggbbugwuwwrruu
|
||||
ruwgwrbbuwwrbrugrwrwurrgggruwbrrwbwbbrwrwbbrgbgr
|
||||
ubbrrwbruruuwwbwbuggrwgruwuruubugwrguuggbgbrwubugr
|
||||
wubrbwbbwwwgbwwbwburwwbubrrbbburrrurwbbwwubrb
|
||||
gwbwgurwbggrwbgwbgubwrrrbwgwrgwuurgbwubggburrurwugwbbbrg
|
||||
wrbbbbrruburwwugbgbgwrgwubbggbrrrbbuwrbwwrbbbrwwwwugwuwugr
|
||||
gbuwbwwwrwuurwgwwbbrruwwwburwuugbwwwuguggb
|
||||
wuwwgbgubgrwguwrbbbwruurwugrurwwbuuggurgruwuwwbrurgruwrub
|
||||
urgwwuggggwuuwrrbbrwrrwrbgubgbwruwrwgrburubrguubwggwuubw
|
||||
uguburwbwugbwbwrwgrgwgrrrururgwubwrwrbwruugwbgwwwgug
|
||||
bwuwwwbbgubgrrgbbbuwubrruugrgbuubuwbwwrwbuugbruuwbuw
|
||||
rrbbwbrubgbgbgubrwubbwggubbrggbuubuwgbwbbuuubbubbrrburbuwu
|
||||
bbgbggugbugbwwubbwurgbrbwgrbgbwugwgbugruubbbu
|
||||
wrbbgwrrrugbgwbwuwggwbgwgbgbrwruggrwgwggwruwr
|
||||
bugbwbuuwuguubwrrwwurbwgwwrwburguwwrguubgu
|
||||
gbbuurubbbrwrrwgwbbbwgubrwrgbgguuubbguuwuwbwuuggbgwg
|
||||
wrbrbruuggburugubgbbrgubbugwbrbruuwgguubwbbb
|
||||
wwbggrrwggwbugrgwguugbburguuubrrrbuwrgruwbwrwbru
|
||||
uururuuruwwbuugrrgguwgwuggubgbggbuubrwrrbgrurrwwgbbgg
|
||||
wrbwwwurgrururrgbuubgguubwgwwubuuububrwguwwuu
|
||||
wgwubwrgwrwgrwwrbrubrwwwguuwgbrgwwbruubwubwugrwwubw
|
||||
wbbuwwbwgbruugbwrrbguwgrwgrgurbwguwwwrwwwgggu
|
||||
uububgbbbwgugruwuwuuwbgrurrrrrrggbbbwrgguggwuuuw
|
||||
wrbuugwrrugbwrwurbrugbruuuwwguwwbwrwbgruburwwwrwgru
|
||||
wrbuubbwwwbugbrgbuuuugugwwruubwugrwbrurbw
|
||||
brguguwbburrbubrrgwgwburuurgrggggbuwgggwuuggubbuubburwr
|
||||
wgrbbwbbrbgrgburwguwuwuwwuuurgbwrbrwurwrrrgrbubrwuwu
|
||||
wrbbrrrbubrbbuuwwgwubuuwgurgggbwwuuuwbwububwggugrubbggwwwwbb
|
||||
gbwwrbbgggbrruwrrrbwgwwgrbbruguwgurwuuwrbu
|
||||
gbgrwwggbrwwwbwgbwubrrbburwuwwgwgbrrwwwwurrbuwrgr
|
||||
wrbgrwguwrrwggrrgbwbrrgwuggrbuwgubugruub
|
||||
wrbbrbbrubrrrgbrbgubrwgwuugwbrwgwruggwwwububuurrgurrwuwbrruu
|
||||
bggwwbggurggbbwbbgugwbgrgbburuwrgwwgrbbbbbwguwr
|
||||
wrbrwrbwwuurbwbgwbuggwbrgugwgwgrbgubgbuwbgwbwub
|
||||
uwwbggwruwwwbgrrrbbwggbgrubrgugrwgwgbwwrugurwugwgrb
|
||||
ggubrbgbburwgrbrugurrrbrwgrgrubrguuwwrrugrggggubrrgr
|
||||
wrwurggwgbwgruuwurrbwwgwubrgbgubruggrwggwrggggurrgrggwgww
|
||||
gwrrrugugwgguugbwgbguwubwrruwrbbbbbgguwwgbrwgruruuubwrb
|
||||
wrbrgugrurbbbuwggwuwgrgwgwrgbrggwubgbbwgbwwrgrwguwb
|
||||
ubbgrwrrrbgwwwrrbgwbgrwrguburbrwurrbubggwrggrubg
|
||||
rrggwugugrubbbrrurburwggwwrwrrbrrurbuurbrgruubrugrrrgrwbgu
|
||||
brgwrrbggubbuubuwwwubwugggrbggwwubgwggwrbuwrgwg
|
||||
urwgrubggggbbgwrugrggwurrbrgbbgbugwbrrggrwrgubrbubgbu
|
||||
rubbguuruburwgrugrwrbrgburwwbwwgurugrgurgrwrrwurbwguggr
|
||||
wrbuburbrgwubrrbrrwrwrugugbubgruuwubgguuuwwu
|
||||
wwubgwbrbbbbburuuwrwgrgbbwbrwwwrbbguwgwwuurubrwggrwurug
|
||||
gbbgbgwwgrbbuubugwurggbwrbubgbbbwbgrbwwugbrggbgbuwugbwu
|
||||
wrbbbbruguguwuggbbgwugguggurrbggbgwgrrburubrwrwrr
|
||||
wrbuwuwbwgbrubbrbbrurgbbrburwrgwwgbbubgbbbggrbgw
|
||||
wuurruggggbuurrrwbwubrgrwubbrggrgrbgwuruuwuuruuw
|
||||
bugbgbruwubrrguuuuggrrrgrwgwrwubwgbbburrwwgrggwurrwr
|
||||
buuuurgubwwugrrwgrgubwrrwugugwuurubwwubrbgb
|
||||
rbguwuwubuuuuwgbrbugwbugurggubgubgwrwruwrbwurrgg
|
||||
wrbwwgrggwbwwwwrwwuwrugrgbbrbrruwgrguwwbbwubbbugrrgwwwub
|
||||
gbubwgbuwwgbbubbwwrwwggrgubuuubgrgwuuwbuugbbgbbrgwwr
|
||||
rbwruwbwuwuuwbbwuwrwwubwgrwwbrugwbwbrruuwuuuurrwbwbub
|
||||
wrburbbuwbbgwbwwgbrwgwbwgbwubrwugwbgubugrgurrbuurrwwrwwugb
|
||||
wrbuwwrbbrgbrgrrbrugurgbwrrrrwrwugrbwuwrbgguww
|
||||
bwbgbbwwwggrruggrugrrurubwbguuwbbubggrgrwbw
|
||||
gwuubbbubbgwurwugugbrwurbrwgwuuwrbruggbbwwbbwbb
|
||||
ubrbgwrgrgugwbrrwwbgguwrbbuwrurbgrubwrruubwurbwbwwwgwwbw
|
||||
wrbuwwurgbgggggrrbbuuuubrugbwuwugbrgburuuu
|
||||
buguwguwuggrbwgrgubwgwrrbwrwgwuuwubuwwbrwbbugruwubw
|
||||
gururrgrugwwrwubrgggbgrgwuugwrguwubgubgbbuubruugrgr
|
||||
buuwubbrggggwgbwwggrgbwrrwgrrwrruwruwwgbuugubbubu
|
||||
rrgwbuwrwrbgwwurburubbbwwrgbbguwrrggguubwwwwgruuwuwu
|
||||
wguwguwrwrbuubbwubguwrbwgurggwgwwuubwugrgbwguguuu
|
||||
ggrguwurwurwgubuubwgwwwuubrbbwwrgbrwgbgrbu
|
||||
wrbbrrbgrurwbwurrrguguuuububbgbgwwgrubwbrrgburbg
|
||||
ugwrguruwwubggggwuugwgbuwrwrbuggwgbgrgrubwububwgwggwgr
|
||||
wrbrrwbuwgruugwwgwrgwgwrubrrugugbwrrgrbrubrgbrrwgb
|
||||
wrbwruwgururugguuguwbgwwbwbwwubgwgrwwwwgg
|
||||
wuguugrrrgrgrrbwgurrwbbwgwbbubwrrburgrgruwuwwbuubgbg
|
||||
gwbbrbggurgwuubwwugurbggugguuubruuggbuwubruggru
|
||||
rgruubbrgbbbuuguuugburwbrugbwwbuuuuubuwgwgwbgbugg
|
||||
wwbuuggrgwggrubwuwugwwgrbwbgwgrwgubbwwbbgrgugwgggubwrwbbg
|
||||
wrbgrurgrgrbbbrrbwwrugbubrgububbggwgurguruubugwbrbg
|
||||
rwbrbguwrubguwurwwgugrbbuwbgrgbbubbrrwguubggugbbbbgbrgu
|
||||
wrbrwgwbrbrbuwurwgguuwrbrgrrrggwuwwgwbrggguurbruwwgu
|
||||
wrbgwubrrurrwgrbwgubugwgbbrbwggrrrwwbubgwggrgggwuuugggbwwwgr
|
||||
rubgwrrgbwggwwwuggwuuwwbbwrrrbrgguurruwbwruuuru
|
||||
wrbbgwwgrrbwbwbwrwwwwrbbbrbrrrugbrbbrrugrgurgbbbgrgwwuwgu
|
||||
rwgbgugbwgbgrrgubrrgwguwwbbbrrbgrugbgugrgwug
|
||||
wrbbubrwugrrrurgbuwubbwbbwruwguwwurbuwrwgwwwrrrbgwbgrrggbgr
|
||||
wrbbbbwbrwuurgrgbwwwbuurwrbwrgbrruwurrrgw
|
||||
wwrbuubgbrrwwrgbbbguuugrwrgrbrbrgrbwwburug
|
||||
gguwuwburwbrwrrgurubgrgbrrbbgurgbwwbgburwubbwgrgbrgw
|
||||
wrbgbbrrwwubruwrwrrwwbrrwggbbgbwrruggguggwr
|
||||
ubwggbguwbubburruwrrwubbrugrbbrwuwwugrwruwwrubuurguwuurwu
|
||||
wrbwrbwwbgugrbbbbwrwuububuurbbwuwrwgrgwgbgruuwrgbuwuwgb
|
||||
wrbruuwwubwbgwwwwbwgwugwgwbwuguubbbbbgbugugwwwugwgbgrbbgugug
|
||||
buwrggrgrwurgrgwwuwubgguurwrrrbgrgrubgbwgwwbrgwwrbrbruw
|
||||
guguwugrgubrguuwwbgrbwwuuuubguuggrrbbuubububgrwgr
|
||||
wrburgrgrgwbruggurggrgbgbwgrbwwrurwwrrbguugbrwwurwwubbuu
|
||||
rgwbwgwuggwgrgwwggguruwwruwgurguruubbgruwbbwgbwrgurw
|
||||
wrbbruugwwgbbubbrburwbrbrbwggrrwbguwbrbrrbgbgwwrgb
|
||||
ggwurwugrgwrbrburwuwbbbwrrrububwbrurrrgwwwwuuugbwgbwrbru
|
||||
wrbgrbgrbgwrbubwrwbbwggrwwuwwuwgugbbgurbubbbuuwggr
|
||||
wrbburwrgruuwuurrrbbrgbwbbwrbubwrguwgwbb
|
||||
rugurugrwrgrbwrguwwuubgrrrrggwrwuwwwrrwrggbrwbbu
|
||||
ggrbwgrgbwgrrugggwrbgrguwubburggbugwbwgguwwruwwgwubruwggg
|
||||
ruruurbbwbgwwggrgrgubggrgrubrwwrwrbbrgugbrrgwrwwubrgrurggg
|
||||
wrbwgbbuuggurbrbbrgrrrwbwbwbwrbrguwugrrgbbwrgrbbgwuurgbwbb
|
||||
wgbrrrbwrguwbgwrgwuuwrubbbrubgwgrwrrbwuurbbggrrgbu
|
||||
wrbwwgwuwbrubgrbwwgurwggubuuwrbwubwuburrurgwrwbbgruwguw
|
||||
wrbbrrwrgrbuuwuwrbbrgwbgwurubbrbrwrwubgrbbbbubggwbgugrwgrw
|
||||
rwrrgbrrrgguubugurwwruugrrwwurrgugrburrwbrguruggbggbrgu
|
||||
wuggrbrwubwbbuwbrubwrugbuubgwurbwbwwuuguruubrbw
|
||||
wrbguwbrrbbuurrburrrrgbrbwbgwrwrwwrbuubwubgwgwwwuguugg
|
||||
guwwgrrrrguwbwrgrgbugguwuwugrgbwrugbwrgbwgwbgbbubgrgrwr
|
||||
bgubruurrrrwwuuubwuuwuwwrbbgrwuwruwbgurwrugwwrbgw
|
||||
rbubwrggguurubguuwbbrguwrwruuwubwwwgwubbwub
|
||||
grubgwbrrguwrguwwrwruuuwbwgbgbubuuwbwbwrrbrwrgrugbwuruubb
|
||||
rguwrgbguururrwbwruugrrrbuwwrbbbuwrrbgubbwwurgwrubwbwwwuwu
|
||||
gruuwbbbrwururwuwwwrbburwrggurruwbrrwggrrwrgbub
|
||||
rwwrrwwbuuwgrbrrugrrrubwuwuwrwbubbgwggrgbggrubruu
|
||||
wrbuguubwgrgwuuruwrgbwbugubwbwgbuuwrrbwugwrburwur
|
||||
wrbwwrggrbwwwwwwgwrgbguwgruggggrrbgbruuuwgwbwgubwuwb
|
||||
wrbuwwgggrrbwgbwgrbrwuruububugbrgurwrrgbwgbuwubgwbwgu
|
||||
grrrbggurrgwwbbwruurrrbuguurwgrwwurbbrwgubrrgbuwrwugwwguuu
|
||||
wrbrruwbrwbrruuuubbbgwubgwuuwubuururwrugbguguubwgburwgu
|
||||
wrbuuuwugugwgrwbwbguugububrrrrwwrggguugwuuuwg
|
||||
uwgguuuwrgugrggbrggrgrwuruggwrgbuwwrgrrrrgrbugwbbwb
|
||||
wwgugbgrrruwgrwwgggrururgrrurrbburbgrubruurbwgugggu
|
||||
gwwwgrwrgwgbwbggwbbrurbgugbwguuggubrbwwbgbbwurgrwg
|
||||
gbgwbbugrwuggggrwubwbubrrwbuubbwbgwbbbwrgu
|
||||
bbbbrwggrbgubgwrwbuuwwwbgbbbbbrugbrgwugbwgrgrubu
|
||||
gwbbbubgbrwggggwbwgbrbrurubuugbrwbrrbrubwr
|
||||
burugwuggwuwrwrbbrbuuurubugrwwububwbgrbrbgrrguw
|
||||
rguwrwwuuwgbugbrrbrbbrugrugguurbugrubrwuru
|
||||
wrbuggrgrruwgrugrubbwgubrwrgwwbbuurggrgwggwubug
|
||||
urguwbgurbrwrubburgbgubrwwwruwuugbbrrrwrrgwguwwrrgg
|
||||
ugbuwugrbbrwgubrwwbuuguwbbrbwgurwwbbbruwrrgbrbruwuwgbg
|
||||
gugbwbbugwubbwrwrrrrwrubbwbrgbwwuuggubbggwgww
|
||||
wrbuwgwbwgbbwwbuwrgugwugrruuwrbgrurbrbubrrrbbrbwbgugb
|
||||
wrburwbrwugubbggrrrrwgurrguwwwrrbbwwwbwwwgbbwbwbgubggruubw
|
||||
brugrwwbbgrbrrgbggwrrguwrgbgrbrbrurbbrbbug
|
||||
ggubgwwuwubwurbuuugurgrwwbgbgbugrwgbrubrgrbbwbuubrrbgr
|
||||
wrbburgbbbrgrwuggrbbgbgrbrwgwubgbgwwuugbrbrwrguruggwggrbg
|
||||
rbubburuwwgrruwuwruuuwwwwwwgbrrbwrrwwwggguuuww
|
||||
wrbrrbrgbggurrwbguwwgwuubwgggugugrgrwgrgrrurgwuwbwurrbgb
|
||||
wrbrwwubwgurbbwuwwruubbwugwbruwbbuurrbrrbbuwwggurr
|
||||
wrbgwrrrbguwbbuwgbbgwrggbgrrbggggwrrbbrwugrrwgbbwuggwwbrurbw
|
||||
wrbbbbbrwbwurwbgrrbbwggguburuuwrgrrrwgggbu
|
||||
wrbrrrrwbbbgwugruwwuurwrbwugbwrwgwrggwbggbgggg
|
||||
wurwrbrruguwrrrruruuguwwrbwuugrgrruuwuwgbwrbgrwbubbrwruuuw
|
||||
brrbwrbgbbbuwbgbgrrbwrgrwbuuurgbuubwrguwrggrgrwrrbbg
|
||||
rwgbrbbbwurbggbgurwrbuwbuuurrrwgbburwrgwbwgrwrguwwguggbu
|
||||
brgwurbuwbrgrbburburrubwuwgrgrrbguuwwgruuurruugrurwwgbbrg
|
||||
gbrwbwbuwuuwgubbbwwuwbwggwburbuugbrrrrwgwurwrwgrwrgrbruur
|
||||
gwbrbuwbwggbrbggrbwuuwrubuggwrwugwurwuuwrwggwbruwruugbbu
|
||||
gwwuugrwbbgwgwgbggbwwwuwbbuuuwbwbgwwrrrruwbuugburw
|
||||
wbwgrgwgrgggwgrrrgrbwgwgwbbgubbwguwuwbrbgwbbrwrb
|
||||
rwrrbgugwwrbggruuwugrbubrrwgurugrruurbwgburww
|
||||
ugubugwwrggggubugrwgrguubrubbwuuwgwuuggbuwrwrggrwbrr
|
||||
rgbwwbrwrwwrwgwwwwwrwwwwgubwbbbwrrwgwrubgbwwbgrr
|
||||
brgrbgwuubggwruugrwugbuwbbbgrwbbgrwwwugubgrugubww
|
||||
gbrrbwwwbwwrrbrbubrwwurbgbburrgrurgguwbrgrgrwwru
|
||||
wrbggbgggrwwwggwbguwbgurggbgbwwgbbgugwwuuuubbwgbrgr
|
||||
ugggrbwggbwbuwwgwrgwbgurrbubuwwbrrrwuwuuwugww
|
||||
wrwuggrgwwrruuwrrggwgrwgwurwwuubbburgbrrbwwgr
|
||||
rggugwwrrburwbbrbbwbbruuuubrubgrrwguugggrgbrwburwuwwwwr
|
||||
ggwgbbrwwugwrwgubwburwrbwrubgruwwrgbguurbgbgggrwgg
|
||||
wrbbwgwuuubrgubbgbrrgbuburrbgurwbwubbubrbgbwu
|
||||
gbggwgrgbrrgbgrbwwugwuwubgwgwrwwrbubwbubwwubw
|
||||
wrbuubrwrgubbggbbrgbbwgrbrurgguwugwrubuugbbbuwubru
|
||||
ubwbbrrbrwwbwwwbuuburrrwuurwburbwbgrwrbrbggu
|
||||
wrbwwubgrwuuwrwrbgwrburggwgwwbwgbrurwrrwwww
|
||||
wrbrgbrrrrugggurwrggrwgggggbrbgurgubwwruwbgggwurbbwbrbuwguwb
|
||||
ugbbbbbbbwburwrwbrrrgbwrrburbuwrbubrgbrrggwwrrbbgwrrggrgr
|
||||
rrwuwbbrgwbwwuuwrwgwrwubggruubggruuuguruubwrbwwggbwubgggu
|
||||
wrbrubgwbbubwbgurwrrubuubwwwuruwwbrubbrbguwuubrrwbgg
|
||||
wuurwwrbbbwwuubwgggguurbwugurgrrbuuggguuwwurrr
|
||||
wrbgrrurrubbuwgurrrrugrwwbugbbgwwgrbrrubggrugugrgwburuwug
|
||||
guurrwuwrrbuwgbrgwrguwgurgrwgbwwubgubrbrgwbrwuuubguu
|
||||
wrbrrruuuwgbwruuugwbbrgwrrrbrwruwubrbwgbbbruu
|
||||
grrwruwgwgrbbgrrrwrwbubbrbbwrwgururrruwgwbwwwwrbrwwbwg
|
||||
wrbrrbbrbrbrbgrbbrbrbwwbrgbubbgggggrgwwbb
|
||||
wrbwbgggwbwbgbwwuruuurrurbbggbgbgbbrwbugwrrrgubgburbwgwgw
|
||||
rrgwrubgwrwrwubrrrwwurwwgwgrbbgwrrbubguwurruguu
|
||||
wrbggwwbrwwbubbwgrguwwruugwgugwrggguwguwruggwu
|
||||
wrbgbgbbbbrgbbggubwwgbwrwuuubggwuubwwbrubwrggwb
|
||||
wrbrbgbgwbbwruugwggbbbrwwbgbruubrwgubgwgwrrrwwwrrgrwrrru
|
||||
bgurgrwruuruuwbuwrurbubrurwbwbwwugurwbgbbbrbgwgggggwug
|
||||
gbwwbbgbuuruurgggrubrggurwuwuwgbwrrrggwwggwubururbbwururu
|
||||
wwbwgbrbbuwggugbuuwrwbuggrbwbuwgwbwururwgr
|
||||
uugwggrwgrurbbrwguruuwrwugwrurrwuuwwrgwbwurgwrwg
|
||||
rrubrbgwbgguwubbgwwubuwrguwrbwwwgrurrwgugbuggwbgrggrguuub
|
||||
bbgbugrgrubwguuwbrbwrggwrbwbrwrbwugbrbrurb
|
||||
wrgwrbbrrwuwgrubrbrgrurwggrubwgbwgwruwwbugurwrubwgbwgbgrwrb
|
||||
wbwgruugwwbrggburrgbbrwbguuwbwrrbubuubrwwgrgwwubbwgb
|
||||
wrbrrrbwgwwruruggburgwurwwubbugguwrurgbgbwbwurwwwurbwrggb
|
||||
gurbubbbbbwwrgrgbrgbguubbbugwrbrruuwwrwwguwrurgwrr
|
||||
uwgwubrbguuguuwubggwbwbgwgwrwbgrrrugggwugbwbwb
|
||||
uwggwuruurwwgrugurgrwrwbwwubrgwruugwruuggwubruwwwbbuubbgu
|
||||
grrwurgwgubggbruwbuuggwbbgguubrgguuwbuwrbgwrurbwgwgbbr
|
||||
buwwgugwrugrrbbgggruwuwrbwbrrwrwgwbugwrbbggbwur
|
||||
bguwgwubwgrbgwbrrwuurwrgwugubwrbguburbrgwwbruggugwwurggu
|
||||
wbbwbgbbgggwbrwwwubwrgrwwbbrbbwwuwbrugrrrurgu
|
||||
wrbuggurwubbrgggrbugrgwuubbbwubuuwwwwururruwburrrrrwgb
|
||||
urrruurrbbugbgwwgburbwwuuugrgrubuurggrbgrrbggbrwgwrwwubr
|
||||
wrbwgwgwbuwrgbrgggbrwgbgwwrbuwwwuuruwuwgwrbgbuwwrg
|
||||
wrbbugbuuubugwbgrwrbgguwrrurbbburgrwugubwrg
|
||||
bbbrwbbrwgwuwurgbwgwrgbrbbbugwugrbwggrwbwubwbwr
|
||||
rbrgggwbgwrbuuruwbguwgrugurwbbbwguwbgbbwbgrbgwwburuububgb
|
||||
urggrwubwwwwgrwwggbrurubuwbbuwubrbgruuuwugrwrwrwbruwbuuw
|
||||
wuwgrrwurwrrrgbwubwbbgrrgrgrbgruuwwbbwurubuuwubrwgww
|
||||
brbwrwwwgwrgwrbbwwruruwrbwurguwwrrburrggwubwgwwrwrgrbwbru
|
||||
grbrbgguguwrwuwuburwgwwbgwwrubbgbrbwrugbgbguugrgg
|
||||
rrbrruwgwurbguggbwugrugrggwrgbrwgbubwbbguwbwwgbg
|
||||
rbbrbuwuwwubbrbgbrbggwuubwgbgrbwrrurgrggubbuguwwwrgrwgw
|
||||
wrbgrubuuwwguwgubgrbbwuwwgrrgwubwbburuuugbwgwwbwwb
|
||||
wrbgbrbrbugrrbrwbwwggwgrwuwrwbgrbrugbrwgbuurrwggrwruuuwwurwb
|
||||
wrbwrwwrwubwbugrwwrwwbrrgrubrurwbwggbrbwwbgugrburrbggurgugr
|
||||
wrbgbrwwwgwggubrwgwwgwwbggwrbuubgbgruwubuwwbrwwbubruug
|
||||
rubgwubuuwbwubrgubrrrwrguwwbbggubwbwgbwrwbuguwugwwrb
|
||||
wrbwrbrruwbrburbrggugwwuwwggggbugubwuwbuurwguugurrwbgrbgruwb
|
||||
bwgwwgwbwbwrbbggbrbrgbbubbrugbuwwbrwrrgbgrgu
|
||||
urggubbwbrrwrbbguuuwgwurggrrrubbguuurbbwgrugbgu
|
||||
uguwrurbggrgurrurbggwguwuwrgrrrbwrbgrrgbbggw
|
||||
gwrubwrurbuuwgubwrgrwurwwruubbrrgrggrbbugb
|
||||
bwbrugbgburgbuuggguwwwrgurgbgrbrrgrurrbbuuugrgrgwuwwbuuwgb
|
||||
ubrwbgrrbuburrbbwbrbwgbwuwwurwwwuwbubbbugwwwgbbwwuwuguwurw
|
||||
ubuurbrwurrwurgrugurwgbuwuugrgwgwburrbrgbwwwwbww
|
||||
rwbrugbbruruugwgwbrwubbrburgbwbbwrgwwubwbwrugrrgwwwug
|
||||
wrbuwbrrurrrrrrrwguurwgubrbwbrrwrrggggrubgrwur
|
||||
gwgrbbuuuwrwgbrwbuguugbgrrrwurbwugwggubwuwbgrubrruww
|
||||
uugwbbggbrrbguubwwgrrgrrbwwgwrruwrgwrguruwbbwbguuwuuuguw
|
||||
rrubuwubbbrwbbwuwbbbbrwugwwbbuuruwgbrububggggrwgg
|
||||
wrbrgwbuggwgugbwwwwggrubrwwubbburwubwbbrbwrwwuwr
|
||||
wrbrurgbbwwuggrggwrrwrbwgbwgguuurgrurrwgrbrrwrwuugbbrbwgr
|
||||
ugrbgbbguuwrwwgwbrbuwgburgburgruuwwwgrwgggbbg
|
||||
wrbuguubrbrggrguugruwbwwbguuwurwruruggwbru
|
||||
grwrbgwruwwbgbggrwgrggwrbrruuwbbrgrwrubbgg
|
||||
rrwrrgwrwbuwgbburbubwgwgbbwrwrubguuwuwbggwugbgwuwurg
|
||||
bwgrwrrgggubwrbwrwugbrrugwwbgbrwrgbrrugruurw
|
||||
wrbbbuwwwrbrurwwwwurgwruguwuwbwbuwgbugwgwgubggbuubwbbwgbg
|
||||
brgbgrrrgurbuguwbgbbruugbgurruwububububrwwwuwbrrrrgr
|
||||
gwruuuuuwwrruugwwurwwwbubuwwrwurwwubggrwgwwuwwur
|
||||
rbrwwuuruuwwgbbwrrguwbwggwbrgbbwguwrwuwbugg
|
||||
wrbwurbwbubwbwrwugbggwwurbwuwbggugwuwuwgu
|
||||
gbrwubugrwrrwbubbwbbgbwguwgbwubgurwuuuurubuwg
|
||||
gruggbbbuwwuubrbgbuburwwgubruwbuwbrrbrbwugggurburbrwrg
|
||||
rubwbwbgwrugwuwwrwgrrubrguubwwubrwbwuwugrggug
|
||||
rwrrrwwbbwuugwuwwuwubbbwruuguwbggubbwrgbuw
|
||||
wrbggruubrgwugrgubuurbrrrbubbugugruwggbwg
|
||||
bwbugrrggwrbgguugwugrwugurugggwbrwbwwwururbgbrrg
|
||||
burwubuwubbwwwguuwwruubgggrgbgbgubgbwbwwrb
|
||||
wrbuubuwwugbuugrwwbwggwggbbuugbbugrbwruwuw
|
||||
gggrugbrububugbgrwburrwbggbruwbgwgbuubgwggbgbbw
|
||||
ubuguwuwuubggwubggggrrbububwgugrgwurbbrgbrugrrggrggb
|
||||
brgrbwrubwrrgugbruggrwbbrgrbwugubbgbwwwwbugg
|
||||
wrbbugwgbgwbgubuwrbrbbuwubbrggbgrrwgbrgwgwrrbwwuruuugrgu
|
||||
burrurwgbgruubguurrwwwuugugrruwburbubbbuguwwuuwgr
|
||||
wbwrgwwuruwggbgrwrurwgburrwggububrbrguwgggrrr
|
||||
bwgurwgwugwrwgbwuuuubbwuugbrwbbrrgbrgrgrwrrbbugrurrwuwrrr
|
||||
ggrggbrgurbugurbuwwubgrggbgggugrrbgwwwgguwgrw
|
||||
ggrwrgbuuuuwgwrgguguwburbggbrrwrwurwgwrgrbwwgrrrwrb
|
||||
grrgwwgruruguubwruuwrggrubgwwbwbgbrurburggwgw
|
||||
rrrburwuwrgbwubbgwrrrgwuwubrwbbuwwugrbgrbgwwruwrugb
|
||||
ugurwgbwbbgbuwgrwurrbwruwuwbrbrgugwubgguuw
|
||||
bbgurubuwbrrrwbwwwuwbbgubwbguwuwwuwuubrrbrguuurbbub
|
||||
ggggwrbrggguubwgwwuwrwwurggbruguggwwbgbbgwuggr
|
||||
bwwwgugwrbbwgwugrburguuwrgbwrrbubururrgbrwrwubwbg
|
||||
urbrbwbbgwuggbbuwurgbgwrbrwgwwwwurwuwgbggrbwbrrrggbrr
|
||||
wugrubbbuuuwrbburbbgbwwrgrrwrurwrbburbuwuwbwbgubu
|
||||
rgbbrwwubgwbrguruurgggrwwgrugrwwurrbuwbgwggwwurbrwgbb
|
||||
wrwgurwrgbgwubuwbgbuwubbrggrbbbrgbbwwrggguubruurw
|
||||
wrgwbrwgrrwguwggwwgrugrbwgwgrrwurwgbbbugbubuwwrugwu
|
||||
wrbwubrwrbgbguwruwwbbrrubbbwwuwbwurgrrrbruburwwuuuuggbwwbr
|
||||
uurwwwuwrrguwuruwwwrbubgrburrubwwbrrubbwbwruubwgbrgb
|
||||
uubgbubbwuurwguugubwrgbuwwugrrwrurwwbgbbgbrwurrwbuww
|
||||
urrbuwwwgbrrwrruubbgbwugggugbruwuwbgbrrrrrubbbggrbwwub
|
||||
gbwbgwwgwbubgbrgwguuggbuubgrbugwrwubwbgwbwwrrurrugrgbbb
|
||||
wrbggrrurbgguuwgbgwrrrubwubururrwrurugugwwrggw
|
||||
wrbwubuuuugwggwbwuwwugbruuugbuwruurbgggbgbguugruruurwb
|
||||
wrbrgggrwbruwgrrggbuwubbuguguuugwguuwggrguburbrrurggburbb
|
||||
wrbwruwwrwbrrrrwurrbubuwburgrwrrrwwgggubrrbb
|
||||
gwgrbuwwwuubbgbrbbuwuwggwwrwbbwbrwuugwggwuwbrub
|
||||
gugrugwbwgwgbbwwurubwrbgbbwwurggwgrrrggwuubu
|
||||
gbuugbwbuugugbubgwgrubrrbbgbwguruubggwwbwwgwbuug
|
||||
wrbbwuruubbgugrrrgbgbbwrwgbrrguwwwwuuwrburrguubgrru
|
||||
wuggwbuuguwgrbrwwwbwbbbruuruwwwrugrubbrrrbgwgwbubub
|
||||
ugwwugwguggggggbwwgbuwwwuubgbgbgwgwbbwgwugwggbguurwgruwub
|
||||
bbgrbruubrwggrrrruwrwwgbgruwuugrgbbbrbuggruurgwwgugw
|
||||
wrbbuuuwgbwwbuwuwrgrubwrugbbuuwgurbwrwwrrrwgbrrwbwwrurwbgu
|
||||
wrbrrbggrrrrgrrrwugruwbuwwrbwbwbubrbrugrgbruurb
|
||||
gwrgrwbuurgwwgubbrbggwwbgggbuwggrwgrburwruug
|
||||
rbugrggwrgwrubrgrwrrggubgugrugbgbrbwuubbrurwbwwgr
|
||||
wrbrwwuwwwwgrrrwwbuwwuwgbgrrurruwwwrwuuugwrwrwbbwrggugubrwwr
|
||||
rgrgrbwbbubrrrwwrurbwrwgugubwwwwurwgguuwwguwgbrbbguu
|
||||
wrbwwrwgrbgugbrgbbwwrbbwwruwugwgwrwrgurw
|
||||
bbwuguwbbuugbrggrbgbrbuwggwbwwwbgbwrwwgwurbrwg
|
||||
guwwubgrbwgbwuwubwbuubrwbrwbwbguuururrrgwbb
|
||||
wrburruwggwgwrgwguugwgwwuggbguwuggurbruuwwubuwrbbwggg
|
||||
gwgubwwuguwbbwuguwgrgrbruuwurwrbuggrwwbbubburbrrgwbg
|
||||
ggugbrbbgrwgguuubrbwgburrwrwggbruugrgguubrwwggr
|
||||
wuwugrwbbgguwrruuwwwuuugrbrbrgubwgrbrwubuubugwururuuwwb
|
||||
wuwbuwgurrrrwwugbrgwgwrwrgurwggbgubwwruwbrruwg
|
||||
uurwugbgwbbgrurrguwrbrgbwggrgbwgbruwggguubbubwgbbuguguwbg
|
||||
wrrwrbbrrwrwugwggggwuwbrbrwuwbruurgwwuuwrb
|
||||
wggwbrrurbbubbuwbwuurggugrggugwgurbgrgbgwrgguuww
|
||||
rbbwwubbrbuwuwurbugbubgggwrubwrrbwwuuuguwrugrbubbrrggbuw
|
||||
wrbguggwwbgrbwwggubbubrbwurwuurubgbburuuuwbguwrgg
|
||||
wrbwuwrggbbugrrurbwugruuruuwwurugrbwubwbubrgugbuwwwbwuguurb
|
||||
urbrgwrgggbwgwgubggbruubrguggwugrbwuburrbbgugbrrgwubwbu
|
||||
wrbguwrwrwbwuwuguuwbuuuwubrrurwwrwuububuwgg
|
||||
burruburbuuugwuuubgrugubwrgugrwrggwuubwbuuurrbuugb
|
||||
buuwwubrguwwbwrwurwrgbbbrwbrugbbwgrggbubbbugbwgbwgubr
|
||||
burwgrubgggbwwbbrbwrbbgbwruggwwwuwurrbrwrrw
|
||||
wrbwgwbwuwgwrgbwrrbrgbggurgwggwgggrggrurwgrrgr
|
||||
wrbwburrrbgwrrbruruwgwbwgbgwwburbrrrbbbbguwww
|
||||
wubrbwugwrgrwwwwubbruwbwubrwrrrururuuuuwbbugbuwg
|
||||
ugurubgbwuburrrgrrrgurrbugwrubrggwubrrrubwwrggr
|
||||
bbbbguugwrbbugbgggugbbbubrubuwwbbrbubbgruggbwwrrrwuugrww
|
||||
bgubgrrgguruuwgbgbrrwwgguwwuwbrgubwgubbuwrgwwrrbggub
|
||||
rwrugbburrbbrbuwrrwggwwbgggwbuurbwggruubrrwrubrubwgwwr
|
||||
wrbwrrgwgrrrgururwguuwrgbrbgbbuwgguugwubrrgwubbwuugbgwwb
|
||||
gbbwgbbgrrwuggwwgwgwubwwwwubggrrwubbburgguguwr
|
||||
gwwrrurgwwuubgwwwwugruuwbbgrguurbrrrguwrgubrrwbbguurrgggww
|
||||
bbrbuwguwurgrrwruwuurrgbgrurwgurbgbgbwubwbrr
|
||||
wrbwwwwurbwbbrgwgrurrrwbugwbwbrggwgbggbu
|
||||
wrbwurrwuuwwrgbgbrurgwbwrgggugrwwbbrrgrbgbgbbbwgbrwbrwbuw
|
||||
ggbuwrugggrgrurbgrgbwbrwuwbgrrwubwrrgwwuubgggbwbgru
|
||||
bwrubwgrbgwguburubwwurbgrrubggrbgwrbrbguugwgwugw
|
||||
wrbbbgrgrrbbuwgwggrwuuuggwguwbwwbgggbrurwwgrbgrwrurg
|
||||
wrbuuwwgugbguwrwbbwwrugrwruwrrguuguwwbuuruuwugbugb
|
||||
wrbuugwbgrrbbbugrwrwwrgwububgbgugrgwwwgbbggguububugrg
|
||||
bggwuuwubrbbrrwuurbggbgruwrbwwugbwgrbwgbuurugbbrurubgbu
|
||||
wbgrbggwwbuguurguwrbbbwwwgwrbuwruugbubbbrwwuruubbrrbrwbgg
|
||||
uuwuwgggrwrrgurbwgguuugbrwwbrrrgrrbrubrrruwg
|
||||
ubwubggbwggbbgrrrwbruurwgurguubrggbggubrugbrgrbwbubru
|
||||
wrbwrwgurwrbbbbgwwrrbrggwrgwwwubwuwwugugwg
|
||||
wrbburrwguubbgbbwuwubbgwrurrrrgrubwwwuggrwgbbubuwbuwbbrg
|
||||
wgrrrgubggrburuwbbubwgrurbbuggugggrbbbwwbgggubggrwuwrrwbb
|
||||
rgrggggrwgruuruuubbrgrwbgububgruuurrwguubwu
|
||||
uwwwbubrgubbgbrbrbwwwrbuguuwrggrrbrgrggubgrgub
|
||||
ururbuuuwwrwbwururrugrrbbwgwuuruwbbwrubrrrbwgbgwrburwrrgg
|
||||
wrbrrggrrgbbrwruubbgbrbbbgrgrgrgugwggwgggubrrwwugbbbwrbuwb
|
||||
wugwwubrrwwrgbbgggrgbgbwugbbggrbuwgugrwubgu
|
||||
brrwbgrrwuggrbguwbbrbbbwrrrrgubugrbwrgrbbgrubbggubwwr
|
||||
wrbwuurguurrwbrgrwwurwbrwbgwurwruwubgwbgugrg
|
||||
wrbgugrburwbbwwwrwwwgbrbuuuwguwgrbrguurggw
|
||||
wbrgugbwgguwguguuburwggrubggwwbugwurggwuwgururgrwubuuuwbg
|
||||
wrbwbgugbuwrbbwuwrwugrugbbubruwurwrgwwrrbruwu
|
||||
wrbrbbrwbwgrrgbwbbbwwwrwgwwwrrrwrugwgbgwwwrbrgwuwgg
|
||||
gbugggrgbwrrbwgbuwrbgbrgrbbuguwuguguwrrwguugruwruw
|
||||
wrbrrgubrggwwbuggubububgwgrwrbuggwgururwbgwbrrugwuw
|
||||
bgbguruguwggwwwrrwbgrrrbubbuwrubgbuuurubgrgbgrwbb
|
||||
wuugbwrrwggggbgwwubwwbrburbbrbwwbwbggrwrgbwwrbuwrwg
|
||||
wrbrugurbrbwbruuwgugwggwgwwubburubrbrgwgwwrrrrwugwuu
|
||||
wrbgwgwurrbwuwwwugguuguubwrbubbrwuwuruurrrwwbgwubb
|
||||
ururbgwgubgrgbgwbwgwrgwrguwgrbrgbwurwgbbgbrrrwrrwwgwurww
|
||||
wwuubwbubrggbuubggwbbwrrwggggurbwwbwbgugrugubwbru
|
||||
uuwuwuurrgurgrwrguwbbugbruuubuuwbbgwbbugwbgrrwrruwbrbb
|
||||
ruugrbuururgbrrugwgwrwwugbwwrubgwbbuubbrwgb
|
||||
rwgbrwrrwgwbgugrggurgbwggugrrrbgwguggggbgugburgrwbwu
|
||||
wwwugrbrgbrugurwrbggwwbbwwbwgwbgwuguuguuwwgrbwrwwr
|
||||
wrbrwrbrurbwwuggugbgggwwrwwgggggggwbuugwbrr
|
||||
wrbwgrubgrwwubwrububgggguguwbbrrrgrgggbggrbgwbrrrbwuwbrrbr
|
||||
rgurgrgrrguubrwwbgrgbuuurubruwrbwuuwbuwwgbrb
|
||||
wrbbbbwggbwgbwbrgrwuguuuwuugruwbrugbgbwwgurbubuguwwb
|
||||
urgbgugwbbwrggrrubbgurwurbwuburwubgrwubbwgwgrgr
|
||||
wrbwrgubrbubwubwwbwruwurgwurbwugruwrwgrruuguuwrgwgrurrgg
|
||||
rgrrgwwruuubgwgrwbbrrbwrruggurwwggugbrbbgugrgubwg
|
||||
wwgugrrbwubwrwwggggguguuwuruggbgburbbbwburrb
|
||||
wrbwurrrguuwwuwuwuwgrggbbwrwuubwwggurgbbwg
|
||||
@@ -0,0 +1,189 @@
|
||||
--- Day 20: Race Condition ---
|
||||
|
||||
The Historians are quite pixelated again. This time, a massive, black building looms over you - you're right outside the CPU!
|
||||
|
||||
While The Historians get to work, a nearby program sees that you're idle and challenges you to a race. Apparently, you've arrived just in time for the frequently-held race condition festival!
|
||||
|
||||
The race takes place on a particularly long and twisting code path; programs compete to see who can finish in the fewest picoseconds. The winner even gets their very own mutex!
|
||||
|
||||
They hand you a map of the racetrack (your puzzle input). For example:
|
||||
|
||||
###############
|
||||
#...#...#.....#
|
||||
#.#.#.#.#.###.#
|
||||
#S#...#.#.#...#
|
||||
#######.#.#.###
|
||||
#######.#.#...#
|
||||
#######.#.###.#
|
||||
###..E#...#...#
|
||||
###.#######.###
|
||||
#...###...#...#
|
||||
#.#####.#.###.#
|
||||
#.#...#.#.#...#
|
||||
#.#.#.#.#.#.###
|
||||
#...#...#...###
|
||||
###############
|
||||
|
||||
The map consists of track (.) - including the start (S) and end (E) positions (both of which also count as track) - and walls (#).
|
||||
|
||||
When a program runs through the racetrack, it starts at the start position. Then, it is allowed to move up, down, left, or right; each such move takes 1 picosecond. The goal is to reach the end position as quickly as possible. In this example racetrack, the fastest time is 84 picoseconds.
|
||||
|
||||
Because there is only a single path from the start to the end and the programs all go the same speed, the races used to be pretty boring. To make things more interesting, they introduced a new rule to the races: programs are allowed to cheat.
|
||||
|
||||
The rules for cheating are very strict. Exactly once during a race, a program may disable collision for up to 2 picoseconds. This allows the program to pass through walls as if they were regular track. At the end of the cheat, the program must be back on normal track again; otherwise, it will receive a segmentation fault and get disqualified.
|
||||
|
||||
So, a program could complete the course in 72 picoseconds (saving 12 picoseconds) by cheating for the two moves marked 1 and 2:
|
||||
|
||||
###############
|
||||
#...#...12....#
|
||||
#.#.#.#.#.###.#
|
||||
#S#...#.#.#...#
|
||||
#######.#.#.###
|
||||
#######.#.#...#
|
||||
#######.#.###.#
|
||||
###..E#...#...#
|
||||
###.#######.###
|
||||
#...###...#...#
|
||||
#.#####.#.###.#
|
||||
#.#...#.#.#...#
|
||||
#.#.#.#.#.#.###
|
||||
#...#...#...###
|
||||
###############
|
||||
|
||||
Or, a program could complete the course in 64 picoseconds (saving 20 picoseconds) by cheating for the two moves marked 1 and 2:
|
||||
|
||||
###############
|
||||
#...#...#.....#
|
||||
#.#.#.#.#.###.#
|
||||
#S#...#.#.#...#
|
||||
#######.#.#.###
|
||||
#######.#.#...#
|
||||
#######.#.###.#
|
||||
###..E#...12..#
|
||||
###.#######.###
|
||||
#...###...#...#
|
||||
#.#####.#.###.#
|
||||
#.#...#.#.#...#
|
||||
#.#.#.#.#.#.###
|
||||
#...#...#...###
|
||||
###############
|
||||
|
||||
This cheat saves 38 picoseconds:
|
||||
|
||||
###############
|
||||
#...#...#.....#
|
||||
#.#.#.#.#.###.#
|
||||
#S#...#.#.#...#
|
||||
#######.#.#.###
|
||||
#######.#.#...#
|
||||
#######.#.###.#
|
||||
###..E#...#...#
|
||||
###.####1##.###
|
||||
#...###.2.#...#
|
||||
#.#####.#.###.#
|
||||
#.#...#.#.#...#
|
||||
#.#.#.#.#.#.###
|
||||
#...#...#...###
|
||||
###############
|
||||
|
||||
This cheat saves 64 picoseconds and takes the program directly to the end:
|
||||
|
||||
###############
|
||||
#...#...#.....#
|
||||
#.#.#.#.#.###.#
|
||||
#S#...#.#.#...#
|
||||
#######.#.#.###
|
||||
#######.#.#...#
|
||||
#######.#.###.#
|
||||
###..21...#...#
|
||||
###.#######.###
|
||||
#...###...#...#
|
||||
#.#####.#.###.#
|
||||
#.#...#.#.#...#
|
||||
#.#.#.#.#.#.###
|
||||
#...#...#...###
|
||||
###############
|
||||
|
||||
Each cheat has a distinct start position (the position where the cheat is activated, just before the first move that is allowed to go through walls) and end position; cheats are uniquely identified by their start position and end position.
|
||||
|
||||
In this example, the total number of cheats (grouped by the amount of time they save) are as follows:
|
||||
|
||||
There are 14 cheats that save 2 picoseconds.
|
||||
There are 14 cheats that save 4 picoseconds.
|
||||
There are 2 cheats that save 6 picoseconds.
|
||||
There are 4 cheats that save 8 picoseconds.
|
||||
There are 2 cheats that save 10 picoseconds.
|
||||
There are 3 cheats that save 12 picoseconds.
|
||||
There is one cheat that saves 20 picoseconds.
|
||||
There is one cheat that saves 36 picoseconds.
|
||||
There is one cheat that saves 38 picoseconds.
|
||||
There is one cheat that saves 40 picoseconds.
|
||||
There is one cheat that saves 64 picoseconds.
|
||||
|
||||
You aren't sure what the conditions of the racetrack will be like, so to give yourself as many options as possible, you'll need a list of the best cheats. How many cheats would save you at least 100 picoseconds?
|
||||
|
||||
Your puzzle answer was 1393.
|
||||
--- Part Two ---
|
||||
|
||||
The programs seem perplexed by your list of cheats. Apparently, the two-picosecond cheating rule was deprecated several milliseconds ago! The latest version of the cheating rule permits a single cheat that instead lasts at most 20 picoseconds.
|
||||
|
||||
Now, in addition to all the cheats that were possible in just two picoseconds, many more cheats are possible. This six-picosecond cheat saves 76 picoseconds:
|
||||
|
||||
###############
|
||||
#...#...#.....#
|
||||
#.#.#.#.#.###.#
|
||||
#S#...#.#.#...#
|
||||
#1#####.#.#.###
|
||||
#2#####.#.#...#
|
||||
#3#####.#.###.#
|
||||
#456.E#...#...#
|
||||
###.#######.###
|
||||
#...###...#...#
|
||||
#.#####.#.###.#
|
||||
#.#...#.#.#...#
|
||||
#.#.#.#.#.#.###
|
||||
#...#...#...###
|
||||
###############
|
||||
|
||||
Because this cheat has the same start and end positions as the one above, it's the same cheat, even though the path taken during the cheat is different:
|
||||
|
||||
###############
|
||||
#...#...#.....#
|
||||
#.#.#.#.#.###.#
|
||||
#S12..#.#.#...#
|
||||
###3###.#.#.###
|
||||
###4###.#.#...#
|
||||
###5###.#.###.#
|
||||
###6.E#...#...#
|
||||
###.#######.###
|
||||
#...###...#...#
|
||||
#.#####.#.###.#
|
||||
#.#...#.#.#...#
|
||||
#.#.#.#.#.#.###
|
||||
#...#...#...###
|
||||
###############
|
||||
|
||||
Cheats don't need to use all 20 picoseconds; cheats can last any amount of time up to and including 20 picoseconds (but can still only end when the program is on normal track). Any cheat time not used is lost; it can't be saved for another cheat later.
|
||||
|
||||
You'll still need a list of the best cheats, but now there are even more to choose between. Here are the quantities of cheats in this example that save 50 picoseconds or more:
|
||||
|
||||
There are 32 cheats that save 50 picoseconds.
|
||||
There are 31 cheats that save 52 picoseconds.
|
||||
There are 29 cheats that save 54 picoseconds.
|
||||
There are 39 cheats that save 56 picoseconds.
|
||||
There are 25 cheats that save 58 picoseconds.
|
||||
There are 23 cheats that save 60 picoseconds.
|
||||
There are 20 cheats that save 62 picoseconds.
|
||||
There are 19 cheats that save 64 picoseconds.
|
||||
There are 12 cheats that save 66 picoseconds.
|
||||
There are 14 cheats that save 68 picoseconds.
|
||||
There are 12 cheats that save 70 picoseconds.
|
||||
There are 22 cheats that save 72 picoseconds.
|
||||
There are 4 cheats that save 74 picoseconds.
|
||||
There are 3 cheats that save 76 picoseconds.
|
||||
|
||||
Find the best cheats using the updated cheating rules. How many cheats would save you at least 100 picoseconds?
|
||||
|
||||
Your puzzle answer was 990096.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+60
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
from copy import deepcopy
|
||||
|
||||
|
||||
def find_track(track, p, c):
|
||||
path = deepcopy(track)
|
||||
directions = [[0,1], [1,0], [0,-1], [-1,0]]
|
||||
curx, cury = p['s']
|
||||
p[0] = p['s']
|
||||
for i in range(sum([t.count('.') for t in track])+1):
|
||||
for d in directions:
|
||||
nx, ny = curx + d[0], cury + d[1]
|
||||
if 0 <= nx < len(track[0]) and 0 <= ny < len(track):
|
||||
if path[ny][nx] == '.' or path[ny][nx] == 'E':
|
||||
path[ny][nx] = str(i+1)
|
||||
p[i+1] = (nx, ny)
|
||||
curx, cury = nx, ny
|
||||
break
|
||||
|
||||
for i in range(sum([t.count('.') for t in track])+1):
|
||||
curx, cury = p[i]
|
||||
for d in directions:
|
||||
nx, ny = curx + d[0], cury + d[1]
|
||||
if 0 <= nx < len(track[0]) and 0 <= ny < len(track) and track[ny][nx] == '#':
|
||||
for d1 in directions:
|
||||
tx, ty = nx + d1[0], ny + d1[1]
|
||||
if 0 <= tx < len(track[0]) and 0 <= ty < len(track) and track[ty][tx] in ['.', 'E'] and int(path[ty][tx]) > i:
|
||||
c[(i,path[ty][tx])] = int(path[ty][tx]) - i - 2
|
||||
return path
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
track = [list(line.strip('\n')) for line in open(sys.argv[1])]
|
||||
positions = {}
|
||||
cheats ={}
|
||||
for j,t in enumerate(track):
|
||||
if 'S' in t: positions['s'] = (t.index('S'),j)
|
||||
if 'E' in t: positions['e'] = (t.index('E'),j)
|
||||
path = find_track(track, positions, cheats)
|
||||
|
||||
# challenge 1
|
||||
res1 = 0
|
||||
for v in sorted(set(cheats.values())):
|
||||
if v >= 100:
|
||||
res1 += [x for x in cheats.values()].count(v)
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2 (replace 100 by 50 for example)
|
||||
res2 = 0
|
||||
for i in range(sum([t.count('.') for t in track])+2):
|
||||
x, y = positions[i]
|
||||
for j in range(i+100, sum([t.count('.') for t in track])+2):
|
||||
x1, y1 = positions[j]
|
||||
dist = abs(y1-y) + abs(x1-x)
|
||||
if dist <= 20 and j-i-dist>=100:
|
||||
res2 += 1
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
###############
|
||||
#...#...#.....#
|
||||
#.#.#.#.#.###.#
|
||||
#S#...#.#.#...#
|
||||
#######.#.#.###
|
||||
#######.#.#...#
|
||||
#######.#.###.#
|
||||
###..E#...#...#
|
||||
###.#######.###
|
||||
#...###...#...#
|
||||
#.#####.#.###.#
|
||||
#.#...#.#.#...#
|
||||
#.#.#.#.#.#.###
|
||||
#...#...#...###
|
||||
###############
|
||||
@@ -0,0 +1,141 @@
|
||||
#############################################################################################################################################
|
||||
#...#...#...#...#.........#.........###...#.....#...#.....#...#.......#...#...###...#...#...###.......#.........#...#...#...#...............#
|
||||
#.#.#.#.#.#.#.#.#.#######.#.#######.###.#.#.###.#.#.#.###.#.#.#.#####.#.#.#.#.###.#.#.#.#.#.###.#####.#.#######.#.#.#.#.#.#.#.#############.#
|
||||
#.#.#.#.#.#...#.#.....#...#.#.......#...#.#...#.#.#.#...#...#.#.#.....#.#.#.#.#...#...#.#.#...#...#...#.....#...#.#.#.#...#...#.........#...#
|
||||
#.#.#.#.#.#####.#####.#.###.#.#######.###.###.#.#.#.###.#####.#.#.#####.#.#.#.#.#######.#.###.###.#.#######.#.###.#.#.#########.#######.#.###
|
||||
#.#.#.#.#...#...#...#.#...#.#.#.....#...#...#.#.#.#...#.#.....#.#.###...#.#.#.#.......#.#.#...#...#.....###.#.....#...#...#...#.......#...###
|
||||
#.#.#.#.###.#.###.#.#.###.#.#.#.###.###.###.#.#.#.###.#.#.#####.#.###.###.#.#.#######.#.#.#.###.#######.###.###########.#.#.#.#######.#######
|
||||
#.#.#.#.#...#...#.#.#.#...#.#.#.#...###...#.#.#.#.#...#.#...#...#...#...#...#.....###.#.#.#...#.....#...#...#.......#...#...#...#.....#.....#
|
||||
#.#.#.#.#.#####.#.#.#.#.###.#.#.#.#######.#.#.#.#.#.###.###.#.#####.###.#########.###.#.#.###.#####.#.###.###.#####.#.#########.#.#####.###.#
|
||||
#.#.#.#.#.....#.#.#...#.#...#...#.....#...#...#.#.#...#.#...#.....#...#...#.......#...#...#...#.....#...#...#.....#.#.........#...#.....#...#
|
||||
#.#.#.#.#####.#.#.#####.#.###########.#.#######.#.###.#.#.#######.###.###.#.#######.#######.###.#######.###.#####.#.#########.#####.#####.###
|
||||
#.#...#.....#.#.#.#.....#...#.....#...#...#.....#...#.#.#...#...#...#.#...#.......#.......#...#.......#.....#.....#...........#...#.....#...#
|
||||
#.#########.#.#.#.#.#######.#.###.#.#####.#.#######.#.#.###.#.#.###.#.#.#########.#######.###.#######.#######.#################.#.#####.###.#
|
||||
#.#...#...#...#...#...#####.#...#...#####.#.###...#.#.#.#...#.#.....#...#...#.....###...#.#...#...###...#...#.#...#...#.....###.#.###...#...#
|
||||
#.#.#.#.#.###########.#####.###.#########.#.###.#.#.#.#.#.###.###########.#.#.#######.#.#.#.###.#.#####.#.#.#.#.#.#.#.#.###.###.#.###.###.###
|
||||
#...#...#...#.......#...#...#...#...###...#...#.#.#.#.#.#.###.......#.....#...#...#...#.#.#.###.#.#...#.#.#.#...#...#...#...#...#...#...#...#
|
||||
###########.#.#####.###.#.###.###.#.###.#####.#.#.#.#.#.#.#########.#.#########.#.#.###.#.#.###.#.#.#.#.#.#.#############.###.#####.###.###.#
|
||||
#...###...#...#...#...#...#...#...#.#...#...#.#.#.#.#...#...###...#.#.....#.....#.#...#...#.#...#.#.#.#.#.#...#...........#...#.....#...#...#
|
||||
#.#.###.#.#####.#.###.#####.###.###.#.###.#.#.#.#.#.#######.###.#.#.#####.#.#####.###.#####.#.###.#.#.#.#.###.#.###########.###.#####.###.###
|
||||
#.#.#...#.....#.#...#.....#...#.#...#...#.#...#.#...#.......#...#.#.#.....#.....#.###.....#.#...#.#.#.#...#...#...........#...#.....#.#...###
|
||||
#.#.#.#######.#.###.#####.###.#.#.#####.#.#####.#####.#######.###.#.#.#########.#.#######.#.###.#.#.#.#####.#############.###.#####.#.#.#####
|
||||
#.#...#.....#.#.#...#...#...#...#.#...#.#...#...#.....#.....#...#.#.#.......#...#...#...#.#.....#.#.#.#.....#.............#...#.....#.#.#...#
|
||||
#.#####.###.#.#.#.###.#.###.#####.#.#.#.###.#.###.#####.###.###.#.#.#######.#.#####.#.#.#.#######.#.#.#.#####.#############.###.#####.#.#.#.#
|
||||
#.#...#.#...#...#.....#.....#.....#.#.#.#...#...#.#...#...#.....#.#.#.....#.#.....#...#.#...#.....#.#.#.....#.#...###...###.#...#...#.#.#.#.#
|
||||
#.#.#.#.#.###################.#####.#.#.#.#####.#.#.#.###.#######.#.#.###.#.#####.#####.###.#.#####.#.#####.#.#.#.###.#.###.#.###.#.#.#.#.#.#
|
||||
#.#.#...#.................#...#...#.#.#.#.#.....#.#.#.###.......#.#.#...#...#...#...#...#...#.#.....#.#...#.#.#.#.....#.....#.....#...#...#.#
|
||||
#.#.#####################.#.###.#.#.#.#.#.#.#####.#.#.#########.#.#.###.#####.#.###.#.###.###.#.#####.#.#.#.#.#.###########################.#
|
||||
#.#.....#.................#.###.#.#.#.#.#.#...#...#.#...#...#...#.#.#...#...#.#.#...#...#...#.#...#...#.#.#.#.#.#.....#.......#.....#...#...#
|
||||
#.#####.#.#################.###.#.#.#.#.#.###.#.###.###.#.#.#.###.#.#.###.#.#.#.#.#####.###.#.###.#.###.#.#.#.#.#.###.#.#####.#.###.#.#.#.###
|
||||
#.#.....#.................#.....#.#.#.#.#...#.#...#...#.#.#.#...#.#.#.###.#.#.#.#...#...#...#...#.#.....#.#.#...#...#.#.....#...#...#.#.#...#
|
||||
#.#.#####################.#######.#.#.#.###.#.###.###.#.#.#.###.#.#.#.###.#.#.#.###.#.###.#####.#.#######.#.#######.#.#####.#####.###.#.###.#
|
||||
#...###.......#...#.....#.......#...#.#.#...#...#...#.#...#.#...#.#.#.#...#.#.#...#.#.#...#.....#...#...#.#.#.......#.#...#.....#.....#.....#
|
||||
#######.#####.#.#.#.###.#######.#####.#.#.#####.###.#.#####.#.###.#.#.#.###.#.###.#.#.#.###.#######.#.#.#.#.#.#######.#.#.#####.#############
|
||||
#.....#.....#...#.#...#.......#.....#.#.#.#...#...#.#...#...#...#.#.#.#.#...#...#.#.#.#.#...###...#...#.#...#.....###...#.......#...........#
|
||||
#.###.#####.#####.###.#######.#####.#.#.#.#.#.###.#.###.#.#####.#.#.#.#.#.#####.#.#.#.#.#.#####.#.#####.#########.###############.#########.#
|
||||
#.#...#...#.....#.....#.....#...###.#.#.#.#.#...#.#...#.#.....#.#...#.#.#...#...#.#.#.#.#...#...#...#...#.......#...###...#...###.#.....#...#
|
||||
#.#.###.#.#####.#######.###.###.###.#.#.#.#.###.#.###.#.#####.#.#####.#.###.#.###.#.#.#.###.#.#####.#.###.#####.###.###.#.#.#.###.#.###.#.###
|
||||
#.#.#...#.......#.....#.###...#...#.#.#.#...###...###.#...#...#.###...#...#.#.#...#.#.#...#.#.....#...###.....#...#...#.#...#.....#...#.#...#
|
||||
#.#.#.###########.###.#.#####.###.#.#.#.#############.###.#.###.###.#####.#.#.#.###.#.###.#.#####.###########.###.###.#.#############.#.###.#
|
||||
#.#.#.....#.....#.#...#.#...#...#...#.#.............#...#.#...#...#...#...#.#.#...#.#...#.#.#.....###.........###...#...#...#...#...#.#...#.#
|
||||
#.#.#####.#.###.#.#.###.#.#.###.#####.#############.###.#.###.###.###.#.###.#.###.#.###.#.#.#.#######.#############.#####.#.#.#.#.#.#.###.#.#
|
||||
#.#.......#.###.#.#.#...#.#.....#...#...#...#.....#.#...#.#...#...#...#.#...#.###.#...#.#.#.#.#.......#...........#.#...#.#...#...#.#...#...#
|
||||
#.#########.###.#.#.#.###.#######.#.###.#.#.#.###.#.#.###.#.###.###.###.#.###.###.###.#.#.#.#.#.#######.#########.#.#.#.#.#########.###.#####
|
||||
#.........#...#.#.#.#.###...#...#.#...#...#.#...#...#...#.#...#...#.#...#...#.#...#...#.#.#.#.#.#.......#.........#...#.#...#...###.....#...#
|
||||
#########.###.#.#.#.#.#####.#.#.#.###.#####.###.#######.#.###.###.#.#.#####.#.#.###.###.#.#.#.#.#.#######.#############.###.#.#.#########.#.#
|
||||
#.........#...#.#.#...#...#...#...#...#...#...#...#.....#.###.#...#.#.###...#.#.#...###.#.#.#.#...###...#...#...#...###...#...#.#...###...#.#
|
||||
#.#########.###.#.#####.#.#########.###.#.###.###.#.#####.###.#.###.#.###.###.#.#.#####.#.#.#.#######.#.###.#.#.#.#.#####.#####.#.#.###.###.#
|
||||
#...#.....#...#...#.....#.....###...###.#...#.#...#...#...#...#.#...#...#...#.#...#...#.#.#...#.......#.....#.#...#.....#.#...#.#.#...#.#...#
|
||||
###.#.###.###.#####.#########.###.#####.###.#.#.#####.#.###.###.#.#####.###.#.#####.#.#.#.#####.#############.#########.#.#.#.#.#.###.#.#.###
|
||||
#...#...#...#.....#.....#...#...#.......#...#...#...#.#.#...#...#...#...#...#.....#.#...#.#...#...#...#...###.#.....#...#.#.#...#.#...#.#.###
|
||||
#.#####.###.#####.#####.#.#.###.#########.#######.#.#.#.#.###.#####.#.###.#######.#.#####.#.#.###.#.#.#.#.###.#.###.#.###.#.#####.#.###.#.###
|
||||
#.......###.......#...#...#...#...........#...#...#.#.#.#...#.....#.#.#...#...#...#.#...#.#.#.....#.#.#.#.....#...#.#...#.#.......#.#...#...#
|
||||
###################.#.#######.#############.#.#.###.#.#.###.#####.#.#.#.###.#.#.###.#.#.#.#.#######.#.#.#########.#.###.#.#########.#.#####.#
|
||||
#...###...#...#...#.#.###...#.......#...###.#...#S..#...#...#...#.#.#.#...#.#.#.###...#.#.#.....#...#...#...#.....#.#...#.........#...#.....#
|
||||
#.#.###.#.#.#.#.#.#.#.###.#.#######.#.#.###.#############.###.#.#.#.#.###.#.#.#.#######.#.#####.#.#######.#.#.#####.#.###########.#####.#####
|
||||
#.#.....#...#...#...#.....#.........#.#.....#############...#.#.#.#.#.#...#.#.#.#.....#...#...#...###.....#...#...#.#...........#...#...#...#
|
||||
#.###################################.#####################.#.#.#.#.#.#.###.#.#.#.###.#####.#.#######.#########.#.#.###########.###.#.###.#.#
|
||||
#.#.....#...#.......#.................#####################...#.#.#.#.#.#...#...#...#.#.....#...#.....#...#...#.#.#.............#...#.....#.#
|
||||
#.#.###.#.#.#.#####.#.#########################################.#.#.#.#.#.#########.#.#.#######.#.#####.#.#.#.#.#.###############.#########.#
|
||||
#.#...#.#.#.#.#.....#.#....E###################################...#.#.#...#...#.....#...#.....#.#.......#...#...#...#...#.......#.#...#.....#
|
||||
#.###.#.#.#.#.#.#####.#.###########################################.#.#####.#.#.#########.###.#.###################.#.#.#.#####.#.#.#.#.#####
|
||||
#...#.#...#.#.#.......#.......###################################...#.#.....#...#...#.....#...#...#.................#.#...#...#.#.#.#.#.....#
|
||||
###.#.#####.#.###############.###################################.###.#.#########.#.#.#####.#####.#.#################.#####.#.#.#.#.#.#####.#
|
||||
###...#...#.#.#...............###################################.....#.#...#.....#...#...#.....#.#.................#...#...#...#...#...#...#
|
||||
#######.#.#.#.#.#######################################################.#.#.#.#########.#.#####.#.#################.###.#.#############.#.###
|
||||
###...#.#.#...#...#...#.......#####################################...#...#.#.#.........#.......#.###...............#...#.......#...###...###
|
||||
###.#.#.#.#######.#.#.#.#####.#####################################.#.#####.#.#.#################.###.###############.#########.#.#.#########
|
||||
#...#...#.........#.#.#.#.....#.....#############...#...........#...#.###...#.#.........#...#...#...#.........#.......#...#.....#.#.#...#...#
|
||||
#.#################.#.#.#.#####.###.#############.#.#.#########.#.###.###.###.#########.#.#.#.#.###.#########.#.#######.#.#.#####.#.#.#.#.#.#
|
||||
#.#...#.........#...#...#.....#.###.....#...#.....#...#.........#...#...#.....#.........#.#.#.#...#...........#.#.......#...#...#.#.#.#.#.#.#
|
||||
#.#.#.#.#######.#.###########.#.#######.#.#.#.#########.###########.###.#######.#########.#.#.###.#############.#.###########.#.#.#.#.#.#.#.#
|
||||
#...#...#.......#.#...#...###...#.......#.#.#.#.........#...#...###.#...#...#...#.....#...#.#...#...............#...#...#.....#.#.#.#.#.#.#.#
|
||||
#########.#######.#.#.#.#.#######.#######.#.#.#.#########.#.#.#.###.#.###.#.#.###.###.#.###.###.###################.#.#.#.#####.#.#.#.#.#.#.#
|
||||
#.......#.......#.#.#...#.......#.........#...#...........#...#.#...#.#...#.#.....###.#...#.....#...............#...#.#...#.....#.#.#.#...#.#
|
||||
#.#####.#######.#.#.###########.###############################.#.###.#.###.#########.###.#######.#############.#.###.#####.#####.#.#.#####.#
|
||||
#.#...#.......#...#...........#.#.........#...#...#.......#.....#...#...#...#...###...#...###.....#...#.......#...#...#...#.#.....#...#...#.#
|
||||
#.#.#.#######.###############.#.#.#######.#.#.#.#.#.#####.#.#######.#####.###.#.###.###.#####.#####.#.#.#####.#####.###.#.#.#.#########.#.#.#
|
||||
#...#.......#.###.............#.#.......#...#...#.#...###.#...#...#.....#...#.#...#...#.....#.#...#.#...#.....#...#.#...#...#.....#.....#...#
|
||||
###########.#.###.#############.#######.#########.###.###.###.#.#.#####.###.#.###.###.#####.#.#.#.#.#####.#####.#.#.#.###########.#.#########
|
||||
#...........#...#...#.....#...#.......#.........#...#...#.....#.#.......#...#...#.###.#...#.#...#...#.....#...#.#.#.#.#...###...#.#.....#...#
|
||||
#.#############.###.#.###.#.#.#######.#########.###.###.#######.#########.#####.#.###.#.#.#.#########.#####.#.#.#.#.#.#.#.###.#.#.#####.#.#.#
|
||||
#.............#.###...#...#.#.......#...........###.#...#.....#.......#...#.....#...#...#...#...###...#...#.#.#.#...#...#.....#...#...#...#.#
|
||||
#############.#.#######.###.#######.###############.#.###.###.#######.#.###.#######.#########.#.###.###.#.#.#.#.###################.#.#####.#
|
||||
#.............#.#.......#...###...#.#...#...###...#.#.###.#...###...#.#.###...#.....#...#...#.#...#.....#...#...#...........#...#...#.......#
|
||||
#.#############.#.#######.#####.#.#.#.#.#.#.###.#.#.#.###.#.#####.#.#.#.#####.#.#####.#.#.#.#.###.###############.#########.#.#.#.###########
|
||||
#.........#...#.#.........#...#.#.#...#...#...#.#.#...#...#...#...#.#.#...#...#...#...#.#.#.#...#.#...###...#...#.........#...#...#####.....#
|
||||
#########.#.#.#.###########.#.#.#.###########.#.#.#####.#####.#.###.#.###.#.#####.#.###.#.#.###.#.#.#.###.#.#.#.#########.#############.###.#
|
||||
#.......#...#.#.###.........#...#.....#...#...#.#...###...#...#...#.#...#.#...#...#...#.#.#.#...#...#.....#...#.#...#...#...........#...#...#
|
||||
#.#####.#####.#.###.#################.#.#.#.###.###.#####.#.#####.#.###.#.###.#.#####.#.#.#.#.#################.#.#.#.#.###########.#.###.###
|
||||
#.....#.#.....#...#.................#.#.#.#...#.#...#...#.#.#...#.#.#...#.#...#...#...#...#.#.........#...#...#...#...#.............#...#...#
|
||||
#####.#.#.#######.#################.#.#.#.###.#.#.###.#.#.#.#.#.#.#.#.###.#.#####.#.#######.#########.#.#.#.#.#########################.###.#
|
||||
#...#.#.#.......#...###.............#...#.#...#.#.###.#.#.#.#.#.#.#.#...#.#.#...#.#.......#.###...###...#...#.........###.....#...#...#.#...#
|
||||
#.#.#.#.#######.###.###.#################.#.###.#.###.#.#.#.#.#.#.#.###.#.#.#.#.#.#######.#.###.#.###################.###.###.#.#.#.#.#.#.###
|
||||
#.#.#.#.#.....#...#.....#.....#.....#...#...#...#...#.#.#.#.#.#...#...#.#.#.#.#...#...#...#.#...#...................#.....#...#.#.#.#.#.#...#
|
||||
#.#.#.#.#.###.###.#######.###.#.###.#.#.#####.#####.#.#.#.#.#.#######.#.#.#.#.#####.#.#.###.#.#####################.#######.###.#.#.#.#.###.#
|
||||
#.#...#.#...#.###.......#...#...###...#.#...#.....#.#.#.#.#.#.....#...#.#...#.#...#.#.#...#.#...............#...###.......#.....#...#...#...#
|
||||
#.#####.###.#.#########.###.###########.#.#.#####.#.#.#.#.#.#####.#.###.#####.#.#.#.#.###.#.###############.#.#.#########.###############.###
|
||||
#.#...#.....#...........#...#...........#.#.###...#.#.#.#.#...#...#...#.#...#...#.#.#...#.#...#...###...#...#.#.#.......#.#...#...#...#...###
|
||||
#.#.#.###################.###.###########.#.###.###.#.#.#.###.#.#####.#.#.#.#####.#.###.#.###.#.#.###.#.#.###.#.#.#####.#.#.#.#.#.#.#.#.#####
|
||||
#.#.#.......#.......#...#...#...#...#...#.#...#...#...#...#...#...#...#...#.#.....#.#...#...#...#.#...#...###.#.#.#.....#...#.#.#.#.#.#.....#
|
||||
#.#.#######.#.#####.#.#.###.###.#.#.#.#.#.###.###.#########.#####.#.#######.#.#####.#.#####.#####.#.#########.#.#.#.#########.#.#.#.#.#####.#
|
||||
#...#.......#.#.....#.#.....###...#...#.#.#...###.#...#...#.#.....#.#...#...#.#...#.#...###...#...#...........#...#.........#.#.#.#.#.......#
|
||||
#####.#######.#.#####.#################.#.#.#####.#.#.#.#.#.#.#####.#.#.#.###.#.#.#.###.#####.#.###########################.#.#.#.#.#########
|
||||
#...#...#...#.#.#...#.#.....#...#.......#.#.#...#...#...#.#.#.....#.#.#.#...#.#.#.#.#...#...#.#.#...#...#.......#...........#...#.#.....#...#
|
||||
#.#.###.#.#.#.#.#.#.#.#.###.#.#.#.#######.#.#.#.#########.#.#####.#.#.#.###.#.#.#.#.#.###.#.#.#.#.#.#.#.#.#####.#.###############.#####.#.#.#
|
||||
#.#.....#.#.#.#.#.#...#...#...#...#...#...#...#...#...#...#...#...#...#...#.#.#.#.#.#.#...#.#.#...#.#.#.#...#...#...............#.#...#...#.#
|
||||
#.#######.#.#.#.#.#######.#########.#.#.#########.#.#.#.#####.#.#########.#.#.#.#.#.#.#.###.#.#####.#.#.###.#.#################.#.#.#.#####.#
|
||||
#...#...#.#...#.#.#.......#.......#.#...#.........#.#.#...#...#.###.......#.#.#.#.#.#.#.#...#...#...#.#...#.#...#...............#.#.#.#...#.#
|
||||
###.#.#.#.#####.#.#.#######.#####.#.#####.#########.#.###.#.###.###.#######.#.#.#.#.#.#.#.#####.#.###.###.#.###.#.###############.#.#.#.#.#.#
|
||||
#...#.#.#.#.....#.#.#.....#.#.....#...###.#...#...#.#.#...#...#...#.....#...#.#.#.#.#...#.#.....#...#...#...###.#.....#...###...#...#...#.#.#
|
||||
#.###.#.#.#.#####.#.#.###.#.#.#######.###.#.#.#.#.#.#.#.#####.###.#####.#.###.#.#.#.#####.#.#######.###.#######.#####.#.#.###.#.#########.#.#
|
||||
#.#...#.#.#.....#.#.#...#.#.#...#...#...#.#.#.#.#.#.#.#.#.....#...#.....#...#...#...#...#.#.#.....#...#.......#.#...#...#.....#.........#...#
|
||||
#.#.###.#.#####.#.#.###.#.#.###.#.#.###.#.#.#.#.#.#.#.#.#.#####.###.#######.#########.#.#.#.#.###.###.#######.#.#.#.###################.#####
|
||||
#.#...#.#.#.....#.#...#.#.#.#...#.#.#...#...#.#.#.#.#.#.#...#...#...#...#...#.........#...#...#...#...#.....#.#.#.#.#...#...#...#.....#.....#
|
||||
#.###.#.#.#.#####.###.#.#.#.#.###.#.#.#######.#.#.#.#.#.###.#.###.###.#.#.###.#################.###.###.###.#.#.#.#.#.#.#.#.#.#.#.###.#####.#
|
||||
#.#...#...#.#...#.###.#.#...#.....#.#.....#...#.#...#.#...#.#...#.#...#.#.###...#...#...#...#...#...#...###.#.#...#.#.#...#.#.#.#...#.......#
|
||||
#.#.#######.#.#.#.###.#.###########.#####.#.###.#####.###.#.###.#.#.###.#.#####.#.#.#.#.#.#.#.###.###.#####.#.#####.#.#####.#.#.###.#########
|
||||
#.#.###.....#.#.#.#...#.#...........#.....#...#.#.....#...#...#.#...#...#.#.....#.#.#.#.#.#.#.###.#...#.....#.#.....#.....#...#...#...#.....#
|
||||
#.#.###.#####.#.#.#.###.#.###########.#######.#.#.#####.#####.#.#####.###.#.#####.#.#.#.#.#.#.###.#.###.#####.#.#########.#######.###.#.###.#
|
||||
#...#...#...#.#...#...#.#.....#.....#.......#.#.#.....#...#...#.....#...#.#.#.....#...#.#.#.#...#.#.#...#...#.#.#...#.....###...#.#...#.#...#
|
||||
#####.###.#.#.#######.#.#####.#.###.#######.#.#.#####.###.#.#######.###.#.#.#.#########.#.#.###.#.#.#.###.#.#.#.#.#.#.#######.#.#.#.###.#.###
|
||||
#.....#...#.#.#.......#.###...#.#...#...#...#.#.#.....#...#.#...#...###...#.#.#.........#.#.#...#...#.#...#.#.#.#.#.#.......#.#.#...#...#...#
|
||||
#.#####.###.#.#.#######.###.###.#.###.#.#.###.#.#.#####.###.#.#.#.#########.#.#.#########.#.#.#######.#.###.#.#.#.#.#######.#.#.#####.#####.#
|
||||
#...#...#...#.#.........#...#...#...#.#.#.###.#.#.#...#.###...#.#.###.....#.#.#...#...#...#.#.#.....#...#...#.#.#.#...#.....#.#.......#...#.#
|
||||
###.#.###.###.###########.###.#####.#.#.#.###.#.#.#.#.#.#######.#.###.###.#.#.###.#.#.#.###.#.#.###.#####.###.#.#.###.#.#####.#########.#.#.#
|
||||
###...###.....#.....#...#...#...###.#.#...#...#.#.#.#.#.......#.#.....#...#...###...#.#.#...#...#...#.....#...#.#.###.#.....#.#...#...#.#.#.#
|
||||
###############.###.#.#.###.###.###.#.#####.###.#.#.#.#######.#.#######.#############.#.#.#######.###.#####.###.#.###.#####.#.#.#.#.#.#.#.#.#
|
||||
#.......###...#...#...#.....#...#...#...###...#.#.#.#.#.......#...#...#.......#.......#.#...#...#...#...#...#...#.#...#...#...#.#...#...#...#
|
||||
#.#####.###.#.###.###########.###.#####.#####.#.#.#.#.#.#########.#.#.#######.#.#######.###.#.#.###.###.#.###.###.#.###.#.#####.#############
|
||||
#.....#.#...#.#...#...#...#...###.....#.#.....#.#.#.#.#.........#.#.#.#...#...#...#...#...#.#.#...#...#.#...#.#...#.#...#.#...#.............#
|
||||
#####.#.#.###.#.###.#.#.#.#.#########.#.#.#####.#.#.#.#########.#.#.#.#.#.#.#####.#.#.###.#.#.###.###.#.###.#.#.###.#.###.#.#.#############.#
|
||||
#...#.#.#.#...#.#...#.#.#.#.....#.....#.#...#...#...#...#...#...#.#.#.#.#.#...###...#.#...#...#...#...#.#...#.#.#...#...#.#.#.#.........#...#
|
||||
#.#.#.#.#.#.###.#.###.#.#.#####.#.#####.###.#.#########.#.#.#.###.#.#.#.#.###.#######.#.#######.###.###.#.###.#.#.#####.#.#.#.#.#######.#.###
|
||||
#.#...#.#.#.....#...#.#.#.#.....#.....#.#...#.#...#.....#.#...###.#.#.#.#.#...#.......#.......#.#...###.#.#...#.#...#...#.#.#.#.......#...###
|
||||
#.#####.#.#########.#.#.#.#.#########.#.#.###.#.#.#.#####.#######.#.#.#.#.#.###.#############.#.#.#####.#.#.###.###.#.###.#.#.#######.#######
|
||||
#.....#...#.....#...#.#.#.#.#.........#.#...#...#.#.....#.......#...#.#.#.#...#.#.......#...#.#.#.....#...#.#...###...#...#.#.#.....#.......#
|
||||
#####.#####.###.#.###.#.#.#.#.#########.###.#####.#####.#######.#####.#.#.###.#.#.#####.#.#.#.#.#####.#####.#.#########.###.#.#.###.#######.#
|
||||
#.....#...#.#...#...#.#.#.#.#...#...#...#...#...#.....#...#...#.#.....#.#.#...#.#.#.....#.#.#.#.#...#...#...#.....#.....#...#.#...#...#...#.#
|
||||
#.#####.#.#.#.#####.#.#.#.#.###.#.#.#.###.###.#.#####.###.#.#.#.#.#####.#.#.###.#.#.#####.#.#.#.#.#.###.#.#######.#.#####.###.###.###.#.#.#.#
|
||||
#.......#...#.......#...#...###...#...###.....#.......###...#...#.......#...###...#.......#...#...#.....#.........#.......###.....###...#...#
|
||||
#############################################################################################################################################
|
||||
@@ -0,0 +1,118 @@
|
||||
--- Day 21: Keypad Conundrum ---
|
||||
|
||||
As you teleport onto Santa's Reindeer-class starship, The Historians begin to panic: someone from their search party is missing. A quick life-form scan by the ship's computer reveals that when the missing Historian teleported, he arrived in another part of the ship.
|
||||
|
||||
The door to that area is locked, but the computer can't open it; it can only be opened by physically typing the door codes (your puzzle input) on the numeric keypad on the door.
|
||||
|
||||
The numeric keypad has four rows of buttons: 789, 456, 123, and finally an empty gap followed by 0A. Visually, they are arranged like this:
|
||||
|
||||
+---+---+---+
|
||||
| 7 | 8 | 9 |
|
||||
+---+---+---+
|
||||
| 4 | 5 | 6 |
|
||||
+---+---+---+
|
||||
| 1 | 2 | 3 |
|
||||
+---+---+---+
|
||||
| 0 | A |
|
||||
+---+---+
|
||||
|
||||
Unfortunately, the area outside the door is currently depressurized and nobody can go near the door. A robot needs to be sent instead.
|
||||
|
||||
The robot has no problem navigating the ship and finding the numeric keypad, but it's not designed for button pushing: it can't be told to push a specific button directly. Instead, it has a robotic arm that can be controlled remotely via a directional keypad.
|
||||
|
||||
The directional keypad has two rows of buttons: a gap / ^ (up) / A (activate) on the first row and < (left) / v (down) / > (right) on the second row. Visually, they are arranged like this:
|
||||
|
||||
+---+---+
|
||||
| ^ | A |
|
||||
+---+---+---+
|
||||
| < | v | > |
|
||||
+---+---+---+
|
||||
|
||||
When the robot arrives at the numeric keypad, its robotic arm is pointed at the A button in the bottom right corner. After that, this directional keypad remote control must be used to maneuver the robotic arm: the up / down / left / right buttons cause it to move its arm one button in that direction, and the A button causes the robot to briefly move forward, pressing the button being aimed at by the robotic arm.
|
||||
|
||||
For example, to make the robot type 029A on the numeric keypad, one sequence of inputs on the directional keypad you could use is:
|
||||
|
||||
< to move the arm from A (its initial position) to 0.
|
||||
A to push the 0 button.
|
||||
^A to move the arm to the 2 button and push it.
|
||||
>^^A to move the arm to the 9 button and push it.
|
||||
vvvA to move the arm to the A button and push it.
|
||||
|
||||
In total, there are three shortest possible sequences of button presses on this directional keypad that would cause the robot to type 029A: <A^A>^^AvvvA, <A^A^>^AvvvA, and <A^A^^>AvvvA.
|
||||
|
||||
Unfortunately, the area containing this directional keypad remote control is currently experiencing high levels of radiation and nobody can go near it. A robot needs to be sent instead.
|
||||
|
||||
When the robot arrives at the directional keypad, its robot arm is pointed at the A button in the upper right corner. After that, a second, different directional keypad remote control is used to control this robot (in the same way as the first robot, except that this one is typing on a directional keypad instead of a numeric keypad).
|
||||
|
||||
There are multiple shortest possible sequences of directional keypad button presses that would cause this robot to tell the first robot to type 029A on the door. One such sequence is v<<A>>^A<A>AvA<^AA>A<vAAA>^A.
|
||||
|
||||
Unfortunately, the area containing this second directional keypad remote control is currently -40 degrees! Another robot will need to be sent to type on that directional keypad, too.
|
||||
|
||||
There are many shortest possible sequences of directional keypad button presses that would cause this robot to tell the second robot to tell the first robot to eventually type 029A on the door. One such sequence is <vA<AA>>^AvAA<^A>A<v<A>>^AvA^A<vA>^A<v<A>^A>AAvA^A<v<A>A>^AAAvA<^A>A.
|
||||
|
||||
Unfortunately, the area containing this third directional keypad remote control is currently full of Historians, so no robots can find a clear path there. Instead, you will have to type this sequence yourself.
|
||||
|
||||
Were you to choose this sequence of button presses, here are all of the buttons that would be pressed on your directional keypad, the two robots' directional keypads, and the numeric keypad:
|
||||
|
||||
<vA<AA>>^AvAA<^A>A<v<A>>^AvA^A<vA>^A<v<A>^A>AAvA^A<v<A>A>^AAAvA<^A>A
|
||||
v<<A>>^A<A>AvA<^AA>A<vAAA>^A
|
||||
<A^A>^^AvvvA
|
||||
029A
|
||||
|
||||
In summary, there are the following keypads:
|
||||
|
||||
One directional keypad that you are using.
|
||||
Two directional keypads that robots are using.
|
||||
One numeric keypad (on a door) that a robot is using.
|
||||
|
||||
It is important to remember that these robots are not designed for button pushing. In particular, if a robot arm is ever aimed at a gap where no button is present on the keypad, even for an instant, the robot will panic unrecoverably. So, don't do that. All robots will initially aim at the keypad's A key, wherever it is.
|
||||
|
||||
To unlock the door, five codes will need to be typed on its numeric keypad. For example:
|
||||
|
||||
029A
|
||||
980A
|
||||
179A
|
||||
456A
|
||||
379A
|
||||
|
||||
For each of these, here is a shortest sequence of button presses you could type to cause the desired code to be typed on the numeric keypad:
|
||||
|
||||
029A: <vA<AA>>^AvAA<^A>A<v<A>>^AvA^A<vA>^A<v<A>^A>AAvA^A<v<A>A>^AAAvA<^A>A
|
||||
980A: <v<A>>^AAAvA^A<vA<AA>>^AvAA<^A>A<v<A>A>^AAAvA<^A>A<vA>^A<A>A
|
||||
179A: <v<A>>^A<vA<A>>^AAvAA<^A>A<v<A>>^AAvA^A<vA>^AA<A>A<v<A>A>^AAAvA<^A>A
|
||||
456A: <v<A>>^AA<vA<A>>^AAvAA<^A>A<vA>^A<A>A<vA>^A<A>A<v<A>A>^AAvA<^A>A
|
||||
379A: <v<A>>^AvA^A<vA<AA>>^AAvA<^A>AAvA^A<vA>^AA<A>A<v<A>A>^AAAvA<^A>A
|
||||
|
||||
The Historians are getting nervous; the ship computer doesn't remember whether the missing Historian is trapped in the area containing a giant electromagnet or molten lava. You'll need to make sure that for each of the five codes, you find the shortest sequence of button presses necessary.
|
||||
|
||||
The complexity of a single code (like 029A) is equal to the result of multiplying these two values:
|
||||
|
||||
The length of the shortest sequence of button presses you need to type on your directional keypad in order to cause the code to be typed on the numeric keypad; for 029A, this would be 68.
|
||||
The numeric part of the code (ignoring leading zeroes); for 029A, this would be 29.
|
||||
|
||||
In the above example, complexity of the five codes can be found by calculating 68 * 29, 60 * 980, 68 * 179, 64 * 456, and 64 * 379. Adding these together produces 126384.
|
||||
|
||||
Find the fewest number of button presses you'll need to perform in order to cause the robot in front of the door to type each code. What is the sum of the complexities of the five codes on your list?
|
||||
|
||||
Your puzzle answer was 211930.
|
||||
--- Part Two ---
|
||||
|
||||
Just as the missing Historian is released, The Historians realize that a second member of their search party has also been missing this entire time!
|
||||
|
||||
A quick life-form scan reveals the Historian is also trapped in a locked area of the ship. Due to a variety of hazards, robots are once again dispatched, forming another chain of remote control keypads managing robotic-arm-wielding robots.
|
||||
|
||||
This time, many more robots are involved. In summary, there are the following keypads:
|
||||
|
||||
One directional keypad that you are using.
|
||||
25 directional keypads that robots are using.
|
||||
One numeric keypad (on a door) that a robot is using.
|
||||
|
||||
The keypads form a chain, just like before: your directional keypad controls a robot which is typing on a directional keypad which controls a robot which is typing on a directional keypad... and so on, ending with the robot which is typing on the numeric keypad.
|
||||
|
||||
The door codes are the same this time around; only the number of robots and directional keypads has changed.
|
||||
|
||||
Find the fewest number of button presses you'll need to perform in order to cause the robot in front of the door to type each code. What is the sum of the complexities of the five codes on your list?
|
||||
|
||||
Your puzzle answer was 263492840501566.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+119
@@ -0,0 +1,119 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys, math
|
||||
from itertools import product
|
||||
|
||||
DIR = {
|
||||
('A', '>'): ['vA'],
|
||||
('A', '^'): ['<A'],
|
||||
('A', 'v'): ['v<A', '<vA'],
|
||||
('A', '<'): ['v<<A'],
|
||||
('A', 'A'): ['A'],
|
||||
('^', '^'): ['A'],
|
||||
('<', '<'): ['A'],
|
||||
('v', 'v'): ['A'],
|
||||
('>', '>'): ['A'],
|
||||
('^', 'A'): ['>A'],
|
||||
('^', '>'): ['v>A', '>vA'],
|
||||
('^', 'v'): ['vA'],
|
||||
('^', '<'): ['v<A'],
|
||||
('<', 'A'): ['>>^A'],
|
||||
('<', '^'): ['>^A'],
|
||||
('<', 'v'): ['>A'],
|
||||
('<', '>'): ['>>A'],
|
||||
('v', 'A'): ['>^A', '^>A'],
|
||||
('v', '^'): ['^A'],
|
||||
('v', '<'): ['<A'],
|
||||
('v', '>'): ['>A'],
|
||||
('>', 'A'): ['^A'],
|
||||
('>', '<'): ['<<A'],
|
||||
('>', '^'): ['<^A', '^<A'],
|
||||
('>', 'v'): ['<A'],
|
||||
}
|
||||
|
||||
NUM = {
|
||||
'A': (0,2),
|
||||
'0': (0,1),
|
||||
'1': (1,0),
|
||||
'2': (1,1),
|
||||
'3': (1,2),
|
||||
'4': (2,0),
|
||||
'5': (2,1),
|
||||
'6': (2,2),
|
||||
'7': (3,0),
|
||||
'8': (3,1),
|
||||
'9': (3,2),
|
||||
}
|
||||
|
||||
|
||||
def memo(f):
|
||||
memo = {}
|
||||
|
||||
def f2(x,y):
|
||||
if (tuple(x),y) not in memo: memo[(tuple(x),y)] = f(x,y)
|
||||
return memo[(tuple(x),y)]
|
||||
return f2
|
||||
|
||||
|
||||
def options(start, end, pad):
|
||||
s, e = pad[start], pad[end]
|
||||
d = {'^': (1,0), 'v': (-1,0), '>': (0,1), '<': (0,-1)}
|
||||
dy = e[0]-s[0]
|
||||
dx = e[1]-s[1]
|
||||
opt = ['^'] * dy + ['v'] * -dy + ['<'] * -dx + ['>'] * dx
|
||||
for o in [tuple(opt), tuple(reversed(opt))]:
|
||||
s, e = pad[start], pad[end]
|
||||
gap = False
|
||||
for step in list(o):
|
||||
s = s[0] + d[step][0], s[1] + d[step][1]
|
||||
if s == (0,0): gap = True
|
||||
if not gap: yield ''.join(o+('A',))
|
||||
|
||||
|
||||
def numeric(code):
|
||||
strings = ['']
|
||||
prev = 'A'
|
||||
for key in list(code):
|
||||
strings = [s1+s2 for (s1,s2) in product(strings,[opt for opt in options(prev, key, NUM)])]
|
||||
prev = key
|
||||
return strings
|
||||
|
||||
# reddit solution... (prevKey is 'A' the first time)
|
||||
def buildSeq(keys, index, prevKey, currPath, result):
|
||||
if index == len(keys):
|
||||
result.append(currPath)
|
||||
return
|
||||
for path in DIR[(prevKey,keys[index])]:
|
||||
buildSeq(keys, index+1, keys[index], currPath + path, result)
|
||||
|
||||
|
||||
@memo
|
||||
def shortestSeq(keys, depth):
|
||||
if depth == 0: return len(keys)
|
||||
total = 0
|
||||
subKeys = keys.split('A')
|
||||
for subKey in subKeys[:-1]:
|
||||
seqs = []
|
||||
buildSeq(subKey+'A', 0, 'A', '', seqs)
|
||||
minimum = min([shortestSeq(seq, depth-1) for seq in seqs])
|
||||
total += minimum
|
||||
return total
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
codes = [line.strip('\n') for line in open(sys.argv[1])]
|
||||
res1, res2 = 0, 0
|
||||
for code in codes:
|
||||
dirs = set(numeric(code))
|
||||
l1, l2 = math.inf, math.inf
|
||||
for d in dirs: l1 = min(shortestSeq(d,2), l1)
|
||||
res1 += l1 * int(code[:-1])
|
||||
for d in dirs: l2 = min(shortestSeq(d,25), l2)
|
||||
res2 += l2 * int(code[:-1])
|
||||
|
||||
# challenge 1
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
029A
|
||||
980A
|
||||
179A
|
||||
456A
|
||||
379A
|
||||
@@ -0,0 +1,5 @@
|
||||
985A
|
||||
540A
|
||||
463A
|
||||
671A
|
||||
382A
|
||||
@@ -0,0 +1,126 @@
|
||||
--- Day 22: Monkey Market ---
|
||||
|
||||
As you're all teleported deep into the jungle, a monkey steals The Historians' device! You'll need to get it back while The Historians are looking for the Chief.
|
||||
|
||||
The monkey that stole the device seems willing to trade it, but only in exchange for an absurd number of bananas. Your only option is to buy bananas on the Monkey Exchange Market.
|
||||
|
||||
You aren't sure how the Monkey Exchange Market works, but one of The Historians senses trouble and comes over to help. Apparently, they've been studying these monkeys for a while and have deciphered their secrets.
|
||||
|
||||
Today, the Market is full of monkeys buying good hiding spots. Fortunately, because of the time you recently spent in this jungle, you know lots of good hiding spots you can sell! If you sell enough hiding spots, you should be able to get enough bananas to buy the device back.
|
||||
|
||||
On the Market, the buyers seem to use random prices, but their prices are actually only pseudorandom! If you know the secret of how they pick their prices, you can wait for the perfect time to sell.
|
||||
|
||||
The part about secrets is literal, the Historian explains. Each buyer produces a pseudorandom sequence of secret numbers where each secret is derived from the previous.
|
||||
|
||||
In particular, each buyer's secret number evolves into the next secret number in the sequence via the following process:
|
||||
|
||||
Calculate the result of multiplying the secret number by 64. Then, mix this result into the secret number. Finally, prune the secret number.
|
||||
Calculate the result of dividing the secret number by 32. Round the result down to the nearest integer. Then, mix this result into the secret number. Finally, prune the secret number.
|
||||
Calculate the result of multiplying the secret number by 2048. Then, mix this result into the secret number. Finally, prune the secret number.
|
||||
|
||||
Each step of the above process involves mixing and pruning:
|
||||
|
||||
To mix a value into the secret number, calculate the bitwise XOR of the given value and the secret number. Then, the secret number becomes the result of that operation. (If the secret number is 42 and you were to mix 15 into the secret number, the secret number would become 37.)
|
||||
To prune the secret number, calculate the value of the secret number modulo 16777216. Then, the secret number becomes the result of that operation. (If the secret number is 100000000 and you were to prune the secret number, the secret number would become 16113920.)
|
||||
|
||||
After this process completes, the buyer is left with the next secret number in the sequence. The buyer can repeat this process as many times as necessary to produce more secret numbers.
|
||||
|
||||
So, if a buyer had a secret number of 123, that buyer's next ten secret numbers would be:
|
||||
|
||||
15887950
|
||||
16495136
|
||||
527345
|
||||
704524
|
||||
1553684
|
||||
12683156
|
||||
11100544
|
||||
12249484
|
||||
7753432
|
||||
5908254
|
||||
|
||||
Each buyer uses their own secret number when choosing their price, so it's important to be able to predict the sequence of secret numbers for each buyer. Fortunately, the Historian's research has uncovered the initial secret number of each buyer (your puzzle input). For example:
|
||||
|
||||
1
|
||||
10
|
||||
100
|
||||
2024
|
||||
|
||||
This list describes the initial secret number of four different secret-hiding-spot-buyers on the Monkey Exchange Market. If you can simulate secret numbers from each buyer, you'll be able to predict all of their future prices.
|
||||
|
||||
In a single day, buyers each have time to generate 2000 new secret numbers. In this example, for each buyer, their initial secret number and the 2000th new secret number they would generate are:
|
||||
|
||||
1: 8685429
|
||||
10: 4700978
|
||||
100: 15273692
|
||||
2024: 8667524
|
||||
|
||||
Adding up the 2000th new secret number for each buyer produces 37327623.
|
||||
|
||||
For each buyer, simulate the creation of 2000 new secret numbers. What is the sum of the 2000th secret number generated by each buyer?
|
||||
|
||||
Your puzzle answer was 12664695565.
|
||||
--- Part Two ---
|
||||
|
||||
Of course, the secret numbers aren't the prices each buyer is offering! That would be ridiculous. Instead, the prices the buyer offers are just the ones digit of each of their secret numbers.
|
||||
|
||||
So, if a buyer starts with a secret number of 123, that buyer's first ten prices would be:
|
||||
|
||||
3 (from 123)
|
||||
0 (from 15887950)
|
||||
6 (from 16495136)
|
||||
5 (etc.)
|
||||
4
|
||||
4
|
||||
6
|
||||
4
|
||||
4
|
||||
2
|
||||
|
||||
This price is the number of bananas that buyer is offering in exchange for your information about a new hiding spot. However, you still don't speak monkey, so you can't negotiate with the buyers directly. The Historian speaks a little, but not enough to negotiate; instead, he can ask another monkey to negotiate on your behalf.
|
||||
|
||||
Unfortunately, the monkey only knows how to decide when to sell by looking at the changes in price. Specifically, the monkey will only look for a specific sequence of four consecutive changes in price, then immediately sell when it sees that sequence.
|
||||
|
||||
So, if a buyer starts with a secret number of 123, that buyer's first ten secret numbers, prices, and the associated changes would be:
|
||||
|
||||
123: 3
|
||||
15887950: 0 (-3)
|
||||
16495136: 6 (6)
|
||||
527345: 5 (-1)
|
||||
704524: 4 (-1)
|
||||
1553684: 4 (0)
|
||||
12683156: 6 (2)
|
||||
11100544: 4 (-2)
|
||||
12249484: 4 (0)
|
||||
7753432: 2 (-2)
|
||||
|
||||
Note that the first price has no associated change because there was no previous price to compare it with.
|
||||
|
||||
In this short example, within just these first few prices, the highest price will be 6, so it would be nice to give the monkey instructions that would make it sell at that time. The first 6 occurs after only two changes, so there's no way to instruct the monkey to sell then, but the second 6 occurs after the changes -1,-1,0,2. So, if you gave the monkey that sequence of changes, it would wait until the first time it sees that sequence and then immediately sell your hiding spot information at the current price, winning you 6 bananas.
|
||||
|
||||
Each buyer only wants to buy one hiding spot, so after the hiding spot is sold, the monkey will move on to the next buyer. If the monkey never hears that sequence of price changes from a buyer, the monkey will never sell, and will instead just move on to the next buyer.
|
||||
|
||||
Worse, you can only give the monkey a single sequence of four price changes to look for. You can't change the sequence between buyers.
|
||||
|
||||
You're going to need as many bananas as possible, so you'll need to determine which sequence of four price changes will cause the monkey to get you the most bananas overall. Each buyer is going to generate 2000 secret numbers after their initial secret number, so, for each buyer, you'll have 2000 price changes in which your sequence can occur.
|
||||
|
||||
Suppose the initial secret number of each buyer is:
|
||||
|
||||
1
|
||||
2
|
||||
3
|
||||
2024
|
||||
|
||||
There are many sequences of four price changes you could tell the monkey, but for these four buyers, the sequence that will get you the most bananas is -2,1,-1,3. Using that sequence, the monkey will make the following sales:
|
||||
|
||||
For the buyer with an initial secret number of 1, changes -2,1,-1,3 first occur when the price is 7.
|
||||
For the buyer with initial secret 2, changes -2,1,-1,3 first occur when the price is 7.
|
||||
For the buyer with initial secret 3, the change sequence -2,1,-1,3 does not occur in the first 2000 changes.
|
||||
For the buyer starting with 2024, changes -2,1,-1,3 first occur when the price is 9.
|
||||
|
||||
So, by asking the monkey to sell the first time each buyer's prices go down 2, then up 1, then down 1, then up 3, you would get 23 (7 + 7 + 9) bananas!
|
||||
|
||||
Figure out the best sequence to tell the monkey so that by looking for that same sequence of changes in every buyer's future prices, you get the most bananas in total. What is the most bananas you can get?
|
||||
|
||||
Your puzzle answer was 1444.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+48
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
def mix_and_prune(secret, result):
|
||||
return (secret ^ result) % 16777216
|
||||
|
||||
|
||||
def prg(secret):
|
||||
nsec = mix_and_prune(secret, secret * 64)
|
||||
nsec = mix_and_prune(nsec, nsec // 32)
|
||||
return mix_and_prune(nsec, nsec * 2048)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
nums = [int(line.strip('\n')) for line in open(sys.argv[1])]
|
||||
|
||||
# challenge 1
|
||||
res1 = 0
|
||||
changes, values = {}, {}
|
||||
change_set = set([])
|
||||
for n in nums:
|
||||
secret = n
|
||||
changes[n] = [[] for i in range(2000)]
|
||||
values[n] = [0] * 2000
|
||||
ob = int(str(secret)[-1])
|
||||
for i in range(2000):
|
||||
secret = prg(secret)
|
||||
bananas = int(str(secret)[-1])
|
||||
for j in range(i,min(2000,i+4)):
|
||||
changes[n][j].append(bananas - ob)
|
||||
values[n][i] = bananas
|
||||
ob = bananas
|
||||
res1 += secret
|
||||
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2 (could be more efficient i guess)
|
||||
res2 = 0
|
||||
for n in nums:
|
||||
change_set = change_set.union(set([tuple(c) if c[-1] > 1 else () for c in changes[n]]))
|
||||
for c in list(change_set):
|
||||
if c != () and c[-1] > 1 and sum([list(c) in changes[num] for num in nums]) > 100:
|
||||
res2 = max(sum([values[num][changes[num].index(list(c))] if list(c) in changes[num] else 0 for num in nums]), res2)
|
||||
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
1
|
||||
10
|
||||
100
|
||||
2024
|
||||
Loaded 100 of 121 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user