Compare commits
21
Commits
cac6ced738
...
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 |
No files matched your search
@@ -1 +1,2 @@
|
||||
AoC2021/Bene/
|
||||
__pycache__
|
||||
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 @@
|
||||
IIIIIIIXXXXXXXXXXXXXCCCCCCCCCCCCCCCCCCXXXXXXXQQYYYYYYYYYFFFFFFFFFFFSSSSSUUUOOUUUUUUUUMJJJJMMMGGGGGGGGGGQQQQYYYYYYYYYYYYYYYNQQQQNNNNNNNNNNNNN
|
||||
IIIKIIXXXXXXXXXXXXXXCCCCCCCCCCCCCCCCCXXXXXXXXXXYYYYYYYYYYYFFFFFFFFFSSSUUUUUOOUUUUUUUUMJJJJJMMGGGGGGGGGGGGQQQQYYYYYYYYYXYYYNNNNNNNNN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EEEEEEEEEEEEE
|
||||
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^<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^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>^<^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<>^^<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^^<<<^><<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
|
||||
@@ -0,0 +1 @@
|
||||
123
|
||||
@@ -0,0 +1,4 @@
|
||||
1
|
||||
2
|
||||
3
|
||||
2024
|
||||
+1515
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,93 @@
|
||||
--- Day 23: LAN Party ---
|
||||
|
||||
As The Historians wander around a secure area at Easter Bunny HQ, you come across posters for a LAN party scheduled for today! Maybe you can find it; you connect to a nearby datalink port and download a map of the local network (your puzzle input).
|
||||
|
||||
The network map provides a list of every connection between two computers. For example:
|
||||
|
||||
kh-tc
|
||||
qp-kh
|
||||
de-cg
|
||||
ka-co
|
||||
yn-aq
|
||||
qp-ub
|
||||
cg-tb
|
||||
vc-aq
|
||||
tb-ka
|
||||
wh-tc
|
||||
yn-cg
|
||||
kh-ub
|
||||
ta-co
|
||||
de-co
|
||||
tc-td
|
||||
tb-wq
|
||||
wh-td
|
||||
ta-ka
|
||||
td-qp
|
||||
aq-cg
|
||||
wq-ub
|
||||
ub-vc
|
||||
de-ta
|
||||
wq-aq
|
||||
wq-vc
|
||||
wh-yn
|
||||
ka-de
|
||||
kh-ta
|
||||
co-tc
|
||||
wh-qp
|
||||
tb-vc
|
||||
td-yn
|
||||
|
||||
Each line of text in the network map represents a single connection; the line kh-tc represents a connection between the computer named kh and the computer named tc. Connections aren't directional; tc-kh would mean exactly the same thing.
|
||||
|
||||
LAN parties typically involve multiplayer games, so maybe you can locate it by finding groups of connected computers. Start by looking for sets of three computers where each computer in the set is connected to the other two computers.
|
||||
|
||||
In this example, there are 12 such sets of three inter-connected computers:
|
||||
|
||||
aq,cg,yn
|
||||
aq,vc,wq
|
||||
co,de,ka
|
||||
co,de,ta
|
||||
co,ka,ta
|
||||
de,ka,ta
|
||||
kh,qp,ub
|
||||
qp,td,wh
|
||||
tb,vc,wq
|
||||
tc,td,wh
|
||||
td,wh,yn
|
||||
ub,vc,wq
|
||||
|
||||
If the Chief Historian is here, and he's at the LAN party, it would be best to know that right away. You're pretty sure his computer's name starts with t, so consider only sets of three computers where at least one computer's name starts with t. That narrows the list down to 7 sets of three inter-connected computers:
|
||||
|
||||
co,de,ta
|
||||
co,ka,ta
|
||||
de,ka,ta
|
||||
qp,td,wh
|
||||
tb,vc,wq
|
||||
tc,td,wh
|
||||
td,wh,yn
|
||||
|
||||
Find all the sets of three inter-connected computers. How many contain at least one computer with a name that starts with t?
|
||||
|
||||
Your puzzle answer was 1062.
|
||||
--- Part Two ---
|
||||
|
||||
There are still way too many results to go through them all. You'll have to find the LAN party another way and go there yourself.
|
||||
|
||||
Since it doesn't seem like any employees are around, you figure they must all be at the LAN party. If that's true, the LAN party will be the largest set of computers that are all connected to each other. That is, for each computer at the LAN party, that computer will have a connection to every other computer at the LAN party.
|
||||
|
||||
In the above example, the largest set of computers that are all connected to each other is made up of co, de, ka, and ta. Each computer in this set has a connection to every other computer in the set:
|
||||
|
||||
ka-co
|
||||
ta-co
|
||||
de-co
|
||||
ta-ka
|
||||
de-ta
|
||||
ka-de
|
||||
|
||||
The LAN party posters say that the password to get into the LAN party is the name of every computer at the LAN party, sorted alphabetically, then joined together with commas. (The people running the LAN party are clearly a bunch of nerds.) In this example, the password would be co,de,ka,ta.
|
||||
|
||||
What is the password to get into the LAN party?
|
||||
|
||||
Your puzzle answer was bz,cs,fx,ms,oz,po,sy,uh,uv,vw,xu,zj,zm.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import networkx as nx
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pcs = [line.strip('\n').split('-') for line in open(sys.argv[1])]
|
||||
|
||||
d = {}
|
||||
t = set([])
|
||||
for con in pcs:
|
||||
if con[0] in d:
|
||||
d[con[0]].append(con[1])
|
||||
else: d[con[0]] = [con[1]]
|
||||
if con[0].startswith('t'): t.add(con[0])
|
||||
if con[1].startswith('t'): t.add(con[1])
|
||||
G = nx.Graph(d)
|
||||
|
||||
res1 = 0
|
||||
for clique in nx.enumerate_all_cliques(G):
|
||||
if len(clique) == 3 and len(set(clique).intersection(t)) > 0: res1 += 1
|
||||
if len(clique) == 4: break
|
||||
res2 = ','.join(sorted(sorted([c for c in nx.find_cliques(G)],key=len, reverse=True)[0]))
|
||||
|
||||
# challenge 1
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
kh-tc
|
||||
qp-kh
|
||||
de-cg
|
||||
ka-co
|
||||
yn-aq
|
||||
qp-ub
|
||||
cg-tb
|
||||
vc-aq
|
||||
tb-ka
|
||||
wh-tc
|
||||
yn-cg
|
||||
kh-ub
|
||||
ta-co
|
||||
de-co
|
||||
tc-td
|
||||
tb-wq
|
||||
wh-td
|
||||
ta-ka
|
||||
td-qp
|
||||
aq-cg
|
||||
wq-ub
|
||||
ub-vc
|
||||
de-ta
|
||||
wq-aq
|
||||
wq-vc
|
||||
wh-yn
|
||||
ka-de
|
||||
kh-ta
|
||||
co-tc
|
||||
wh-qp
|
||||
tb-vc
|
||||
td-yn
|
||||
+3380
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,200 @@
|
||||
--- Day 24: Crossed Wires ---
|
||||
|
||||
You and The Historians arrive at the edge of a large grove somewhere in the jungle. After the last incident, the Elves installed a small device that monitors the fruit. While The Historians search the grove, one of them asks if you can take a look at the monitoring device; apparently, it's been malfunctioning recently.
|
||||
|
||||
The device seems to be trying to produce a number through some boolean logic gates. Each gate has two inputs and one output. The gates all operate on values that are either true (1) or false (0).
|
||||
|
||||
AND gates output 1 if both inputs are 1; if either input is 0, these gates output 0.
|
||||
OR gates output 1 if one or both inputs is 1; if both inputs are 0, these gates output 0.
|
||||
XOR gates output 1 if the inputs are different; if the inputs are the same, these gates output 0.
|
||||
|
||||
Gates wait until both inputs are received before producing output; wires can carry 0, 1 or no value at all. There are no loops; once a gate has determined its output, the output will not change until the whole system is reset. Each wire is connected to at most one gate output, but can be connected to many gate inputs.
|
||||
|
||||
Rather than risk getting shocked while tinkering with the live system, you write down all of the gate connections and initial wire values (your puzzle input) so you can consider them in relative safety. For example:
|
||||
|
||||
x00: 1
|
||||
x01: 1
|
||||
x02: 1
|
||||
y00: 0
|
||||
y01: 1
|
||||
y02: 0
|
||||
|
||||
x00 AND y00 -> z00
|
||||
x01 XOR y01 -> z01
|
||||
x02 OR y02 -> z02
|
||||
|
||||
Because gates wait for input, some wires need to start with a value (as inputs to the entire system). The first section specifies these values. For example, x00: 1 means that the wire named x00 starts with the value 1 (as if a gate is already outputting that value onto that wire).
|
||||
|
||||
The second section lists all of the gates and the wires connected to them. For example, x00 AND y00 -> z00 describes an instance of an AND gate which has wires x00 and y00 connected to its inputs and which will write its output to wire z00.
|
||||
|
||||
In this example, simulating these gates eventually causes 0 to appear on wire z00, 0 to appear on wire z01, and 1 to appear on wire z02.
|
||||
|
||||
Ultimately, the system is trying to produce a number by combining the bits on all wires starting with z. z00 is the least significant bit, then z01, then z02, and so on.
|
||||
|
||||
In this example, the three output bits form the binary number 100 which is equal to the decimal number 4.
|
||||
|
||||
Here's a larger example:
|
||||
|
||||
x00: 1
|
||||
x01: 0
|
||||
x02: 1
|
||||
x03: 1
|
||||
x04: 0
|
||||
y00: 1
|
||||
y01: 1
|
||||
y02: 1
|
||||
y03: 1
|
||||
y04: 1
|
||||
|
||||
ntg XOR fgs -> mjb
|
||||
y02 OR x01 -> tnw
|
||||
kwq OR kpj -> z05
|
||||
x00 OR x03 -> fst
|
||||
tgd XOR rvg -> z01
|
||||
vdt OR tnw -> bfw
|
||||
bfw AND frj -> z10
|
||||
ffh OR nrd -> bqk
|
||||
y00 AND y03 -> djm
|
||||
y03 OR y00 -> psh
|
||||
bqk OR frj -> z08
|
||||
tnw OR fst -> frj
|
||||
gnj AND tgd -> z11
|
||||
bfw XOR mjb -> z00
|
||||
x03 OR x00 -> vdt
|
||||
gnj AND wpb -> z02
|
||||
x04 AND y00 -> kjc
|
||||
djm OR pbm -> qhw
|
||||
nrd AND vdt -> hwm
|
||||
kjc AND fst -> rvg
|
||||
y04 OR y02 -> fgs
|
||||
y01 AND x02 -> pbm
|
||||
ntg OR kjc -> kwq
|
||||
psh XOR fgs -> tgd
|
||||
qhw XOR tgd -> z09
|
||||
pbm OR djm -> kpj
|
||||
x03 XOR y03 -> ffh
|
||||
x00 XOR y04 -> ntg
|
||||
bfw OR bqk -> z06
|
||||
nrd XOR fgs -> wpb
|
||||
frj XOR qhw -> z04
|
||||
bqk OR frj -> z07
|
||||
y03 OR x01 -> nrd
|
||||
hwm AND bqk -> z03
|
||||
tgd XOR rvg -> z12
|
||||
tnw OR pbm -> gnj
|
||||
|
||||
After waiting for values on all wires starting with z, the wires in this system have the following values:
|
||||
|
||||
bfw: 1
|
||||
bqk: 1
|
||||
djm: 1
|
||||
ffh: 0
|
||||
fgs: 1
|
||||
frj: 1
|
||||
fst: 1
|
||||
gnj: 1
|
||||
hwm: 1
|
||||
kjc: 0
|
||||
kpj: 1
|
||||
kwq: 0
|
||||
mjb: 1
|
||||
nrd: 1
|
||||
ntg: 0
|
||||
pbm: 1
|
||||
psh: 1
|
||||
qhw: 1
|
||||
rvg: 0
|
||||
tgd: 0
|
||||
tnw: 1
|
||||
vdt: 1
|
||||
wpb: 0
|
||||
z00: 0
|
||||
z01: 0
|
||||
z02: 0
|
||||
z03: 1
|
||||
z04: 0
|
||||
z05: 1
|
||||
z06: 1
|
||||
z07: 1
|
||||
z08: 1
|
||||
z09: 1
|
||||
z10: 1
|
||||
z11: 0
|
||||
z12: 0
|
||||
|
||||
Combining the bits from all wires starting with z produces the binary number 0011111101000. Converting this number to decimal produces 2024.
|
||||
|
||||
Simulate the system of gates and wires. What decimal number does it output on the wires starting with z?
|
||||
|
||||
Your puzzle answer was 53755311654662.
|
||||
--- Part Two ---
|
||||
|
||||
After inspecting the monitoring device more closely, you determine that the system you're simulating is trying to add two binary numbers.
|
||||
|
||||
Specifically, it is treating the bits on wires starting with x as one binary number, treating the bits on wires starting with y as a second binary number, and then attempting to add those two numbers together. The output of this operation is produced as a binary number on the wires starting with z. (In all three cases, wire 00 is the least significant bit, then 01, then 02, and so on.)
|
||||
|
||||
The initial values for the wires in your puzzle input represent just one instance of a pair of numbers that sum to the wrong value. Ultimately, any two binary numbers provided as input should be handled correctly. That is, for any combination of bits on wires starting with x and wires starting with y, the sum of the two numbers those bits represent should be produced as a binary number on the wires starting with z.
|
||||
|
||||
For example, if you have an addition system with four x wires, four y wires, and five z wires, you should be able to supply any four-bit number on the x wires, any four-bit number on the y numbers, and eventually find the sum of those two numbers as a five-bit number on the z wires. One of the many ways you could provide numbers to such a system would be to pass 11 on the x wires (1011 in binary) and 13 on the y wires (1101 in binary):
|
||||
|
||||
x00: 1
|
||||
x01: 1
|
||||
x02: 0
|
||||
x03: 1
|
||||
y00: 1
|
||||
y01: 0
|
||||
y02: 1
|
||||
y03: 1
|
||||
|
||||
If the system were working correctly, then after all gates are finished processing, you should find 24 (11+13) on the z wires as the five-bit binary number 11000:
|
||||
|
||||
z00: 0
|
||||
z01: 0
|
||||
z02: 0
|
||||
z03: 1
|
||||
z04: 1
|
||||
|
||||
Unfortunately, your actual system needs to add numbers with many more bits and therefore has many more wires.
|
||||
|
||||
Based on forensic analysis of scuff marks and scratches on the device, you can tell that there are exactly four pairs of gates whose output wires have been swapped. (A gate can only be in at most one such pair; no gate's output was swapped multiple times.)
|
||||
|
||||
For example, the system below is supposed to find the bitwise AND of the six-bit number on x00 through x05 and the six-bit number on y00 through y05 and then write the result as a six-bit number on z00 through z05:
|
||||
|
||||
x00: 0
|
||||
x01: 1
|
||||
x02: 0
|
||||
x03: 1
|
||||
x04: 0
|
||||
x05: 1
|
||||
y00: 0
|
||||
y01: 0
|
||||
y02: 1
|
||||
y03: 1
|
||||
y04: 0
|
||||
y05: 1
|
||||
|
||||
x00 AND y00 -> z05
|
||||
x01 AND y01 -> z02
|
||||
x02 AND y02 -> z01
|
||||
x03 AND y03 -> z03
|
||||
x04 AND y04 -> z04
|
||||
x05 AND y05 -> z00
|
||||
|
||||
However, in this example, two pairs of gates have had their output wires swapped, causing the system to produce wrong answers. The first pair of gates with swapped outputs is x00 AND y00 -> z05 and x05 AND y05 -> z00; the second pair of gates is x01 AND y01 -> z02 and x02 AND y02 -> z01. Correcting these two swaps results in this system that works as intended for any set of initial values on wires that start with x or y:
|
||||
|
||||
x00 AND y00 -> z00
|
||||
x01 AND y01 -> z01
|
||||
x02 AND y02 -> z02
|
||||
x03 AND y03 -> z03
|
||||
x04 AND y04 -> z04
|
||||
x05 AND y05 -> z05
|
||||
|
||||
In this example, two pairs of gates have outputs that are involved in a swap. By sorting their output wires' names and joining them with commas, the list of wires involved in swaps is z00,z01,z02,z05.
|
||||
|
||||
Of course, your actual system is much more complex than this, and the gates that need their outputs swapped could be anywhere, not just attached to a wire starting with z. If you were to determine that you need to swap output wires aaa with eee, ooo with z99, bbb with ccc, and aoc with z24, your answer would be aaa,aoc,bbb,ccc,eee,ooo,z24,z99.
|
||||
|
||||
Your system of gates and wires has four pairs of gates which need their output wires swapped - eight wires in total. Determine which four pairs of gates need their outputs swapped so that your system correctly performs addition; what do you get if you sort the names of the eight wires involved in a swap and then join those names with commas?
|
||||
|
||||
Your puzzle answer was dkr,ggk,hhh,htp,rhv,z05,z15,z20.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
def replace_ins(gate, gates, inp):
|
||||
g0, f, g1 = gate.split(' ')
|
||||
if g0 in inp and g1 in inp: return inp[g0] + ' ' + f + ' ' + inp[g1]
|
||||
elif g0[0] not in ['x', 'y'] and g1[0] in ['x', 'y']:
|
||||
return '(' + replace_ins(gates[g0], gates, inp) + ')' + ' ' + f + ' ' + inp[g1]
|
||||
elif g0[0] in ['x', 'y'] and g1[0] not in ['x', 'y']:
|
||||
return inp[g0] + ' ' + f + ' ' + '(' + replace_ins(gates[g1], gates, inp) + ')'
|
||||
else:
|
||||
return '(' + replace_ins(gates[g0], gates, inp) + ')' + ' ' + f + ' ' + '(' + replace_ins(gates[g1], gates, inp) + ')'
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
values, gates = open(sys.argv[1]).read().split('\n\n')
|
||||
ins = {v.split(': ')[0]: v.split(': ')[1] for v in values.split('\n')}
|
||||
gates = {g.split(' -> ')[1]: g.split(' -> ')[0].lower().replace('xor', '^') for g in gates.split('\n')[:-1]}
|
||||
out = {}
|
||||
for g in gates.keys():
|
||||
exec('out[g] = ' + replace_ins(gates[g], gates, ins))
|
||||
|
||||
# for g in gates.keys():
|
||||
# g0, f, g1 = gates[g].split(' ')
|
||||
# print(g, g0, f, g1)
|
||||
# print(out[g])
|
||||
|
||||
# challenge 1
|
||||
res1 = 0
|
||||
for (o,v) in sorted(out.items(),key=lambda x: x[0],reverse=True):
|
||||
if o.startswith('z'): res1 = (res1 << 1) | v
|
||||
print(f"challenge 1:\n{res1}\n")
|
||||
|
||||
# challenge 2, empiric solution
|
||||
x, y = 0, 0
|
||||
for bit in [int(v) for (o,v) in sorted(ins.items(),key=lambda x: x[0],reverse=True) if o.startswith('x')]:
|
||||
x = (x << 1) | bit
|
||||
for bit in [int(v) for (o,v) in sorted(ins.items(),key=lambda x: x[0],reverse=True) if o.startswith('y')]:
|
||||
y = (y << 1) | bit
|
||||
|
||||
res2 = ','.join(sorted(['dkr', 'z05', 'z15', 'htp', 'ggk', 'rhv', 'hhh', 'z20']))
|
||||
print(f"challenge 2:\n{res2}")
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
x00: 1
|
||||
x01: 1
|
||||
x02: 1
|
||||
y00: 0
|
||||
y01: 1
|
||||
y02: 0
|
||||
|
||||
x00 AND y00 -> z00
|
||||
x01 XOR y01 -> z01
|
||||
x02 OR y02 -> z02
|
||||
@@ -0,0 +1,47 @@
|
||||
x00: 1
|
||||
x01: 0
|
||||
x02: 1
|
||||
x03: 1
|
||||
x04: 0
|
||||
y00: 1
|
||||
y01: 1
|
||||
y02: 1
|
||||
y03: 1
|
||||
y04: 1
|
||||
|
||||
ntg XOR fgs -> mjb
|
||||
y02 OR x01 -> tnw
|
||||
kwq OR kpj -> z05
|
||||
x00 OR x03 -> fst
|
||||
tgd XOR rvg -> z01
|
||||
vdt OR tnw -> bfw
|
||||
bfw AND frj -> z10
|
||||
ffh OR nrd -> bqk
|
||||
y00 AND y03 -> djm
|
||||
y03 OR y00 -> psh
|
||||
bqk OR frj -> z08
|
||||
tnw OR fst -> frj
|
||||
gnj AND tgd -> z11
|
||||
bfw XOR mjb -> z00
|
||||
x03 OR x00 -> vdt
|
||||
gnj AND wpb -> z02
|
||||
x04 AND y00 -> kjc
|
||||
djm OR pbm -> qhw
|
||||
nrd AND vdt -> hwm
|
||||
kjc AND fst -> rvg
|
||||
y04 OR y02 -> fgs
|
||||
y01 AND x02 -> pbm
|
||||
ntg OR kjc -> kwq
|
||||
psh XOR fgs -> tgd
|
||||
qhw XOR tgd -> z09
|
||||
pbm OR djm -> kpj
|
||||
x03 XOR y03 -> ffh
|
||||
x00 XOR y04 -> ntg
|
||||
bfw OR bqk -> z06
|
||||
nrd XOR fgs -> wpb
|
||||
frj XOR qhw -> z04
|
||||
bqk OR frj -> z07
|
||||
y03 OR x01 -> nrd
|
||||
hwm AND bqk -> z03
|
||||
tgd XOR rvg -> z12
|
||||
tnw OR pbm -> gnj
|
||||
@@ -0,0 +1,19 @@
|
||||
x00: 0
|
||||
x01: 1
|
||||
x02: 0
|
||||
x03: 1
|
||||
x04: 0
|
||||
x05: 1
|
||||
y00: 0
|
||||
y01: 0
|
||||
y02: 1
|
||||
y03: 1
|
||||
y04: 0
|
||||
y05: 1
|
||||
|
||||
x00 AND y00 -> z00
|
||||
x01 AND y01 -> z01
|
||||
x02 AND y02 -> z02
|
||||
x03 AND y03 -> z03
|
||||
x04 AND y04 -> z04
|
||||
x05 AND y05 -> z05
|
||||
@@ -0,0 +1,313 @@
|
||||
x00: 1
|
||||
x01: 0
|
||||
x02: 1
|
||||
x03: 1
|
||||
x04: 0
|
||||
x05: 0
|
||||
x06: 1
|
||||
x07: 1
|
||||
x08: 0
|
||||
x09: 1
|
||||
x10: 1
|
||||
x11: 1
|
||||
x12: 1
|
||||
x13: 0
|
||||
x14: 0
|
||||
x15: 1
|
||||
x16: 0
|
||||
x17: 0
|
||||
x18: 1
|
||||
x19: 1
|
||||
x20: 0
|
||||
x21: 1
|
||||
x22: 1
|
||||
x23: 0
|
||||
x24: 1
|
||||
x25: 0
|
||||
x26: 1
|
||||
x27: 1
|
||||
x28: 1
|
||||
x29: 1
|
||||
x30: 0
|
||||
x31: 0
|
||||
x32: 0
|
||||
x33: 0
|
||||
x34: 0
|
||||
x35: 0
|
||||
x36: 0
|
||||
x37: 1
|
||||
x38: 0
|
||||
x39: 0
|
||||
x40: 0
|
||||
x41: 0
|
||||
x42: 0
|
||||
x43: 1
|
||||
x44: 1
|
||||
y00: 1
|
||||
y01: 0
|
||||
y02: 0
|
||||
y03: 1
|
||||
y04: 1
|
||||
y05: 0
|
||||
y06: 0
|
||||
y07: 0
|
||||
y08: 0
|
||||
y09: 0
|
||||
y10: 0
|
||||
y11: 1
|
||||
y12: 0
|
||||
y13: 1
|
||||
y14: 1
|
||||
y15: 0
|
||||
y16: 1
|
||||
y17: 0
|
||||
y18: 1
|
||||
y19: 0
|
||||
y20: 0
|
||||
y21: 0
|
||||
y22: 1
|
||||
y23: 1
|
||||
y24: 0
|
||||
y25: 0
|
||||
y26: 1
|
||||
y27: 0
|
||||
y28: 0
|
||||
y29: 1
|
||||
y30: 0
|
||||
y31: 1
|
||||
y32: 1
|
||||
y33: 1
|
||||
y34: 0
|
||||
y35: 0
|
||||
y36: 0
|
||||
y37: 0
|
||||
y38: 1
|
||||
y39: 1
|
||||
y40: 0
|
||||
y41: 0
|
||||
y42: 0
|
||||
y43: 1
|
||||
y44: 1
|
||||
|
||||
x14 AND y14 -> cwj
|
||||
dhf OR hrr -> gcs
|
||||
y44 XOR x44 -> pfh
|
||||
fqq OR hww -> bpg
|
||||
wmd OR kvv -> jts
|
||||
khg AND hdd -> nfn
|
||||
y35 XOR x35 -> rpk
|
||||
bhw XOR sth -> htp
|
||||
x13 XOR y13 -> gnf
|
||||
y39 AND x39 -> qwn
|
||||
nhr XOR wks -> z19
|
||||
x40 AND y40 -> mpd
|
||||
pvw AND fsf -> hsf
|
||||
y29 AND x29 -> sbk
|
||||
kqk OR shk -> gjs
|
||||
swm OR rrk -> fww
|
||||
x30 AND y30 -> bpn
|
||||
mts XOR ntr -> z02
|
||||
y23 XOR x23 -> vsh
|
||||
x07 XOR y07 -> cwh
|
||||
jqq OR trc -> wrr
|
||||
y14 XOR x14 -> khg
|
||||
y12 XOR x12 -> fsf
|
||||
x27 AND y27 -> tts
|
||||
bjs AND vnp -> tsp
|
||||
hcq OR pjv -> fvm
|
||||
vsk XOR svf -> z42
|
||||
dwp AND fwn -> rsm
|
||||
x30 XOR y30 -> bjs
|
||||
y19 AND x19 -> pjv
|
||||
x20 XOR y20 -> mvv
|
||||
vpb XOR jmq -> z43
|
||||
tkd AND shd -> thc
|
||||
nbw XOR wjn -> z38
|
||||
wjn AND nbw -> jqq
|
||||
y17 XOR x17 -> hhm
|
||||
dkr OR fdd -> bvc
|
||||
qjh AND qcm -> mcd
|
||||
x26 XOR y26 -> fwn
|
||||
dsf AND tjv -> bsh
|
||||
qjs AND ncw -> nhw
|
||||
nsg XOR kkt -> z04
|
||||
hhb OR htp -> mqr
|
||||
hgs XOR hhh -> z21
|
||||
wrr XOR htw -> z39
|
||||
cwh XOR tpd -> z07
|
||||
gcs XOR hdc -> dkr
|
||||
rng AND mdw -> rhp
|
||||
cwh AND tpd -> ddj
|
||||
x43 AND y43 -> jjk
|
||||
hhm AND jts -> swm
|
||||
x04 AND y04 -> hrr
|
||||
qhg OR jgj -> shd
|
||||
y44 AND x44 -> kbb
|
||||
gpb AND cwn -> prp
|
||||
y42 AND x42 -> vcd
|
||||
y38 AND x38 -> trc
|
||||
mvv XOR fvm -> hhh
|
||||
qjh XOR qcm -> z33
|
||||
y05 AND x05 -> z05
|
||||
pfh AND gqg -> khw
|
||||
y03 XOR x03 -> tkd
|
||||
x25 XOR y25 -> dwk
|
||||
phm AND bjw -> bcm
|
||||
y31 XOR x31 -> gpb
|
||||
y28 AND x28 -> pcd
|
||||
hdc AND gcs -> fdd
|
||||
ffw XOR cjf -> z11
|
||||
y21 XOR x21 -> hgs
|
||||
fcd XOR nkw -> z41
|
||||
kqs XOR vjk -> z22
|
||||
x36 AND y36 -> ggk
|
||||
x34 XOR y34 -> tjv
|
||||
y25 AND x25 -> cbg
|
||||
x24 XOR y24 -> mdw
|
||||
rpk AND rfs -> fkk
|
||||
x24 AND y24 -> rwd
|
||||
y11 AND x11 -> mdb
|
||||
phm XOR bjw -> z40
|
||||
tsp OR bpn -> cwn
|
||||
y29 XOR x29 -> nrv
|
||||
nhw OR qdc -> qcm
|
||||
tjv XOR dsf -> z34
|
||||
x21 AND y21 -> mvp
|
||||
x08 AND y08 -> bnr
|
||||
gqr OR mdb -> pvw
|
||||
sfw AND gnf -> tsh
|
||||
mfc AND gqf -> bwd
|
||||
y35 AND x35 -> nbb
|
||||
x09 XOR y09 -> csk
|
||||
qfj OR mqg -> z20
|
||||
x22 AND y22 -> kqk
|
||||
x08 XOR y08 -> wcg
|
||||
y37 XOR x37 -> mfc
|
||||
wrn XOR fww -> z18
|
||||
rvw OR rsm -> dnb
|
||||
x23 AND y23 -> mcw
|
||||
wwc OR hch -> ntr
|
||||
x22 XOR y22 -> vjk
|
||||
gqf XOR mfc -> z37
|
||||
sth AND bhw -> z15
|
||||
rng XOR mdw -> z24
|
||||
y04 XOR x04 -> kkt
|
||||
fsf XOR pvw -> z12
|
||||
bpg XOR kpk -> z10
|
||||
x02 AND y02 -> qhg
|
||||
x19 XOR y19 -> nhr
|
||||
cbg OR srg -> dwp
|
||||
pfh XOR gqg -> z44
|
||||
y00 AND x00 -> wsg
|
||||
x33 XOR y33 -> qjh
|
||||
jts XOR hhm -> z17
|
||||
y32 XOR x32 -> ncw
|
||||
fww AND wrn -> gfq
|
||||
qcn OR fjq -> vsk
|
||||
nsg AND kkt -> dhf
|
||||
y32 AND x32 -> qdc
|
||||
bgf OR sfb -> tpd
|
||||
dnb AND bsv -> bcn
|
||||
y28 XOR x28 -> phk
|
||||
tds AND mqr -> kvv
|
||||
wtf OR qwn -> phm
|
||||
pss XOR csk -> z09
|
||||
kwp OR sbk -> vnp
|
||||
y26 AND x26 -> rvw
|
||||
mvv AND fvm -> qfj
|
||||
y15 AND x15 -> hhb
|
||||
hbb XOR nrv -> z29
|
||||
dsn AND wcg -> rms
|
||||
bnr OR rms -> pss
|
||||
nfn OR cwj -> sth
|
||||
mvp OR wms -> kqs
|
||||
khg XOR hdd -> z14
|
||||
bwd OR rnr -> wjn
|
||||
x18 AND y18 -> twv
|
||||
rfs XOR rpk -> z35
|
||||
dwk AND fbs -> srg
|
||||
prp OR dmf -> qjs
|
||||
nbb OR fkk -> hpg
|
||||
ncw XOR qjs -> z32
|
||||
pcd OR wff -> hbb
|
||||
y43 XOR x43 -> jmq
|
||||
hkg OR mcw -> rng
|
||||
x09 AND y09 -> hww
|
||||
y13 AND x13 -> fhs
|
||||
qfg AND bvc -> bgf
|
||||
y18 XOR x18 -> wrn
|
||||
phk XOR rkf -> z28
|
||||
x06 XOR y06 -> qfg
|
||||
y00 XOR x00 -> z00
|
||||
x16 XOR y16 -> tds
|
||||
hgs AND hhh -> wms
|
||||
fkc OR vcd -> vpb
|
||||
y03 AND x03 -> rrr
|
||||
thc OR rrr -> nsg
|
||||
sfw XOR gnf -> z13
|
||||
bvc XOR qfg -> z06
|
||||
wsg AND pnw -> hch
|
||||
y39 XOR x39 -> htw
|
||||
x12 AND y12 -> npc
|
||||
vjk AND kqs -> shk
|
||||
ggk XOR hpg -> z36
|
||||
gjs XOR vsh -> z23
|
||||
ddj OR ktn -> dsn
|
||||
x38 XOR y38 -> nbw
|
||||
y33 AND x33 -> mqv
|
||||
ggk AND hpg -> bqf
|
||||
npc OR hsf -> sfw
|
||||
y16 AND x16 -> wmd
|
||||
vsh AND gjs -> hkg
|
||||
x10 XOR y10 -> kpk
|
||||
mcd OR mqv -> dsf
|
||||
x05 XOR y05 -> hdc
|
||||
wcg XOR dsn -> z08
|
||||
x41 XOR y41 -> nkw
|
||||
mts AND ntr -> jgj
|
||||
bcm OR mpd -> fcd
|
||||
tds XOR mqr -> z16
|
||||
vsk AND svf -> fkc
|
||||
x27 XOR y27 -> bsv
|
||||
bqf OR rhv -> gqf
|
||||
kbb OR khw -> z45
|
||||
nrv AND hbb -> kwp
|
||||
csk AND pss -> fqq
|
||||
y34 AND x34 -> cjq
|
||||
x20 AND y20 -> mqg
|
||||
tsh OR fhs -> hdd
|
||||
wks AND nhr -> hcq
|
||||
cjq OR bsh -> rfs
|
||||
gfq OR twv -> wks
|
||||
rwd OR rhp -> fbs
|
||||
y37 AND x37 -> rnr
|
||||
vfs OR jgd -> cjf
|
||||
y31 AND x31 -> dmf
|
||||
kpk AND bpg -> jgd
|
||||
y36 XOR x36 -> rhv
|
||||
y42 XOR x42 -> svf
|
||||
bjs XOR vnp -> z30
|
||||
cst OR jjk -> gqg
|
||||
y40 XOR x40 -> bjw
|
||||
cjf AND ffw -> gqr
|
||||
fcd AND nkw -> fjq
|
||||
y01 XOR x01 -> pnw
|
||||
dnb XOR bsv -> z27
|
||||
wsg XOR pnw -> z01
|
||||
y41 AND x41 -> qcn
|
||||
y06 AND x06 -> sfb
|
||||
gpb XOR cwn -> z31
|
||||
x02 XOR y02 -> mts
|
||||
shd XOR tkd -> z03
|
||||
dwk XOR fbs -> z25
|
||||
y11 XOR x11 -> ffw
|
||||
phk AND rkf -> wff
|
||||
jmq AND vpb -> cst
|
||||
bcn OR tts -> rkf
|
||||
y07 AND x07 -> ktn
|
||||
x17 AND y17 -> rrk
|
||||
x10 AND y10 -> vfs
|
||||
fwn XOR dwp -> z26
|
||||
x01 AND y01 -> wwc
|
||||
htw AND wrr -> wtf
|
||||
y15 XOR x15 -> bhw
|
||||
@@ -0,0 +1,313 @@
|
||||
x00: 1
|
||||
x01: 0
|
||||
x02: 1
|
||||
x03: 1
|
||||
x04: 0
|
||||
x05: 0
|
||||
x06: 1
|
||||
x07: 1
|
||||
x08: 0
|
||||
x09: 1
|
||||
x10: 1
|
||||
x11: 1
|
||||
x12: 1
|
||||
x13: 0
|
||||
x14: 0
|
||||
x15: 1
|
||||
x16: 0
|
||||
x17: 0
|
||||
x18: 1
|
||||
x19: 1
|
||||
x20: 0
|
||||
x21: 1
|
||||
x22: 1
|
||||
x23: 0
|
||||
x24: 1
|
||||
x25: 0
|
||||
x26: 1
|
||||
x27: 1
|
||||
x28: 1
|
||||
x29: 1
|
||||
x30: 0
|
||||
x31: 0
|
||||
x32: 0
|
||||
x33: 0
|
||||
x34: 0
|
||||
x35: 0
|
||||
x36: 0
|
||||
x37: 1
|
||||
x38: 0
|
||||
x39: 0
|
||||
x40: 0
|
||||
x41: 0
|
||||
x42: 0
|
||||
x43: 1
|
||||
x44: 1
|
||||
y00: 1
|
||||
y01: 0
|
||||
y02: 0
|
||||
y03: 1
|
||||
y04: 1
|
||||
y05: 0
|
||||
y06: 0
|
||||
y07: 0
|
||||
y08: 0
|
||||
y09: 0
|
||||
y10: 0
|
||||
y11: 1
|
||||
y12: 0
|
||||
y13: 1
|
||||
y14: 1
|
||||
y15: 0
|
||||
y16: 1
|
||||
y17: 0
|
||||
y18: 1
|
||||
y19: 0
|
||||
y20: 0
|
||||
y21: 0
|
||||
y22: 1
|
||||
y23: 1
|
||||
y24: 0
|
||||
y25: 0
|
||||
y26: 1
|
||||
y27: 0
|
||||
y28: 0
|
||||
y29: 1
|
||||
y30: 0
|
||||
y31: 1
|
||||
y32: 1
|
||||
y33: 1
|
||||
y34: 0
|
||||
y35: 0
|
||||
y36: 0
|
||||
y37: 0
|
||||
y38: 1
|
||||
y39: 1
|
||||
y40: 0
|
||||
y41: 0
|
||||
y42: 0
|
||||
y43: 1
|
||||
y44: 1
|
||||
|
||||
x14 AND y14 -> cwj
|
||||
dhf OR hrr -> gcs
|
||||
y44 XOR x44 -> pfh
|
||||
fqq OR hww -> bpg
|
||||
wmd OR kvv -> jts
|
||||
khg AND hdd -> nfn
|
||||
y35 XOR x35 -> rpk
|
||||
bhw XOR sth -> htp
|
||||
x13 XOR y13 -> gnf
|
||||
y39 AND x39 -> qwn
|
||||
nhr XOR wks -> z19
|
||||
x40 AND y40 -> mpd
|
||||
pvw AND fsf -> hsf
|
||||
y29 AND x29 -> sbk
|
||||
kqk OR shk -> gjs
|
||||
swm OR rrk -> fww
|
||||
x30 AND y30 -> bpn
|
||||
mts XOR ntr -> z02
|
||||
y23 XOR x23 -> vsh
|
||||
x07 XOR y07 -> cwh
|
||||
jqq OR trc -> wrr
|
||||
y14 XOR x14 -> khg
|
||||
y12 XOR x12 -> fsf
|
||||
x27 AND y27 -> tts
|
||||
bjs AND vnp -> tsp
|
||||
hcq OR pjv -> fvm
|
||||
vsk XOR svf -> z42
|
||||
dwp AND fwn -> rsm
|
||||
x30 XOR y30 -> bjs
|
||||
y19 AND x19 -> pjv
|
||||
x20 XOR y20 -> qfg
|
||||
vpb XOR jmq -> z43
|
||||
tkd AND shd -> thc
|
||||
nbw XOR wjn -> z38
|
||||
wjn AND nbw -> jqq
|
||||
y17 XOR x17 -> hhm
|
||||
dkr OR fdd -> bvc
|
||||
qjh AND qcm -> mcd
|
||||
x26 XOR y26 -> fwn
|
||||
dsf AND tjv -> bsh
|
||||
qjs AND ncw -> nhw
|
||||
nsg XOR kkt -> z04
|
||||
hhb OR htp -> mqr
|
||||
hgs XOR hhh -> z21
|
||||
wrr XOR htw -> z39
|
||||
cwh XOR tpd -> z07
|
||||
gcs XOR hdc -> dkr
|
||||
rng AND mdw -> rhp
|
||||
cwh AND tpd -> ddj
|
||||
x43 AND y43 -> jjk
|
||||
hhm AND jts -> swm
|
||||
x04 AND y04 -> hrr
|
||||
qhg OR jgj -> shd
|
||||
y44 AND x44 -> kbb
|
||||
gpb AND cwn -> prp
|
||||
y42 AND x42 -> vcd
|
||||
y38 AND x38 -> trc
|
||||
mvv XOR fvm -> hhh
|
||||
qjh XOR qcm -> z33
|
||||
y05 AND x05 -> z15
|
||||
pfh AND gqg -> khw
|
||||
y03 XOR x03 -> tkd
|
||||
x25 XOR y25 -> dwk
|
||||
phm AND bjw -> bcm
|
||||
y31 XOR x31 -> gpb
|
||||
y28 AND x28 -> pcd
|
||||
hdc AND gcs -> fdd
|
||||
ffw XOR cjf -> z11
|
||||
y21 XOR x21 -> hgs
|
||||
fcd XOR nkw -> z41
|
||||
kqs XOR vjk -> z22
|
||||
x36 AND y36 -> ggk
|
||||
x34 XOR y34 -> tjv
|
||||
y25 AND x25 -> cbg
|
||||
x24 XOR y24 -> mdw
|
||||
rpk AND rfs -> fkk
|
||||
x24 AND y24 -> rwd
|
||||
y11 AND x11 -> mdb
|
||||
phm XOR bjw -> z40
|
||||
tsp OR bpn -> cwn
|
||||
y29 XOR x29 -> nrv
|
||||
nhw OR qdc -> qcm
|
||||
tjv XOR dsf -> z34
|
||||
x21 AND y21 -> mvp
|
||||
x08 AND y08 -> bnr
|
||||
gqr OR mdb -> pvw
|
||||
sfw AND gnf -> tsh
|
||||
mfc AND gqf -> bwd
|
||||
y35 AND x35 -> nbb
|
||||
x09 XOR y09 -> csk
|
||||
qfj OR mqg -> z20
|
||||
x22 AND y22 -> kqk
|
||||
x08 XOR y08 -> wcg
|
||||
y37 XOR x37 -> mfc
|
||||
wrn XOR fww -> z18
|
||||
rvw OR rsm -> dnb
|
||||
x23 AND y23 -> mcw
|
||||
wwc OR hch -> ntr
|
||||
x22 XOR y22 -> vjk
|
||||
gqf XOR mfc -> z37
|
||||
sth AND bhw -> z05
|
||||
rng XOR mdw -> z24
|
||||
y04 XOR x04 -> kkt
|
||||
fsf XOR pvw -> z12
|
||||
bpg XOR kpk -> z10
|
||||
x02 AND y02 -> qhg
|
||||
x19 XOR y19 -> nhr
|
||||
cbg OR srg -> dwp
|
||||
pfh XOR gqg -> z44
|
||||
y00 AND x00 -> wsg
|
||||
x33 XOR y33 -> qjh
|
||||
jts XOR hhm -> z16
|
||||
y32 XOR x32 -> ncw
|
||||
fww AND wrn -> gfq
|
||||
qcn OR fjq -> vsk
|
||||
nsg AND kkt -> dhf
|
||||
y32 AND x32 -> qdc
|
||||
bgf OR sfb -> tpd
|
||||
dnb AND bsv -> bcn
|
||||
y28 XOR x28 -> phk
|
||||
tds AND mqr -> kvv
|
||||
wtf OR qwn -> phm
|
||||
pss XOR csk -> z09
|
||||
kwp OR sbk -> vnp
|
||||
y26 AND x26 -> rvw
|
||||
mvv AND fvm -> qfj
|
||||
y15 AND x15 -> hhb
|
||||
hbb XOR nrv -> z29
|
||||
dsn AND wcg -> rms
|
||||
bnr OR rms -> pss
|
||||
nfn OR cwj -> sth
|
||||
mvp OR wms -> kqs
|
||||
khg XOR hdd -> z14
|
||||
bwd OR rnr -> wjn
|
||||
x18 AND y18 -> twv
|
||||
rfs XOR rpk -> z35
|
||||
dwk AND fbs -> srg
|
||||
prp OR dmf -> qjs
|
||||
nbb OR fkk -> hpg
|
||||
ncw XOR qjs -> z32
|
||||
pcd OR wff -> hbb
|
||||
y43 XOR x43 -> jmq
|
||||
hkg OR mcw -> rng
|
||||
x09 AND y09 -> hww
|
||||
y13 AND x13 -> fhs
|
||||
qfg AND bvc -> bgf
|
||||
y18 XOR x18 -> wrn
|
||||
phk XOR rkf -> z28
|
||||
x06 XOR y06 -> mvv
|
||||
y00 XOR x00 -> z00
|
||||
x16 XOR y16 -> tds
|
||||
hgs AND hhh -> wms
|
||||
fkc OR vcd -> vpb
|
||||
y03 AND x03 -> rrr
|
||||
thc OR rrr -> nsg
|
||||
sfw XOR gnf -> z13
|
||||
bvc XOR qfg -> z06
|
||||
wsg AND pnw -> hch
|
||||
y39 XOR x39 -> htw
|
||||
x12 AND y12 -> npc
|
||||
vjk AND kqs -> shk
|
||||
ggk XOR hpg -> z36
|
||||
gjs XOR vsh -> z23
|
||||
ddj OR ktn -> dsn
|
||||
x38 XOR y38 -> nbw
|
||||
y33 AND x33 -> mqv
|
||||
ggk AND hpg -> bqf
|
||||
npc OR hsf -> sfw
|
||||
y16 AND x16 -> wmd
|
||||
vsh AND gjs -> hkg
|
||||
x10 XOR y10 -> kpk
|
||||
mcd OR mqv -> dsf
|
||||
x05 XOR y05 -> hdc
|
||||
wcg XOR dsn -> z08
|
||||
x41 XOR y41 -> nkw
|
||||
mts AND ntr -> jgj
|
||||
bcm OR mpd -> fcd
|
||||
tds XOR mqr -> z17
|
||||
vsk AND svf -> fkc
|
||||
x27 XOR y27 -> bsv
|
||||
bqf OR rhv -> gqf
|
||||
kbb OR khw -> z45
|
||||
nrv AND hbb -> kwp
|
||||
csk AND pss -> fqq
|
||||
y34 AND x34 -> cjq
|
||||
x20 AND y20 -> mqg
|
||||
tsh OR fhs -> hdd
|
||||
wks AND nhr -> hcq
|
||||
cjq OR bsh -> rfs
|
||||
gfq OR twv -> wks
|
||||
rwd OR rhp -> fbs
|
||||
y37 AND x37 -> rnr
|
||||
vfs OR jgd -> cjf
|
||||
y31 AND x31 -> dmf
|
||||
kpk AND bpg -> jgd
|
||||
y36 XOR x36 -> rhv
|
||||
y42 XOR x42 -> svf
|
||||
bjs XOR vnp -> z30
|
||||
cst OR jjk -> gqg
|
||||
y40 XOR x40 -> bjw
|
||||
cjf AND ffw -> gqr
|
||||
fcd AND nkw -> fjq
|
||||
y01 XOR x01 -> pnw
|
||||
dnb XOR bsv -> z27
|
||||
wsg XOR pnw -> z01
|
||||
y41 AND x41 -> qcn
|
||||
y06 AND x06 -> sfb
|
||||
gpb XOR cwn -> z31
|
||||
x02 XOR y02 -> mts
|
||||
shd XOR tkd -> z03
|
||||
dwk XOR fbs -> z25
|
||||
y11 XOR x11 -> ffw
|
||||
phk AND rkf -> wff
|
||||
jmq AND vpb -> cst
|
||||
bcn OR tts -> rkf
|
||||
y07 AND x07 -> ktn
|
||||
x17 AND y17 -> rrk
|
||||
x10 AND y10 -> vfs
|
||||
fwn XOR dwp -> z26
|
||||
x01 AND y01 -> wwc
|
||||
htw AND wrr -> wtf
|
||||
y15 XOR x15 -> bhw
|
||||
@@ -0,0 +1,313 @@
|
||||
x00: 1
|
||||
x01: 1
|
||||
x02: 1
|
||||
x03: 1
|
||||
x04: 0
|
||||
x05: 0
|
||||
x06: 0
|
||||
x07: 0
|
||||
x08: 1
|
||||
x09: 0
|
||||
x10: 0
|
||||
x11: 1
|
||||
x12: 0
|
||||
x13: 1
|
||||
x14: 0
|
||||
x15: 1
|
||||
x16: 0
|
||||
x17: 0
|
||||
x18: 0
|
||||
x19: 0
|
||||
x20: 1
|
||||
x21: 1
|
||||
x22: 0
|
||||
x23: 1
|
||||
x24: 0
|
||||
x25: 0
|
||||
x26: 0
|
||||
x27: 0
|
||||
x28: 1
|
||||
x29: 0
|
||||
x30: 1
|
||||
x31: 0
|
||||
x32: 0
|
||||
x33: 0
|
||||
x34: 0
|
||||
x35: 0
|
||||
x36: 0
|
||||
x37: 0
|
||||
x38: 0
|
||||
x39: 1
|
||||
x40: 0
|
||||
x41: 0
|
||||
x42: 0
|
||||
x43: 0
|
||||
x44: 1
|
||||
y00: 1
|
||||
y01: 1
|
||||
y02: 0
|
||||
y03: 0
|
||||
y04: 0
|
||||
y05: 1
|
||||
y06: 0
|
||||
y07: 0
|
||||
y08: 1
|
||||
y09: 0
|
||||
y10: 0
|
||||
y11: 0
|
||||
y12: 0
|
||||
y13: 0
|
||||
y14: 1
|
||||
y15: 0
|
||||
y16: 0
|
||||
y17: 0
|
||||
y18: 0
|
||||
y19: 0
|
||||
y20: 1
|
||||
y21: 1
|
||||
y22: 1
|
||||
y23: 0
|
||||
y24: 0
|
||||
y25: 1
|
||||
y26: 1
|
||||
y27: 1
|
||||
y28: 1
|
||||
y29: 1
|
||||
y30: 1
|
||||
y31: 1
|
||||
y32: 1
|
||||
y33: 1
|
||||
y34: 1
|
||||
y35: 1
|
||||
y36: 1
|
||||
y37: 1
|
||||
y38: 1
|
||||
y39: 1
|
||||
y40: 1
|
||||
y41: 1
|
||||
y42: 1
|
||||
y43: 1
|
||||
y44: 1
|
||||
|
||||
x14 AND y14 -> cwj
|
||||
dhf OR hrr -> gcs
|
||||
y44 XOR x44 -> pfh
|
||||
fqq OR hww -> bpg
|
||||
wmd OR kvv -> jts
|
||||
khg AND hdd -> nfn
|
||||
y35 XOR x35 -> rpk
|
||||
bhw XOR sth -> z15
|
||||
x13 XOR y13 -> gnf
|
||||
y39 AND x39 -> qwn
|
||||
nhr XOR wks -> z19
|
||||
x40 AND y40 -> mpd
|
||||
pvw AND fsf -> hsf
|
||||
y29 AND x29 -> sbk
|
||||
kqk OR shk -> gjs
|
||||
swm OR rrk -> fww
|
||||
x30 AND y30 -> bpn
|
||||
mts XOR ntr -> z02
|
||||
y23 XOR x23 -> vsh
|
||||
x07 XOR y07 -> cwh
|
||||
jqq OR trc -> wrr
|
||||
y14 XOR x14 -> khg
|
||||
y12 XOR x12 -> fsf
|
||||
x27 AND y27 -> tts
|
||||
bjs AND vnp -> tsp
|
||||
hcq OR pjv -> fvm
|
||||
vsk XOR svf -> z42
|
||||
dwp AND fwn -> rsm
|
||||
x30 XOR y30 -> bjs
|
||||
y19 AND x19 -> pjv
|
||||
x20 XOR y20 -> mvv
|
||||
vpb XOR jmq -> z43
|
||||
tkd AND shd -> thc
|
||||
nbw XOR wjn -> z38
|
||||
wjn AND nbw -> jqq
|
||||
y17 XOR x17 -> hhm
|
||||
dkr OR fdd -> bvc
|
||||
qjh AND qcm -> mcd
|
||||
x26 XOR y26 -> fwn
|
||||
dsf AND tjv -> bsh
|
||||
qjs AND ncw -> nhw
|
||||
nsg XOR kkt -> z04
|
||||
hhb OR htp -> mqr
|
||||
hgs XOR hhh -> z21
|
||||
wrr XOR htw -> z39
|
||||
cwh XOR tpd -> z07
|
||||
gcs XOR hdc -> z05
|
||||
rng AND mdw -> rhp
|
||||
cwh AND tpd -> ddj
|
||||
x43 AND y43 -> jjk
|
||||
hhm AND jts -> swm
|
||||
x04 AND y04 -> hrr
|
||||
qhg OR jgj -> shd
|
||||
y44 AND x44 -> kbb
|
||||
gpb AND cwn -> prp
|
||||
y42 AND x42 -> vcd
|
||||
y38 AND x38 -> trc
|
||||
mvv XOR fvm -> z20
|
||||
qjh XOR qcm -> z33
|
||||
y05 AND x05 -> dkr
|
||||
pfh AND gqg -> khw
|
||||
y03 XOR x03 -> tkd
|
||||
x25 XOR y25 -> dwk
|
||||
phm AND bjw -> bcm
|
||||
y31 XOR x31 -> gpb
|
||||
y28 AND x28 -> pcd
|
||||
hdc AND gcs -> fdd
|
||||
ffw XOR cjf -> z11
|
||||
y21 XOR x21 -> hgs
|
||||
fcd XOR nkw -> z41
|
||||
kqs XOR vjk -> z22
|
||||
x36 AND y36 -> rhv
|
||||
x34 XOR y34 -> tjv
|
||||
y25 AND x25 -> cbg
|
||||
x24 XOR y24 -> mdw
|
||||
rpk AND rfs -> fkk
|
||||
x24 AND y24 -> rwd
|
||||
y11 AND x11 -> mdb
|
||||
phm XOR bjw -> z40
|
||||
tsp OR bpn -> cwn
|
||||
y29 XOR x29 -> nrv
|
||||
nhw OR qdc -> qcm
|
||||
tjv XOR dsf -> z34
|
||||
x21 AND y21 -> mvp
|
||||
x08 AND y08 -> bnr
|
||||
gqr OR mdb -> pvw
|
||||
sfw AND gnf -> tsh
|
||||
mfc AND gqf -> bwd
|
||||
y35 AND x35 -> nbb
|
||||
x09 XOR y09 -> csk
|
||||
qfj OR mqg -> hhh
|
||||
x22 AND y22 -> kqk
|
||||
x08 XOR y08 -> wcg
|
||||
y37 XOR x37 -> mfc
|
||||
wrn XOR fww -> z18
|
||||
rvw OR rsm -> dnb
|
||||
x23 AND y23 -> mcw
|
||||
wwc OR hch -> ntr
|
||||
x22 XOR y22 -> vjk
|
||||
gqf XOR mfc -> z37
|
||||
sth AND bhw -> htp
|
||||
rng XOR mdw -> z24
|
||||
y04 XOR x04 -> kkt
|
||||
fsf XOR pvw -> z12
|
||||
bpg XOR kpk -> z10
|
||||
x02 AND y02 -> qhg
|
||||
x19 XOR y19 -> nhr
|
||||
cbg OR srg -> dwp
|
||||
pfh XOR gqg -> z44
|
||||
y00 AND x00 -> wsg
|
||||
x33 XOR y33 -> qjh
|
||||
jts XOR hhm -> z17
|
||||
y32 XOR x32 -> ncw
|
||||
fww AND wrn -> gfq
|
||||
qcn OR fjq -> vsk
|
||||
nsg AND kkt -> dhf
|
||||
y32 AND x32 -> qdc
|
||||
bgf OR sfb -> tpd
|
||||
dnb AND bsv -> bcn
|
||||
y28 XOR x28 -> phk
|
||||
tds AND mqr -> kvv
|
||||
wtf OR qwn -> phm
|
||||
pss XOR csk -> z09
|
||||
kwp OR sbk -> vnp
|
||||
y26 AND x26 -> rvw
|
||||
mvv AND fvm -> qfj
|
||||
y15 AND x15 -> hhb
|
||||
hbb XOR nrv -> z29
|
||||
dsn AND wcg -> rms
|
||||
bnr OR rms -> pss
|
||||
nfn OR cwj -> sth
|
||||
mvp OR wms -> kqs
|
||||
khg XOR hdd -> z14
|
||||
bwd OR rnr -> wjn
|
||||
x18 AND y18 -> twv
|
||||
rfs XOR rpk -> z35
|
||||
dwk AND fbs -> srg
|
||||
prp OR dmf -> qjs
|
||||
nbb OR fkk -> hpg
|
||||
ncw XOR qjs -> z32
|
||||
pcd OR wff -> hbb
|
||||
y43 XOR x43 -> jmq
|
||||
hkg OR mcw -> rng
|
||||
x09 AND y09 -> hww
|
||||
y13 AND x13 -> fhs
|
||||
qfg AND bvc -> bgf
|
||||
y18 XOR x18 -> wrn
|
||||
phk XOR rkf -> z28
|
||||
x06 XOR y06 -> qfg
|
||||
y00 XOR x00 -> z00
|
||||
x16 XOR y16 -> tds
|
||||
hgs AND hhh -> wms
|
||||
fkc OR vcd -> vpb
|
||||
y03 AND x03 -> rrr
|
||||
thc OR rrr -> nsg
|
||||
sfw XOR gnf -> z13
|
||||
bvc XOR qfg -> z06
|
||||
wsg AND pnw -> hch
|
||||
y39 XOR x39 -> htw
|
||||
x12 AND y12 -> npc
|
||||
vjk AND kqs -> shk
|
||||
ggk XOR hpg -> z36
|
||||
gjs XOR vsh -> z23
|
||||
ddj OR ktn -> dsn
|
||||
x38 XOR y38 -> nbw
|
||||
y33 AND x33 -> mqv
|
||||
ggk AND hpg -> bqf
|
||||
npc OR hsf -> sfw
|
||||
y16 AND x16 -> wmd
|
||||
vsh AND gjs -> hkg
|
||||
x10 XOR y10 -> kpk
|
||||
mcd OR mqv -> dsf
|
||||
x05 XOR y05 -> hdc
|
||||
wcg XOR dsn -> z08
|
||||
x41 XOR y41 -> nkw
|
||||
mts AND ntr -> jgj
|
||||
bcm OR mpd -> fcd
|
||||
tds XOR mqr -> z16
|
||||
vsk AND svf -> fkc
|
||||
x27 XOR y27 -> bsv
|
||||
bqf OR rhv -> gqf
|
||||
kbb OR khw -> z45
|
||||
nrv AND hbb -> kwp
|
||||
csk AND pss -> fqq
|
||||
y34 AND x34 -> cjq
|
||||
x20 AND y20 -> mqg
|
||||
tsh OR fhs -> hdd
|
||||
wks AND nhr -> hcq
|
||||
cjq OR bsh -> rfs
|
||||
gfq OR twv -> wks
|
||||
rwd OR rhp -> fbs
|
||||
y37 AND x37 -> rnr
|
||||
vfs OR jgd -> cjf
|
||||
y31 AND x31 -> dmf
|
||||
kpk AND bpg -> jgd
|
||||
y36 XOR x36 -> ggk
|
||||
y42 XOR x42 -> svf
|
||||
bjs XOR vnp -> z30
|
||||
cst OR jjk -> gqg
|
||||
y40 XOR x40 -> bjw
|
||||
cjf AND ffw -> gqr
|
||||
fcd AND nkw -> fjq
|
||||
y01 XOR x01 -> pnw
|
||||
dnb XOR bsv -> z27
|
||||
wsg XOR pnw -> z01
|
||||
y41 AND x41 -> qcn
|
||||
y06 AND x06 -> sfb
|
||||
gpb XOR cwn -> z31
|
||||
x02 XOR y02 -> mts
|
||||
shd XOR tkd -> z03
|
||||
dwk XOR fbs -> z25
|
||||
y11 XOR x11 -> ffw
|
||||
phk AND rkf -> wff
|
||||
jmq AND vpb -> cst
|
||||
bcn OR tts -> rkf
|
||||
y07 AND x07 -> ktn
|
||||
x17 AND y17 -> rrk
|
||||
x10 AND y10 -> vfs
|
||||
fwn XOR dwp -> z26
|
||||
x01 AND y01 -> wwc
|
||||
htw AND wrr -> wtf
|
||||
y15 XOR x15 -> bhw
|
||||
Loaded 100 of 106 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user