diff options
-rw-r--r-- | aoc.cabal | 6 | ||||
-rw-r--r-- | execs/Day14.hs | 68 | ||||
-rw-r--r-- | input/14 | 590 | ||||
-rw-r--r-- | input/14sample | 4 |
4 files changed, 668 insertions, 0 deletions
@@ -99,3 +99,9 @@ executable Day13 | |||
99 | build-depends: base, aoc, containers, split | 99 | build-depends: base, aoc, containers, split |
100 | default-language: Haskell2010 | 100 | default-language: Haskell2010 |
101 | hs-source-dirs: execs | 101 | hs-source-dirs: execs |
102 | |||
103 | executable Day14 | ||
104 | main-is: Day14.hs | ||
105 | build-depends: base, aoc, containers, parsec, strings | ||
106 | default-language: Haskell2010 | ||
107 | hs-source-dirs: execs | ||
diff --git a/execs/Day14.hs b/execs/Day14.hs new file mode 100644 index 0000000..d82424a --- /dev/null +++ b/execs/Day14.hs | |||
@@ -0,0 +1,68 @@ | |||
1 | module Main where | ||
2 | |||
3 | import Utils | ||
4 | import Text.ParserCombinators.Parsec | ||
5 | import Text.Parsec.Char | ||
6 | import Data.Either | ||
7 | import Data.Char | ||
8 | import Data.Strings | ||
9 | import Numeric (showIntAtBase, readInt) | ||
10 | import Data.Map (Map) | ||
11 | import qualified Data.Map as Map | ||
12 | |||
13 | data Stmt = Mask String | Mem Int Int deriving Show | ||
14 | |||
15 | parseMask :: Parser Stmt | ||
16 | parseMask = string "mask = " >> Mask <$> many anyChar | ||
17 | |||
18 | parseMem :: Parser Stmt | ||
19 | parseMem = do | ||
20 | one <- string "mem[" >> many1 digit | ||
21 | two <- string "] = " >> many1 digit | ||
22 | return $ Mem (read one) (read two) | ||
23 | |||
24 | parseLine :: Parser Stmt | ||
25 | parseLine = try parseMask <|> parseMem | ||
26 | |||
27 | applyMask :: Int -> String -> Int | ||
28 | applyMask v m = fst $ head $ readInt 2 (`elem` "01") digitToInt wm | ||
29 | where bv = strPadLeft '0' 36 $ showIntAtBase 2 intToDigit v "" | ||
30 | wm = zipWith fn bv m | ||
31 | fn o 'X' = o | ||
32 | fn _ '1' = '1' | ||
33 | fn _ '0' = '0' | ||
34 | |||
35 | runProgram :: [Stmt] -> Int | ||
36 | runProgram ls = sum regs | ||
37 | where (mask, regs) = foldl fn ("", Map.empty) ls | ||
38 | fn (_, regs) (Mask s) = (s, regs) | ||
39 | fn (m, regs) (Mem idx val) = (m, Map.insert idx nval regs) | ||
40 | where nval = applyMask val m | ||
41 | |||
42 | floatings :: String -> [String] | ||
43 | floatings [] = [[]] | ||
44 | floatings ('X':xs) = floatings xs >>= (\b -> ['0':b, '1':b]) | ||
45 | floatings (x:xs) = map (x:) $ floatings xs | ||
46 | |||
47 | genIdxs :: Int -> String -> [Int] | ||
48 | genIdxs v m = map (fst . head . readInt 2 (`elem` "01") digitToInt) (floatings wm) | ||
49 | where bv = strPadLeft '0' 36 $ showIntAtBase 2 intToDigit v "" | ||
50 | wm = zipWith fn bv m | ||
51 | fn o '0' = o | ||
52 | fn _ '1' = '1' | ||
53 | fn _ 'X' = 'X' | ||
54 | |||
55 | v2chip :: [Stmt] -> Int | ||
56 | v2chip ls = sum regs | ||
57 | where (mask, regs) = foldl fn ("", Map.empty) ls | ||
58 | fn (_, regs) (Mask s) = (s, regs) | ||
59 | fn (m, regs) (Mem idx val) = (m, nmap) | ||
60 | where idxs = genIdxs idx m | ||
61 | nmap = flip Map.union regs $ Map.fromList $ zip idxs $ repeat val | ||
62 | |||
63 | |||
64 | main :: IO () | ||
65 | main = do | ||
66 | n <- rights . map (parse parseLine "main") . lines <$> readFile "input/14" | ||
67 | print $ runProgram n | ||
68 | print $ v2chip n | ||
diff --git a/input/14 b/input/14 new file mode 100644 index 0000000..1b33a0d --- /dev/null +++ b/input/14 | |||
@@ -0,0 +1,590 @@ | |||
1 | mask = 10X0110X01100X00111XX00001X011101001 | ||
2 | mem[45673] = 370803 | ||
3 | mem[32234] = 92667525 | ||
4 | mem[47600] = 955 | ||
5 | mem[6610] = 316949 | ||
6 | mask = 0X10X001X00011X1111X111111010100X000 | ||
7 | mem[13551] = 903991 | ||
8 | mem[45894] = 160707 | ||
9 | mem[4188] = 64891428 | ||
10 | mem[43779] = 4687114 | ||
11 | mem[51764] = 53700515 | ||
12 | mask = 01X0X0001X10XX1001001111X0101111010X | ||
13 | mem[34881] = 3311 | ||
14 | mem[23766] = 26540481 | ||
15 | mem[4785] = 13080077 | ||
16 | mem[43617] = 238523796 | ||
17 | mask = 010X100X010000101X100101011X0110X00X | ||
18 | mem[4166] = 16195 | ||
19 | mem[21001] = 622 | ||
20 | mem[13952] = 245 | ||
21 | mem[43083] = 105622 | ||
22 | mem[11083] = 8400 | ||
23 | mem[35492] = 48568 | ||
24 | mask = X100X00XX1100X111111001001000X00X110 | ||
25 | mem[50918] = 9999 | ||
26 | mem[59535] = 70467 | ||
27 | mem[20502] = 87635 | ||
28 | mem[57441] = 113 | ||
29 | mem[21256] = 398644 | ||
30 | mem[43258] = 307 | ||
31 | mask = 1000XX00X1100X0XXX1110010X1001101001 | ||
32 | mem[14095] = 944 | ||
33 | mem[12960] = 7270083 | ||
34 | mem[666] = 4745792 | ||
35 | mem[43494] = 702 | ||
36 | mem[55637] = 86020085 | ||
37 | mem[61142] = 10437888 | ||
38 | mask = 11101XX01110X11011011101XX0100X0100X | ||
39 | mem[57379] = 4533 | ||
40 | mem[48229] = 15994 | ||
41 | mem[22693] = 1881 | ||
42 | mem[44857] = 286865340 | ||
43 | mem[17331] = 8492087 | ||
44 | mem[25889] = 1613193 | ||
45 | mask = 0000100X0110X1111X0X11X00000X10XX1X1 | ||
46 | mem[57477] = 6196148 | ||
47 | mem[6101] = 15304384 | ||
48 | mem[57864] = 200431 | ||
49 | mask = 000X1X0001X0111X1111001000X0101011X0 | ||
50 | mem[44569] = 3960 | ||
51 | mem[39386] = 4949396 | ||
52 | mem[9324] = 96252 | ||
53 | mem[10664] = 3252 | ||
54 | mem[33233] = 50858274 | ||
55 | mem[41081] = 203824750 | ||
56 | mem[6645] = 34497265 | ||
57 | mask = 000011010010111X11111X00010X1100011X | ||
58 | mem[3293] = 233493759 | ||
59 | mem[18956] = 118389 | ||
60 | mem[1025] = 5036522 | ||
61 | mask = 10X0X0X0011001X111111X01X110001X0XX0 | ||
62 | mem[4097] = 107862 | ||
63 | mem[6873] = 2097 | ||
64 | mask = 0100100XX1100X111111X001010111X01100 | ||
65 | mem[61230] = 540498103 | ||
66 | mem[47962] = 2753 | ||
67 | mem[37400] = 2327554 | ||
68 | mem[30629] = 1110830 | ||
69 | mem[53020] = 5591877 | ||
70 | mask = 10100X000101111X111X0X001110X0000101 | ||
71 | mem[54388] = 26326 | ||
72 | mem[419] = 1567 | ||
73 | mem[5373] = 2530 | ||
74 | mem[60258] = 33744 | ||
75 | mask = X1101000X11011X0110X1X0X000X0010X0X1 | ||
76 | mem[54088] = 256796 | ||
77 | mem[38615] = 38356 | ||
78 | mem[40164] = 31653 | ||
79 | mem[21378] = 76110 | ||
80 | mem[33233] = 277981788 | ||
81 | mem[2571] = 133984535 | ||
82 | mem[11562] = 879 | ||
83 | mask = 1X000X00010101011X10110X11111001XX11 | ||
84 | mem[34740] = 8869920 | ||
85 | mem[22740] = 521027 | ||
86 | mem[33792] = 96794 | ||
87 | mem[37005] = 862607 | ||
88 | mem[22723] = 317832765 | ||
89 | mem[26555] = 20923879 | ||
90 | mem[22410] = 54159 | ||
91 | mask = 00X010XX11101111X1111X0X1X000111X001 | ||
92 | mem[26275] = 663 | ||
93 | mem[59230] = 226183705 | ||
94 | mem[41684] = 2128 | ||
95 | mem[54297] = 12877801 | ||
96 | mem[60773] = 376426529 | ||
97 | mem[20303] = 196221024 | ||
98 | mask = 101X1000X1X10101111X11X0X110010100XX | ||
99 | mem[22528] = 16249 | ||
100 | mem[57494] = 279620437 | ||
101 | mem[58026] = 31278 | ||
102 | mem[37016] = 4312 | ||
103 | mem[9883] = 921 | ||
104 | mem[41007] = 1465898 | ||
105 | mem[40481] = 1671783 | ||
106 | mask = 0X0X100001X01X10111X0X01000110101101 | ||
107 | mem[10406] = 997 | ||
108 | mem[38062] = 59582680 | ||
109 | mem[10708] = 198003209 | ||
110 | mem[46873] = 408862 | ||
111 | mem[11077] = 459424361 | ||
112 | mem[5727] = 1700448 | ||
113 | mem[14726] = 2676553 | ||
114 | mask = 10101X10011X000X101X0111X10X1000X0X1 | ||
115 | mem[10664] = 1516 | ||
116 | mem[30273] = 75130511 | ||
117 | mem[35601] = 25120037 | ||
118 | mem[49009] = 1173 | ||
119 | mask = 0X00100001101X1110010100X0001XX001X1 | ||
120 | mem[49285] = 7571 | ||
121 | mem[64534] = 1098 | ||
122 | mem[32768] = 200634491 | ||
123 | mask = 0000100X01100X101101X110X0X011110100 | ||
124 | mem[22416] = 30148149 | ||
125 | mem[60551] = 149806 | ||
126 | mem[2296] = 213850419 | ||
127 | mem[41081] = 39093 | ||
128 | mem[27329] = 216373847 | ||
129 | mask = 0X00100011X0001011000XX1011001011101 | ||
130 | mem[18054] = 9320576 | ||
131 | mem[54549] = 890 | ||
132 | mem[41636] = 251377782 | ||
133 | mem[2838] = 33263103 | ||
134 | mem[17995] = 30197595 | ||
135 | mask = 01X1100X1X10011001XXX0000X0011010010 | ||
136 | mem[49674] = 40088568 | ||
137 | mem[13699] = 9623301 | ||
138 | mem[17255] = 102507 | ||
139 | mem[1482] = 950983 | ||
140 | mem[25007] = 209244 | ||
141 | mem[49349] = 6079 | ||
142 | mask = 00X011X1X0001101XX10010XX01111000001 | ||
143 | mem[5196] = 30458917 | ||
144 | mem[50829] = 8251485 | ||
145 | mask = 010X1000X1100X10XX0X010X000011X10X01 | ||
146 | mem[32774] = 10963415 | ||
147 | mem[41684] = 371254 | ||
148 | mem[5706] = 6352 | ||
149 | mem[57962] = 1978534 | ||
150 | mem[8949] = 573680 | ||
151 | mask = 000010010X11X1X1X11X00X00X00X110110X | ||
152 | mem[60127] = 25613364 | ||
153 | mem[54388] = 5567 | ||
154 | mem[1653] = 1153 | ||
155 | mem[49977] = 2608790 | ||
156 | mem[9352] = 121392208 | ||
157 | mask = 101000X0011001111X11000XX01000000001 | ||
158 | mem[54320] = 11715 | ||
159 | mem[26597] = 1278105 | ||
160 | mem[34204] = 6005345 | ||
161 | mask = 100X000100001111111001X1010X0111100X | ||
162 | mem[17355] = 75752606 | ||
163 | mem[53353] = 41600 | ||
164 | mem[45075] = 4191461 | ||
165 | mask = 000X0X0X0000111111101X000101XXX0110X | ||
166 | mem[27128] = 1953 | ||
167 | mem[17909] = 1884792 | ||
168 | mem[51151] = 161966299 | ||
169 | mem[60933] = 477409 | ||
170 | mem[39509] = 502 | ||
171 | mask = 10X0100001X10001001001X10101010100X0 | ||
172 | mem[26096] = 7205 | ||
173 | mem[39089] = 53634109 | ||
174 | mem[3545] = 339663043 | ||
175 | mask = 01X01X00011X00X01X0011X1001001X10011 | ||
176 | mem[34827] = 1959 | ||
177 | mem[22616] = 29090401 | ||
178 | mem[37561] = 18 | ||
179 | mask = 11XX100X0X10110011011101000100000001 | ||
180 | mem[57541] = 2764656 | ||
181 | mem[39464] = 945 | ||
182 | mem[34491] = 42267 | ||
183 | mem[56023] = 6588 | ||
184 | mem[59338] = 227140650 | ||
185 | mem[8359] = 3521567 | ||
186 | mem[41266] = 2122 | ||
187 | mask = XX00XX00011000101XXX0101XX0001100111 | ||
188 | mem[21001] = 467174080 | ||
189 | mem[40395] = 368280 | ||
190 | mem[21797] = 32584 | ||
191 | mem[51282] = 6472405 | ||
192 | mem[21479] = 38767 | ||
193 | mem[35943] = 1352511 | ||
194 | mask = 0X000001X0X0X11111X0111000111XX00101 | ||
195 | mem[19657] = 22615287 | ||
196 | mem[26805] = 864204812 | ||
197 | mem[42351] = 5662 | ||
198 | mem[2495] = 43866067 | ||
199 | mem[52318] = 1650 | ||
200 | mask = 0000X0X00X1001111101X11X010XX1010101 | ||
201 | mem[54816] = 774 | ||
202 | mem[18176] = 2028911 | ||
203 | mem[24777] = 8250958 | ||
204 | mask = X0001X0X0X1011111111X1000X0011000111 | ||
205 | mem[40738] = 2113 | ||
206 | mem[32774] = 484919091 | ||
207 | mem[39152] = 628235 | ||
208 | mem[54496] = 5964 | ||
209 | mem[40103] = 7433792 | ||
210 | mask = 0101100XX010X110011100000X00X0000X11 | ||
211 | mem[17488] = 3678 | ||
212 | mem[22963] = 519281 | ||
213 | mem[36751] = 85353835 | ||
214 | mem[47241] = 2092837 | ||
215 | mask = 00X0000100101111X11X00X0111XX1XX10X1 | ||
216 | mem[1650] = 922793 | ||
217 | mem[41636] = 6071583 | ||
218 | mem[36791] = 722 | ||
219 | mem[45902] = 372891111 | ||
220 | mask = 0001X1X01110011X010X001110X10001X00X | ||
221 | mem[15382] = 246575660 | ||
222 | mem[10047] = 2031 | ||
223 | mem[33628] = 11165 | ||
224 | mem[59682] = 71030 | ||
225 | mask = XX01100010X001100X11X0X11X00100011X1 | ||
226 | mem[1239] = 750 | ||
227 | mem[7827] = 242729 | ||
228 | mem[2838] = 10048934 | ||
229 | mem[40971] = 531387 | ||
230 | mem[26539] = 9562 | ||
231 | mem[10664] = 1779885 | ||
232 | mask = X0X000X0011101XX1111011100000100X011 | ||
233 | mem[13229] = 118094981 | ||
234 | mem[22915] = 127258 | ||
235 | mem[57384] = 2073 | ||
236 | mem[18067] = 44857 | ||
237 | mem[1653] = 149132182 | ||
238 | mem[17291] = 395470 | ||
239 | mask = 00XX100101100X11X1X00000001010010101 | ||
240 | mem[31462] = 3975909 | ||
241 | mem[49220] = 466696245 | ||
242 | mem[50776] = 887 | ||
243 | mem[48644] = 241048 | ||
244 | mask = 0100X000X100XX111111X010010110011100 | ||
245 | mem[29775] = 441 | ||
246 | mem[52222] = 5446718 | ||
247 | mask = 101010X001XX01111011010101010100010X | ||
248 | mem[16127] = 264083 | ||
249 | mem[27345] = 5194478 | ||
250 | mem[26269] = 167664051 | ||
251 | mem[34669] = 802625 | ||
252 | mask = 0100100001X00X1111110XX00X00X00101X0 | ||
253 | mem[21223] = 48966793 | ||
254 | mem[55118] = 225912 | ||
255 | mem[29898] = 1032 | ||
256 | mem[34679] = 318500 | ||
257 | mem[18584] = 5184511 | ||
258 | mem[53788] = 381219 | ||
259 | mask = 00000001001011XX11100000X100X0101001 | ||
260 | mem[20373] = 668 | ||
261 | mem[16238] = 532704 | ||
262 | mem[19062] = 680735783 | ||
263 | mem[57683] = 382 | ||
264 | mem[64534] = 305874 | ||
265 | mem[29567] = 71891 | ||
266 | mem[55384] = 8257807 | ||
267 | mask = 010010000110011X10XXX1011011X0010011 | ||
268 | mem[8834] = 27346290 | ||
269 | mem[26882] = 5857155 | ||
270 | mem[65399] = 28233 | ||
271 | mem[15313] = 9758 | ||
272 | mem[19856] = 15131 | ||
273 | mem[21792] = 452232 | ||
274 | mask = X0100X000110011111110X0X01XX100111X1 | ||
275 | mem[36885] = 11870 | ||
276 | mem[23633] = 8017694 | ||
277 | mem[49960] = 59066 | ||
278 | mask = 000010010X10011X110X11010X1100011101 | ||
279 | mem[52222] = 7906 | ||
280 | mem[50113] = 20025 | ||
281 | mem[62759] = 60742 | ||
282 | mem[42818] = 24123 | ||
283 | mem[20196] = 2695677 | ||
284 | mem[56150] = 2043641 | ||
285 | mask = 000010X10010011111110000XX1X01101101 | ||
286 | mem[14726] = 163931507 | ||
287 | mem[64534] = 10658257 | ||
288 | mem[36548] = 2016635 | ||
289 | mem[53328] = 1547 | ||
290 | mem[37016] = 29161 | ||
291 | mem[49509] = 204 | ||
292 | mem[54816] = 133927223 | ||
293 | mask = X000X000011X0101111111X00X00X000X011 | ||
294 | mem[63137] = 65851 | ||
295 | mem[3078] = 46729269 | ||
296 | mem[28777] = 44750 | ||
297 | mem[8050] = 2134 | ||
298 | mask = 0010100XX000X1011XX00101011001000110 | ||
299 | mem[42058] = 1405824 | ||
300 | mem[56633] = 3470500 | ||
301 | mem[18390] = 40628 | ||
302 | mask = 0100X00X01100X10100XX100011000X00011 | ||
303 | mem[23954] = 26996858 | ||
304 | mem[42351] = 4571897 | ||
305 | mem[39152] = 5572 | ||
306 | mem[22233] = 1518947 | ||
307 | mem[3293] = 261 | ||
308 | mask = 10X010X00111011X1110111011X000X10001 | ||
309 | mem[10419] = 119957 | ||
310 | mem[64222] = 1935417 | ||
311 | mem[39073] = 7184 | ||
312 | mask = 00001000111001101001XX10XX00X00X011X | ||
313 | mem[18840] = 6949 | ||
314 | mem[54130] = 31279452 | ||
315 | mem[56463] = 2468673 | ||
316 | mem[12291] = 94799059 | ||
317 | mem[31014] = 130 | ||
318 | mask = 0100100X11X000X011010X0X0X00110011X1 | ||
319 | mem[55653] = 780405166 | ||
320 | mem[17373] = 289755 | ||
321 | mem[55275] = 129895 | ||
322 | mask = X0001XX001110111101001X10100X0010010 | ||
323 | mem[61610] = 176605034 | ||
324 | mem[26181] = 1694 | ||
325 | mem[40235] = 249848880 | ||
326 | mem[65399] = 58927 | ||
327 | mem[4769] = 197080137 | ||
328 | mem[2885] = 88722 | ||
329 | mask = 010110X011X001X10100010X110111010011 | ||
330 | mem[19697] = 49908 | ||
331 | mem[49644] = 27297 | ||
332 | mem[46331] = 68362 | ||
333 | mem[23374] = 4476652 | ||
334 | mem[38046] = 152384 | ||
335 | mask = 01001000X1X000X01X100X00XX00010010X0 | ||
336 | mem[57824] = 238363421 | ||
337 | mem[13229] = 141760722 | ||
338 | mem[12259] = 67177 | ||
339 | mem[24101] = 3496418 | ||
340 | mem[38370] = 125455 | ||
341 | mem[49997] = 1619802 | ||
342 | mask = X0XX1001X0X111110111110X10100X0110X0 | ||
343 | mem[57151] = 27210 | ||
344 | mem[51757] = 94709766 | ||
345 | mem[27009] = 184467 | ||
346 | mem[65310] = 623337 | ||
347 | mem[8310] = 6432 | ||
348 | mem[42814] = 312612328 | ||
349 | mask = 000X11X0X1100110X10X00X1X0X100001X01 | ||
350 | mem[51449] = 233840 | ||
351 | mem[33113] = 336176 | ||
352 | mem[24215] = 583439 | ||
353 | mem[32484] = 33697151 | ||
354 | mem[41246] = 35091190 | ||
355 | mem[45335] = 22504209 | ||
356 | mask = 00001X01XX00110111101000X11001000X00 | ||
357 | mem[49728] = 385 | ||
358 | mem[20071] = 19552156 | ||
359 | mem[36751] = 1381732 | ||
360 | mem[63977] = 140878 | ||
361 | mem[40754] = 8924389 | ||
362 | mem[31910] = 4771465 | ||
363 | mask = 0X101XX0111011101101101100XXX1X11111 | ||
364 | mem[4561] = 86501812 | ||
365 | mem[45894] = 15097769 | ||
366 | mem[52368] = 10598 | ||
367 | mem[57151] = 17927388 | ||
368 | mem[39781] = 121000932 | ||
369 | mask = 1X00X000XX10010111111101X00001X0000X | ||
370 | mem[40963] = 13692 | ||
371 | mem[44259] = 12653 | ||
372 | mask = 00X010000XX011111100100X001100010001 | ||
373 | mem[26454] = 7079 | ||
374 | mem[23082] = 1849 | ||
375 | mem[16238] = 112603 | ||
376 | mem[35527] = 3215051 | ||
377 | mask = 01X0100XX110XX10110X1X0100001100X0X1 | ||
378 | mem[22233] = 14653 | ||
379 | mem[65020] = 210017 | ||
380 | mem[52710] = 3469 | ||
381 | mem[4243] = 4204979 | ||
382 | mask = 00001100001X11110111001000X00000X10X | ||
383 | mem[54906] = 160425 | ||
384 | mem[2296] = 107308 | ||
385 | mem[25636] = 325676 | ||
386 | mem[1157] = 17126 | ||
387 | mem[18174] = 26645399 | ||
388 | mem[341] = 134 | ||
389 | mask = 00001X0X0X1X1111X111000001000XX01100 | ||
390 | mem[49509] = 1792437 | ||
391 | mem[9352] = 16691097 | ||
392 | mask = 01011000X110011010010XX00XX0X10X0000 | ||
393 | mem[47744] = 66265 | ||
394 | mem[17758] = 2364 | ||
395 | mem[58881] = 184736586 | ||
396 | mem[45874] = 3288 | ||
397 | mem[33128] = 1060635188 | ||
398 | mem[32851] = 8162 | ||
399 | mem[4758] = 8270611 | ||
400 | mask = 101010X0X1110X011010010111010X0100X1 | ||
401 | mem[65020] = 3436 | ||
402 | mem[7304] = 351967 | ||
403 | mem[20204] = 7690 | ||
404 | mem[52050] = 6767 | ||
405 | mem[42627] = 18681018 | ||
406 | mem[2302] = 309 | ||
407 | mask = 0X00X00111101111XX11111X100X011X0100 | ||
408 | mem[31161] = 4045 | ||
409 | mem[44948] = 998036 | ||
410 | mem[6417] = 1038591 | ||
411 | mem[19456] = 331767 | ||
412 | mem[13551] = 351590897 | ||
413 | mem[57397] = 2335810 | ||
414 | mem[27468] = 30148246 | ||
415 | mask = X0X010000111010111X10X011X0100110100 | ||
416 | mem[26334] = 2474013 | ||
417 | mem[17909] = 9019 | ||
418 | mem[7685] = 31 | ||
419 | mem[31203] = 88097 | ||
420 | mask = 0101100XX1XX011X01XX1100000X0011X101 | ||
421 | mem[33782] = 10039109 | ||
422 | mem[36350] = 13839 | ||
423 | mem[17355] = 5492 | ||
424 | mask = X000X00X110011111111X001110X001000X1 | ||
425 | mem[65020] = 81625042 | ||
426 | mem[34391] = 24765 | ||
427 | mem[22616] = 6081 | ||
428 | mem[40777] = 5659 | ||
429 | mask = 10X01000011101X11X1XX101010X00X1X0X1 | ||
430 | mem[57202] = 334564 | ||
431 | mem[64222] = 2096644 | ||
432 | mem[24034] = 23828772 | ||
433 | mem[22410] = 146958 | ||
434 | mem[10664] = 57410819 | ||
435 | mem[40103] = 335 | ||
436 | mem[40501] = 115314 | ||
437 | mask = 0X000001001011X1111111011010000010XX | ||
438 | mem[20666] = 6659411 | ||
439 | mem[44873] = 41558959 | ||
440 | mem[33233] = 1051981 | ||
441 | mem[51278] = 6138 | ||
442 | mem[36171] = 1332906 | ||
443 | mem[6568] = 230 | ||
444 | mem[40776] = 4041579 | ||
445 | mask = 10101000110101011111100X10000X00XX10 | ||
446 | mem[11862] = 14638 | ||
447 | mem[18132] = 998819 | ||
448 | mem[11967] = 360999 | ||
449 | mem[6417] = 655336840 | ||
450 | mask = X0X10X010X001111X11010000001000101X0 | ||
451 | mem[21289] = 3642 | ||
452 | mem[45673] = 19810371 | ||
453 | mem[1416] = 92975839 | ||
454 | mask = XX00100001100X111X110010000010001011 | ||
455 | mem[51270] = 25149 | ||
456 | mem[42395] = 132570 | ||
457 | mem[1016] = 1001728 | ||
458 | mem[41825] = 2500361 | ||
459 | mem[17518] = 608172 | ||
460 | mem[41081] = 59823249 | ||
461 | mem[42445] = 47 | ||
462 | mask = 010X10001110001000000100X0X0110X00X0 | ||
463 | mem[53475] = 11095 | ||
464 | mem[33113] = 267232 | ||
465 | mem[29075] = 982 | ||
466 | mask = 1010XX00XXX1X111111X00011100X00100X1 | ||
467 | mem[22184] = 3304995 | ||
468 | mem[52883] = 286206091 | ||
469 | mem[17684] = 3033221 | ||
470 | mem[10660] = 834092 | ||
471 | mem[639] = 66342 | ||
472 | mem[10379] = 615664 | ||
473 | mem[47839] = 1155259 | ||
474 | mask = 00001X010110111110011X000X00100001XX | ||
475 | mem[53353] = 219728 | ||
476 | mem[65333] = 4002063 | ||
477 | mem[3492] = 891 | ||
478 | mem[6417] = 6050475 | ||
479 | mem[10047] = 53027987 | ||
480 | mem[57541] = 37059 | ||
481 | mem[29203] = 79275 | ||
482 | mask = 1X00X0X0011XX10X1110X0001010001X0X00 | ||
483 | mem[56853] = 3481 | ||
484 | mem[48818] = 70504232 | ||
485 | mask = 000XX1X01110X1100100011110X010X0X010 | ||
486 | mem[8087] = 894158 | ||
487 | mem[12413] = 146584 | ||
488 | mem[6706] = 2582 | ||
489 | mem[8095] = 30280 | ||
490 | mem[30578] = 163689 | ||
491 | mask = 0000X0X0011X00101010X10XX00001101XX1 | ||
492 | mem[16238] = 883 | ||
493 | mem[60302] = 1463 | ||
494 | mem[52026] = 501033 | ||
495 | mem[21101] = 963003 | ||
496 | mem[49342] = 37665 | ||
497 | mask = 1000010X01X00XX010X01100110001100111 | ||
498 | mem[21667] = 384155 | ||
499 | mem[54343] = 6134066 | ||
500 | mem[17373] = 80965 | ||
501 | mem[34043] = 15468883 | ||
502 | mem[855] = 750 | ||
503 | mem[3492] = 4885002 | ||
504 | mask = 1000X00001X10X01X0100X0111011101X001 | ||
505 | mem[38410] = 38053819 | ||
506 | mem[64257] = 7130584 | ||
507 | mem[23001] = 90831 | ||
508 | mem[29203] = 31460429 | ||
509 | mask = 00X000X100101111X11XXX000110X10X0011 | ||
510 | mem[53226] = 3680 | ||
511 | mem[43919] = 7913 | ||
512 | mem[23001] = 113363252 | ||
513 | mem[24130] = 594 | ||
514 | mask = X000X001XXX01111111X1101010X01X00001 | ||
515 | mem[56633] = 195050663 | ||
516 | mem[45339] = 58339099 | ||
517 | mem[34669] = 28208072 | ||
518 | mem[33167] = 107343266 | ||
519 | mem[55625] = 20752 | ||
520 | mem[56130] = 27956180 | ||
521 | mask = 000011X00X0XX110111X001X10111010X00X | ||
522 | mem[10675] = 342846 | ||
523 | mem[1723] = 1470723 | ||
524 | mem[51218] = 14886517 | ||
525 | mem[25654] = 468441 | ||
526 | mem[22233] = 750318 | ||
527 | mem[10638] = 1940647 | ||
528 | mem[49663] = 3527 | ||
529 | mask = 00X0XX01X00011X1111011X0011X01X001X0 | ||
530 | mem[21769] = 95158 | ||
531 | mem[18925] = 465784126 | ||
532 | mem[57920] = 873 | ||
533 | mem[29516] = 1870546 | ||
534 | mem[56132] = 145637 | ||
535 | mem[39089] = 16016081 | ||
536 | mem[40777] = 111866962 | ||
537 | mask = 0101100X111001X00100X10101001101001X | ||
538 | mem[46653] = 282150006 | ||
539 | mem[21001] = 26649672 | ||
540 | mask = 0000100X0X10X1X1111110X0X00X0000X1X1 | ||
541 | mem[57539] = 10584 | ||
542 | mem[54889] = 7790 | ||
543 | mem[50184] = 357116445 | ||
544 | mem[8050] = 8577 | ||
545 | mask = 11000000011XX01011011101100000XX0111 | ||
546 | mem[22120] = 2547919 | ||
547 | mem[64904] = 493040 | ||
548 | mem[17509] = 411541 | ||
549 | mem[6417] = 7691463 | ||
550 | mem[33118] = 840 | ||
551 | mask = 010010X001X00X111111011100X000X1X11X | ||
552 | mem[65020] = 222328295 | ||
553 | mem[30448] = 4080 | ||
554 | mem[52883] = 592 | ||
555 | mem[13763] = 1508 | ||
556 | mask = 010110X00110011X100001X0001001110X00 | ||
557 | mem[44389] = 839 | ||
558 | mem[25975] = 395854 | ||
559 | mem[20373] = 16016219 | ||
560 | mem[23886] = 68934677 | ||
561 | mem[41201] = 518 | ||
562 | mem[17454] = 738127 | ||
563 | mem[56227] = 806 | ||
564 | mask = 00001X00X1100X101X010X11X0000X000111 | ||
565 | mem[9822] = 2044 | ||
566 | mem[24640] = 24948181 | ||
567 | mem[24791] = 7537 | ||
568 | mem[39152] = 2411 | ||
569 | mem[18584] = 348 | ||
570 | mem[45337] = 98555334 | ||
571 | mem[53797] = 31216158 | ||
572 | mask = 0X0010000110011X11X101100XXXX1X001X1 | ||
573 | mem[36788] = 26899502 | ||
574 | mem[57344] = 9033077 | ||
575 | mem[2296] = 313866362 | ||
576 | mem[57429] = 96331601 | ||
577 | mem[6101] = 34417 | ||
578 | mask = 0000X000011001101XX110110X1X011X0111 | ||
579 | mem[50776] = 68004929 | ||
580 | mem[43617] = 775267546 | ||
581 | mem[60477] = 1699097 | ||
582 | mem[53328] = 155946 | ||
583 | mem[58881] = 5866890 | ||
584 | mem[19724] = 24153 | ||
585 | mask = 10000XX0010100011010011101X1010X1010 | ||
586 | mem[1157] = 392051 | ||
587 | mem[32234] = 43930 | ||
588 | mem[3987] = 213349 | ||
589 | mem[17692] = 467627 | ||
590 | mem[42272] = 5070 | ||
diff --git a/input/14sample b/input/14sample new file mode 100644 index 0000000..2e961e3 --- /dev/null +++ b/input/14sample | |||
@@ -0,0 +1,4 @@ | |||
1 | mask = 000000000000000000000000000000X1001X | ||
2 | mem[42] = 100 | ||
3 | mask = 00000000000000000000000000000000X0XX | ||
4 | mem[26] = 1 | ||