Day 15 add description"
[advent-of-code-2021.git] / day15 / task.txt
1 --- Day 15: Chiton ---
2
3 You've almost reached the exit of the cave, but the walls are getting closer
4 together. Your submarine can barely still fit, though; the main problem is that
5 the walls of the cave are covered in chitons, and it would be best not to bump
6 any of them.
7
8 The cavern is large, but has a very low ceiling, restricting your motion to two
9 dimensions. The shape of the cavern resembles a square; a quick scan of chiton
10 density produces a map of risk level throughout the cave (your puzzle input).
11 For example:
12
13 1163751742
14 1381373672
15 2136511328
16 3694931569
17 7463417111
18 1319128137
19 1359912421
20 3125421639
21 1293138521
22 2311944581
23
24 You start in the top left position, your destination is the bottom right
25 position, and you cannot move diagonally. The number at each position is its
26 risk level; to determine the total risk of an entire path, add up the risk
27 levels of each position you enter (that is, don't count the risk level of your
28 starting position unless you enter it; leaving it adds no risk to your total).
29
30 Your goal is to find a path with the lowest total risk. In this example, a path
31 with the lowest total risk is highlighted here:
32
33 1163751742
34 1381373672
35 2136511328
36 3694931569
37 7463417111
38 1319128137
39 1359912421
40 3125421639
41 1293138521
42 2311944581
43
44 The total risk of this path is 40 (the starting position is never entered, so
45 its risk is not counted).
46
47 What is the lowest total risk of any path from the top left to the bottom
48 right?
49
50 Your puzzle answer was 393.
51
52 --- Part Two ---
53
54 Now that you know how to find low-risk paths in the cave, you can try to find
55 your way out.
56
57 The entire cave is actually five times larger in both dimensions than you
58 thought; the area you originally scanned is just one tile in a 5x5 tile area
59 that forms the full map. Your original map tile repeats to the right and
60 downward; each time the tile repeats to the right or downward, all of its risk
61 levels are 1 higher than the tile immediately up or left of it. However, risk
62 levels above 9 wrap back around to 1. So, if your original map had some
63 position with a risk level of 8, then that same position on each of the 25
64 total tiles would be as follows:
65
66 8 9 1 2 3
67 9 1 2 3 4
68 1 2 3 4 5
69 2 3 4 5 6
70 3 4 5 6 7
71
72 Each single digit above corresponds to the example position with a value of 8
73 on the top-left tile. Because the full map is actually five times larger in
74 both dimensions, that position appears a total of 25 times, once in each
75 duplicated tile, with the values shown above.
76
77 Here is the full five-times-as-large version of the first example above, with
78 the original map in the top left corner highlighted:
79
80 11637517422274862853338597396444961841755517295286
81 13813736722492484783351359589446246169155735727126
82 21365113283247622439435873354154698446526571955763
83 36949315694715142671582625378269373648937148475914
84 74634171118574528222968563933317967414442817852555
85 13191281372421239248353234135946434524615754563572
86 13599124212461123532357223464346833457545794456865
87 31254216394236532741534764385264587549637569865174
88 12931385212314249632342535174345364628545647573965
89 23119445813422155692453326671356443778246755488935
90 22748628533385973964449618417555172952866628316397
91 24924847833513595894462461691557357271266846838237
92 32476224394358733541546984465265719557637682166874
93 47151426715826253782693736489371484759148259586125
94 85745282229685639333179674144428178525553928963666
95 24212392483532341359464345246157545635726865674683
96 24611235323572234643468334575457944568656815567976
97 42365327415347643852645875496375698651748671976285
98 23142496323425351743453646285456475739656758684176
99 34221556924533266713564437782467554889357866599146
100 33859739644496184175551729528666283163977739427418
101 35135958944624616915573572712668468382377957949348
102 43587335415469844652657195576376821668748793277985
103 58262537826937364893714847591482595861259361697236
104 96856393331796741444281785255539289636664139174777
105 35323413594643452461575456357268656746837976785794
106 35722346434683345754579445686568155679767926678187
107 53476438526458754963756986517486719762859782187396
108 34253517434536462854564757396567586841767869795287
109 45332667135644377824675548893578665991468977611257
110 44961841755517295286662831639777394274188841538529
111 46246169155735727126684683823779579493488168151459
112 54698446526571955763768216687487932779859814388196
113 69373648937148475914825958612593616972361472718347
114 17967414442817852555392896366641391747775241285888
115 46434524615754563572686567468379767857948187896815
116 46833457545794456865681556797679266781878137789298
117 64587549637569865174867197628597821873961893298417
118 45364628545647573965675868417678697952878971816398
119 56443778246755488935786659914689776112579188722368
120 55172952866628316397773942741888415385299952649631
121 57357271266846838237795794934881681514599279262561
122 65719557637682166874879327798598143881961925499217
123 71484759148259586125936169723614727183472583829458
124 28178525553928963666413917477752412858886352396999
125 57545635726865674683797678579481878968159298917926
126 57944568656815567976792667818781377892989248891319
127 75698651748671976285978218739618932984172914319528
128 56475739656758684176786979528789718163989182927419
129 67554889357866599146897761125791887223681299833479
130
131 Equipped with the full map, you can now find a path from the top left corner to
132 the bottom right corner with the lowest total risk:
133
134 11637517422274862853338597396444961841755517295286
135 13813736722492484783351359589446246169155735727126
136 21365113283247622439435873354154698446526571955763
137 36949315694715142671582625378269373648937148475914
138 74634171118574528222968563933317967414442817852555
139 13191281372421239248353234135946434524615754563572
140 13599124212461123532357223464346833457545794456865
141 31254216394236532741534764385264587549637569865174
142 12931385212314249632342535174345364628545647573965
143 23119445813422155692453326671356443778246755488935
144 22748628533385973964449618417555172952866628316397
145 24924847833513595894462461691557357271266846838237
146 32476224394358733541546984465265719557637682166874
147 47151426715826253782693736489371484759148259586125
148 85745282229685639333179674144428178525553928963666
149 24212392483532341359464345246157545635726865674683
150 24611235323572234643468334575457944568656815567976
151 42365327415347643852645875496375698651748671976285
152 23142496323425351743453646285456475739656758684176
153 34221556924533266713564437782467554889357866599146
154 33859739644496184175551729528666283163977739427418
155 35135958944624616915573572712668468382377957949348
156 43587335415469844652657195576376821668748793277985
157 58262537826937364893714847591482595861259361697236
158 96856393331796741444281785255539289636664139174777
159 35323413594643452461575456357268656746837976785794
160 35722346434683345754579445686568155679767926678187
161 53476438526458754963756986517486719762859782187396
162 34253517434536462854564757396567586841767869795287
163 45332667135644377824675548893578665991468977611257
164 44961841755517295286662831639777394274188841538529
165 46246169155735727126684683823779579493488168151459
166 54698446526571955763768216687487932779859814388196
167 69373648937148475914825958612593616972361472718347
168 17967414442817852555392896366641391747775241285888
169 46434524615754563572686567468379767857948187896815
170 46833457545794456865681556797679266781878137789298
171 64587549637569865174867197628597821873961893298417
172 45364628545647573965675868417678697952878971816398
173 56443778246755488935786659914689776112579188722368
174 55172952866628316397773942741888415385299952649631
175 57357271266846838237795794934881681514599279262561
176 65719557637682166874879327798598143881961925499217
177 71484759148259586125936169723614727183472583829458
178 28178525553928963666413917477752412858886352396999
179 57545635726865674683797678579481878968159298917926
180 57944568656815567976792667818781377892989248891319
181 75698651748671976285978218739618932984172914319528
182 56475739656758684176786979528789718163989182927419
183 67554889357866599146897761125791887223681299833479
184
185 The total risk of this path is 315 (the starting position is still never
186 entered, so its risk is not counted).
187
188 Using the full map, what is the lowest total risk of any path from the top left
189 to the bottom right?
190
191 Your puzzle answer was 2823.
192
193 Both parts of this puzzle are complete! They provide two gold stars: **
194
195 At this point, you should return to your Advent calendar and try another
196 puzzle.
197
198 If you still want to see it, you can get your puzzle input.
199
200 You can also [Share] this puzzle.
201