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