Browse Source

Day 14 (had to resort to using the test data for part 1)

Petra Lamborn 11 months ago
parent
commit
2d19356c28
3 changed files with 652 additions and 0 deletions
  1. 76
    0
      14.R
  2. 572
    0
      input14.txt
  3. 4
    0
      input14test.txt

+ 76
- 0
14.R View File

@@ -0,0 +1,76 @@
1
+library(stringr)
2
+input <- readLines("input14.txt")
3
+
4
+# bits <- numeric(36)
5
+twop <- 2^(35:0)
6
+dat <- list()
7
+
8
+cmask <- rep("X", 36)
9
+
10
+
11
+for (ln in input) {
12
+    if (grepl("^mask", ln)) {
13
+        cmask <- unlist(str_split(str_extract(ln, "[X10]+$"), ""))
14
+    } else if (grepl("^mem", ln)) {
15
+        vp <- str_match(ln, "^mem\\[(\\d+)\\] = (\\d+$)")
16
+        memadr <- vp[1,2]
17
+        tval <- as.numeric(vp[1,3])
18
+        bits <- numeric(36)
19
+        for (x in 1:length(twop)) {
20
+            if (tval >= twop[x]) {
21
+                tval = tval - twop[x]
22
+                bits[x] <- 1
23
+            }
24
+        }
25
+        bits <- ifelse(cmask == "X", bits, as.numeric(cmask))
26
+        dat[[memadr]] <- sum(bits * twop)
27
+    }
28
+}
29
+
30
+print(sum(unlist(dat)), digits = 15)
31
+
32
+num2bin <- function(x) {
33
+    bits <- numeric(36)
34
+    for (i in 1:length(twop)) {
35
+        if (x >= twop[i]) {
36
+            x = x - twop[i]
37
+            bits[i] <- 1
38
+        }
39
+    }
40
+    bits
41
+}
42
+
43
+allposs <- function(bits) {
44
+    isX <- which(is.na(bits))
45
+    if(length(isX) != 0) {
46
+        gridm <- as.matrix(expand.grid(lapply(isX, function(x) {0:1})))
47
+        colnames(gridm) <- NULL
48
+        return(apply(gridm, 1, function(r) {
49
+                  bits[isX] <- r
50
+                  sum(bits * twop)
51
+        }))
52
+    } else {
53
+        return(sum(bits * twop))
54
+    }
55
+}
56
+
57
+dat <- list()
58
+
59
+for (ln in input) {
60
+    if (grepl("^mask", ln)) {
61
+        cmask <- unlist(str_split(str_extract(ln, "[X10]+$"), ""))
62
+        cmask <- ifelse(cmask == "X", NA, ifelse(cmask == "1", 1, 0))
63
+    } else if (grepl("^mem", ln)) {
64
+        vp <- str_match(ln, "^mem\\[(\\d+)\\] = (\\d+$)")
65
+        memadr <- num2bin(as.numeric(vp[1,2]))
66
+        tval <- as.numeric(vp[1,3])
67
+        memadr <- ifelse(is.na(cmask), NA, ifelse(cmask == 1, 1, memadr))
68
+        memadr <- allposs(memadr)
69
+        for (m in memadr) {
70
+            dat[[as.character(m)]] <- tval
71
+        }
72
+        
73
+    }
74
+}
75
+
76
+print(sum(unlist(dat)), digits = 15)

+ 572
- 0
input14.txt View File

@@ -0,0 +1,572 @@
1
+mask = 11110100010101111011001X0100XX00100X
2
+mem[17610] = 1035852
3
+mem[55284] = 229776690
4
+mem[16166] = 12685380
5
+mem[8340] = 16011
6
+mask = 0X1X0X010101011X10X101000X0001110100
7
+mem[968] = 15992
8
+mem[32758] = 7076
9
+mem[30704] = 1701
10
+mem[33719] = 58012
11
+mem[20818] = 25927237
12
+mem[16718] = 46485
13
+mask = 111001111X0X0X101X111X1X001XX0011010
14
+mem[2115] = 14848
15
+mem[42753] = 617
16
+mem[56076] = 9933868
17
+mem[19106] = 43503
18
+mem[10073] = 32909
19
+mem[40830] = 1959686
20
+mask = X11X00000XX1011X10000X01110000X0001X
21
+mem[41605] = 13245557
22
+mem[6571] = 7973763
23
+mem[46231] = 28527162
24
+mem[44901] = 163334644
25
+mask = 0101XXX1X10XX1101011110000000010010X
26
+mem[53492] = 357272
27
+mem[32816] = 35015
28
+mem[6965] = 11280352
29
+mem[27745] = 160101
30
+mem[26728] = 1260
31
+mask = 1XXX0100XX1X0X10101100011101101X0111
32
+mem[22010] = 28123044
33
+mem[42154] = 82539
34
+mem[54914] = 22078
35
+mem[7185] = 436
36
+mem[58583] = 25334197
37
+mask = 11110010X001011010X1XX010XX0110001XX
38
+mem[62397] = 9570559
39
+mem[49595] = 15491062
40
+mem[21644] = 9478776
41
+mem[19853] = 31023
42
+mask = 001110000101011X1111100XX1111000X111
43
+mem[62345] = 1200300
44
+mem[34309] = 115943357
45
+mem[23144] = 873
46
+mem[36010] = 954
47
+mem[6857] = 645222
48
+mask = 0011X101110X10101111000X010X00100000
49
+mem[12284] = 570
50
+mem[44849] = 48293
51
+mem[48549] = 489763617
52
+mem[51371] = 1151
53
+mask = 01X0X10101000XXX10111010011010XX0X10
54
+mem[17699] = 14190020
55
+mem[32796] = 84255743
56
+mem[62003] = 1426
57
+mem[18906] = 353
58
+mem[38218] = 615297
59
+mask = 0X0101010111XXX01011010111XX01100010
60
+mem[26389] = 62531634
61
+mem[12404] = 1034263
62
+mem[49398] = 1006
63
+mem[22929] = 313056
64
+mem[16164] = 1694664
65
+mem[19077] = 53452
66
+mask = 0X1XXX0X010101101X1110XX101010X01010
67
+mem[38381] = 18385
68
+mem[2319] = 552
69
+mem[60857] = 1931
70
+mem[41219] = 19301038
71
+mem[9073] = 85077
72
+mask = 00010000010XX1X01000110101100X000111
73
+mem[10385] = 227941
74
+mem[31042] = 151514106
75
+mem[22360] = 168649336
76
+mask = 0110010X0100XX10001X11X1X11100XX0X11
77
+mem[40411] = 8140928
78
+mem[3859] = 2742
79
+mem[45449] = 4317450
80
+mem[17740] = 1337381
81
+mem[19338] = 6605990
82
+mem[22407] = 53051
83
+mem[42292] = 550664
84
+mask = X1110XX00X0101101011XX0X101110001111
85
+mem[59509] = 304929
86
+mem[43817] = 14977
87
+mem[39410] = 439
88
+mem[38730] = 34567670
89
+mem[31862] = 8027039
90
+mem[60857] = 5209
91
+mask = X11X0000X1X101X010110XX011111011X011
92
+mem[28472] = 14882
93
+mem[50099] = 1135
94
+mem[58921] = 980796
95
+mem[50737] = 36974
96
+mem[54167] = 22140347
97
+mem[2139] = 22934
98
+mem[13202] = 136157
99
+mask = X1X001X1010001X0X0111100101110X0X101
100
+mem[911] = 8925
101
+mem[652] = 183714641
102
+mem[58633] = 5186611
103
+mem[41763] = 29030
104
+mask = 011X01010010001110110X0X1100000000X1
105
+mem[47324] = 8124
106
+mem[31660] = 355290
107
+mem[19624] = 1760
108
+mem[32635] = 27873924
109
+mem[45190] = 439446159
110
+mem[1090] = 428
111
+mask = XX10000X00011X1X1011010X0001110X0101
112
+mem[40622] = 1839170
113
+mem[45103] = 108379641
114
+mem[29222] = 187252
115
+mem[42753] = 2592089
116
+mem[46615] = 4466791
117
+mem[22416] = 6619543
118
+mask = X0X101X10X000010XXX10110111011011101
119
+mem[42154] = 3271203
120
+mem[10355] = 89584861
121
+mem[14447] = 383415
122
+mask = 1X000X001X100X10X0X1X01X1101X0110101
123
+mem[40691] = 1490354
124
+mem[6162] = 601597339
125
+mem[62819] = 15727
126
+mem[48596] = 8589566
127
+mem[46732] = 56337
128
+mem[35437] = 1568988
129
+mask = 00X0X10X01010110X0111X0XX01100001111
130
+mem[43285] = 75734
131
+mem[41605] = 46442
132
+mem[7672] = 667983
133
+mem[29222] = 9835
134
+mem[34949] = 3945167
135
+mask = 01X00101X101001010X1100X0X11X110X101
136
+mem[8617] = 182201
137
+mem[33667] = 11585659
138
+mem[57414] = 235257
139
+mask = 0111010001010XX01X11XX1011XX101X1011
140
+mem[19633] = 3970
141
+mem[10580] = 6454804
142
+mem[22445] = 12328278
143
+mem[22131] = 70709
144
+mem[31438] = 870851666
145
+mem[46279] = 638924631
146
+mem[20402] = 311245
147
+mask = 0110000101X1X11010111X001111X1000111
148
+mem[2405] = 733626
149
+mem[27649] = 150996
150
+mem[45000] = 13156617
151
+mask = 01X10X0X01X10110101101X1X1X00100011X
152
+mem[44304] = 5130
153
+mem[25804] = 264101480
154
+mem[896] = 1445
155
+mem[20949] = 386031115
156
+mem[24951] = 9889
157
+mem[51040] = 3708234
158
+mask = 00100X01010101101111100010XX0100X1XX
159
+mem[31907] = 15551
160
+mem[1218] = 1034
161
+mem[17073] = 359232
162
+mask = 010100010101X1101X11011X010001XXXXX0
163
+mem[11137] = 1499158
164
+mem[59509] = 262392
165
+mem[6988] = 14863
166
+mem[28213] = 554
167
+mem[7044] = 68
168
+mask = 01100101X1XX0X10X01110X1001X00X00X11
169
+mem[22674] = 3230
170
+mem[35891] = 3585
171
+mem[3551] = 15928515
172
+mem[36206] = 104461320
173
+mem[22167] = 1161073
174
+mask = 01X1X00X01010X1010111X010XX00011X101
175
+mem[17360] = 494
176
+mem[34415] = 3766044
177
+mem[8898] = 846638
178
+mem[48368] = 500781
179
+mask = 011001010X0X001X0X101X010X100101100X
180
+mem[60679] = 10414
181
+mem[34463] = 11
182
+mask = 01100100010XX11X1X0X0000001111010011
183
+mem[40952] = 1659
184
+mem[27502] = 2916485
185
+mem[7436] = 211741
186
+mem[58641] = 944726
187
+mem[58633] = 46218913
188
+mask = 010110000101011X101101X0111110X00X11
189
+mem[3042] = 13844
190
+mem[49701] = 56163826
191
+mask = 011001X00101011010X1100010X11X011X11
192
+mem[38067] = 7299191
193
+mem[31130] = 116061
194
+mem[2139] = 63458254
195
+mem[4521] = 1237
196
+mask = 0111X000X1010110101X011100100100011X
197
+mem[21329] = 642
198
+mem[41123] = 28058
199
+mem[29555] = 4111
200
+mem[15009] = 3801745
201
+mem[49595] = 317
202
+mem[56642] = 126724425
203
+mem[29388] = 19214321
204
+mask = 1101X1X0X11X101011X01X11X0111X001X01
205
+mem[20118] = 21164480
206
+mem[39432] = 508
207
+mem[39859] = 958
208
+mem[36851] = 196470
209
+mem[26907] = 97849565
210
+mask = XX10000011110X001011XX0010X110100001
211
+mem[34234] = 17652327
212
+mem[16028] = 80890944
213
+mem[54559] = 64040
214
+mem[25194] = 41593756
215
+mask = 001110000101X1101XX1000X10110000110X
216
+mem[33667] = 916652067
217
+mem[2405] = 1244
218
+mem[63718] = 292918
219
+mem[29526] = 711465
220
+mem[24951] = 1884
221
+mem[22360] = 167190303
222
+mask = 1100000000111X11101X0110X00010X00100
223
+mem[6620] = 2734891
224
+mem[64584] = 215747822
225
+mask = 01X00X000100101000X11000X01110100X01
226
+mem[56211] = 3278176
227
+mem[40364] = 340370
228
+mem[23555] = 27655
229
+mem[42471] = 227213
230
+mask = 1X10X1111101X110X011X000X0X0X10011X0
231
+mem[6829] = 110833304
232
+mem[15624] = 23686
233
+mem[59705] = 5391933
234
+mem[10724] = 32064
235
+mem[14827] = 6939
236
+mask = X1X1100001010X111011101X00110X000010
237
+mem[50595] = 719945
238
+mem[1480] = 39227195
239
+mem[52615] = 124668762
240
+mask = 01100XX1110X011XX01100001011X1X10X10
241
+mem[58924] = 3492
242
+mem[16850] = 584
243
+mem[61283] = 289490093
244
+mem[20396] = 55247
245
+mem[12216] = 9844180
246
+mem[12216] = 14974951
247
+mask = 00X00101010101X010111000101XX0100001
248
+mem[4778] = 4486654
249
+mem[24826] = 1334889
250
+mem[30412] = 685
251
+mem[424] = 40892660
252
+mem[19019] = 87071
253
+mem[58641] = 13743890
254
+mask = 011100XXX10101101X0X00010001011100X0
255
+mem[10355] = 392450
256
+mem[20082] = 23264
257
+mem[25220] = 1800190
258
+mem[59108] = 141835
259
+mem[58233] = 543
260
+mem[48973] = 863
261
+mem[54167] = 28960
262
+mask = 1110X0000001X11010110000X1011XXX1010
263
+mem[52783] = 2071776
264
+mem[60857] = 108259027
265
+mem[37356] = 2641268
266
+mem[21950] = 47481758
267
+mem[52557] = 7700825
268
+mask = 0X11010XX10X001011110010111000101001
269
+mem[58111] = 244589936
270
+mem[41399] = 42658
271
+mem[27306] = 237040
272
+mem[4122] = 1592
273
+mask = X1X00X0111110110101XX1001001X0010X10
274
+mem[6801] = 34789897
275
+mem[59447] = 10675177
276
+mem[28987] = 666686
277
+mask = X110000X000110X11011111000X11100010X
278
+mem[424] = 2927
279
+mem[30920] = 894899
280
+mem[1670] = 305032596
281
+mask = 0111X01000X1X1101011001X111000011010
282
+mem[29811] = 632621
283
+mem[40046] = 51323
284
+mem[55593] = 6182
285
+mask = 01100011100XX11X00X110X011110XX10101
286
+mem[58803] = 484311
287
+mem[49237] = 12281
288
+mem[46823] = 1332
289
+mem[24356] = 1277234
290
+mem[42561] = 1938
291
+mem[14991] = 8909
292
+mask = 0111X00000X101101X11101010111X001111
293
+mem[8482] = 2735
294
+mem[36657] = 64651206
295
+mem[3842] = 157
296
+mem[60137] = 483271
297
+mem[5610] = 709
298
+mask = XX1X00X00X01X11010111X001101110X1111
299
+mem[22416] = 27971815
300
+mem[19192] = 7861
301
+mem[51678] = 25016
302
+mask = 011XX1111101XX101111001X001110010000
303
+mem[64535] = 155
304
+mem[38057] = 669
305
+mem[8482] = 29767095
306
+mask = 00100X000X010X10X111100X11100110X101
307
+mem[38067] = 10211
308
+mem[37762] = 11637
309
+mem[34706] = 44902
310
+mask = 0X11001100110XXX1011011X10X10X01100X
311
+mem[26809] = 2100865
312
+mem[60446] = 25094
313
+mem[43745] = 461971
314
+mem[24321] = 28927
315
+mem[7984] = 355769146
316
+mem[9488] = 1910
317
+mask = 0X1001X1X10X0X1010111X10X011X01X1111
318
+mem[51678] = 2889
319
+mem[46700] = 214866595
320
+mem[40992] = 4945733
321
+mem[25409] = 172376952
322
+mask = 0110011111X100101X11000XX110X0001X0X
323
+mem[11587] = 9651
324
+mem[41265] = 61660
325
+mem[1822] = 6155
326
+mem[29303] = 250909900
327
+mem[59145] = 51920318
328
+mask = 01X1X0X0X1010110101100101111100X0001
329
+mem[33719] = 2071728
330
+mem[24951] = 108
331
+mem[12284] = 369552742
332
+mem[55012] = 53272268
333
+mem[31862] = 3576
334
+mem[5950] = 460151
335
+mem[55978] = 53697916
336
+mask = XX1100000X01011010X1100011X01000X110
337
+mem[61606] = 1036
338
+mem[6477] = 81209
339
+mem[2187] = 6526467
340
+mask = 111000X011110100X011X0XXX11X10110X01
341
+mem[25194] = 7338343
342
+mem[16563] = 225968
343
+mem[51983] = 30985431
344
+mask = 0X000100010101101X11100X00011X111011
345
+mem[34309] = 434429
346
+mem[16850] = 476433401
347
+mem[63015] = 181118
348
+mask = X110001011X1010X1011010X1011X01100X0
349
+mem[19081] = 237103716
350
+mem[24300] = 10640
351
+mem[23963] = 430607
352
+mask = 0111XXXX001101101011000011XX00X01XX1
353
+mem[26941] = 27590
354
+mem[31862] = 20472
355
+mem[4020] = 3134353
356
+mem[55543] = 1761762
357
+mem[45048] = 1024489921
358
+mask = 11100111X10X111XX0X1000010111110101X
359
+mem[48596] = 3587524
360
+mem[2018] = 451398
361
+mem[54298] = 121634159
362
+mem[26371] = 5517119
363
+mem[57585] = 1825
364
+mask = 0111X00X0011X11010X10X100100X1100000
365
+mem[44281] = 1515553
366
+mem[36633] = 1289
367
+mem[30077] = 12046281
368
+mem[55362] = 226809
369
+mem[48993] = 794317
370
+mem[58968] = 241
371
+mask = X110010101100X10101110100011000XX001
372
+mem[22929] = 2072990
373
+mem[22931] = 336
374
+mem[31880] = 119168961
375
+mem[3859] = 49656496
376
+mem[45103] = 296484159
377
+mask = XX11000001011110100101100X0X01100101
378
+mem[41219] = 826
379
+mem[38539] = 22527609
380
+mem[40238] = 29540
381
+mem[34813] = 4305171
382
+mem[51640] = 4302332
383
+mem[44070] = 1373134
384
+mask = 011X0000X101011010011111X01X10101011
385
+mem[40884] = 256867181
386
+mem[56234] = 2181222
387
+mem[5950] = 68826
388
+mem[1760] = 88028804
389
+mem[50704] = 5302105
390
+mem[24366] = 442
391
+mem[10147] = 127227597
392
+mask = 0110X1100101X1101011X111100X0X0XX010
393
+mem[21956] = 121736133
394
+mem[25007] = 3174
395
+mem[42616] = 925004
396
+mem[1670] = 3018
397
+mem[46932] = 2981988
398
+mask = X1110011001XXXX01011011X1X1100011X01
399
+mem[61283] = 521975
400
+mem[27640] = 322
401
+mem[62514] = 153670214
402
+mem[23951] = 14226595
403
+mem[9549] = 2336533
404
+mem[11888] = 827772
405
+mask = 1101X100XXX1X010111000XX0001000X10X1
406
+mem[16797] = 22808
407
+mem[48021] = 2258240
408
+mem[12370] = 185157105
409
+mask = 01110X0X00XX0X1X10110100X10X01000010
410
+mem[4594] = 93
411
+mem[57388] = 665641765
412
+mem[1345] = 361710791
413
+mem[37543] = 1730
414
+mem[57136] = 388716965
415
+mem[42524] = 553
416
+mem[13403] = 637623155
417
+mask = 0110X1X0X101011X10110110100101011110
418
+mem[16512] = 3631
419
+mem[11337] = 203803846
420
+mem[2504] = 336583240
421
+mem[12269] = 4069068
422
+mask = 01XX001111001110101100001X01000100X0
423
+mem[33661] = 6490
424
+mem[30704] = 128919282
425
+mem[41797] = 22490
426
+mem[8134] = 38294563
427
+mem[63208] = 12103
428
+mask = 11X00X0000X1XX1X101100010000010011XX
429
+mem[24951] = 3275742
430
+mem[23998] = 1551
431
+mem[19972] = 5727596
432
+mem[17337] = 205937438
433
+mem[41952] = 53261
434
+mem[64651] = 26734
435
+mask = X11001111101XX101X110X001011100X0X1X
436
+mem[57388] = 441426
437
+mem[11337] = 336
438
+mem[8515] = 381065399
439
+mem[49625] = 1066556272
440
+mem[54274] = 7650
441
+mem[8575] = 15426
442
+mem[18302] = 216253866
443
+mask = 1X0X00X000X11X1110110100110111X1X101
444
+mem[6256] = 17076091
445
+mem[7973] = 5554062
446
+mem[39859] = 1429203
447
+mask = 0X110001011101101X1111101001XX000110
448
+mem[38807] = 351
449
+mem[28213] = 22387
450
+mem[26591] = 76518875
451
+mem[15712] = 12048675
452
+mask = 01X1XX00010101101011X111XX1010XX1011
453
+mem[9073] = 789
454
+mem[39859] = 919291385
455
+mem[18302] = 347
456
+mem[41224] = 4579691
457
+mem[41167] = 19132842
458
+mem[424] = 158741911
459
+mask = X110010X0100X010X0100X00XX111001X011
460
+mem[28822] = 66019
461
+mem[46209] = 2719
462
+mem[35264] = 1826
463
+mem[60137] = 389000
464
+mask = 01010001X101X11010110X111111X1000001
465
+mem[16591] = 62860121
466
+mem[10737] = 1180
467
+mem[31130] = 16000
468
+mem[34880] = 584
469
+mem[6800] = 39
470
+mask = 0111X000X1XX11101001010X00110010011X
471
+mem[5501] = 31780835
472
+mem[31862] = 6009
473
+mem[49129] = 91037
474
+mem[7935] = 15099
475
+mem[44839] = 31518815
476
+mask = 0101000101011110X1110111000001XXX000
477
+mem[14827] = 1206371
478
+mem[62398] = 1062
479
+mem[50952] = 1253562
480
+mem[32584] = 22533969
481
+mem[9662] = 2590
482
+mask = 01100X111X0X1110XX111X000X1101000001
483
+mem[40142] = 107915
484
+mem[10580] = 4884244
485
+mem[2187] = 1020
486
+mask = 11X100XX1001X1X0101X01X1001X11111100
487
+mem[19551] = 54829
488
+mem[18208] = 627039
489
+mem[18032] = 3423
490
+mem[24162] = 301557348
491
+mem[35891] = 1206
492
+mask = 01100111110100X0XX1X1011XXX100101000
493
+mem[9695] = 368318059
494
+mem[9916] = 30083984
495
+mem[9903] = 866066456
496
+mem[3360] = 434642
497
+mem[3609] = 2437
498
+mask = 0XX1X000010XX1X0100X1010X10100X00111
499
+mem[64662] = 5845
500
+mem[20000] = 2302117
501
+mem[21056] = 11248
502
+mem[641] = 200833516
503
+mem[46678] = 3506929
504
+mask = 0X100111111100101111110X01110X00010X
505
+mem[59199] = 1984963
506
+mem[43784] = 7811709
507
+mem[49701] = 3967
508
+mem[11888] = 790487
509
+mask = 111X00000101111010010X10001101XX11X0
510
+mem[51082] = 222096294
511
+mem[50595] = 121297
512
+mem[27424] = 268132
513
+mem[9473] = 200971
514
+mem[42941] = 1604
515
+mask = 0X11010X1X00X01011110010111XX010X00X
516
+mem[44304] = 31572
517
+mem[14907] = 1066531
518
+mem[34745] = 91393
519
+mem[1617] = 124090
520
+mem[25898] = 49692
521
+mask = X11X01000X010X111X1X10100000010X10X0
522
+mem[12953] = 62465686
523
+mem[24718] = 15597133
524
+mem[20124] = 4930329
525
+mask = 0X11010000X10X1010110111XX00X1XX101X
526
+mem[12426] = 694
527
+mem[2226] = 70693
528
+mem[6332] = 3693756
529
+mask = 0111100000110XX010X11000X1X111011010
530
+mem[42447] = 86599788
531
+mem[62694] = 50365
532
+mem[59239] = 4355782
533
+mem[12523] = 14292673
534
+mem[52756] = 2685769
535
+mem[54978] = 207845
536
+mem[17699] = 366567692
537
+mask = 011001011111X0XX101100000X10X0X01011
538
+mem[8186] = 1183
539
+mem[6181] = 8087
540
+mem[61605] = 3505
541
+mem[46678] = 85544
542
+mem[40046] = 5212041
543
+mem[28835] = 3272650
544
+mask = 011100000101X11010X1011X10X1XX00X011
545
+mem[55012] = 105058
546
+mem[52202] = 26295
547
+mem[59657] = 2809
548
+mask = X1X10100X101XXX0X110001110001XX01001
549
+mem[45682] = 323588
550
+mem[49237] = 58065
551
+mem[41032] = 27927
552
+mem[35647] = 280
553
+mem[47892] = 252817
554
+mem[29350] = 15075
555
+mask = X11100X0010X01X010111101001100000010
556
+mem[34234] = 10472
557
+mem[14531] = 102821
558
+mem[49081] = 3626197
559
+mem[62940] = 630043
560
+mem[4115] = 453716952
561
+mask = 0111010001XX0110111X0101100X1X10101X
562
+mem[911] = 198069
563
+mem[5550] = 42378
564
+mem[27566] = 13692
565
+mem[13890] = 46764242
566
+mem[11669] = 66225421
567
+mem[54529] = 652599152
568
+mask = X11X01X00X01011X10110110X00X100X10X0
569
+mem[7236] = 3301
570
+mem[10580] = 971
571
+mem[51284] = 232016
572
+mem[13784] = 33278200

+ 4
- 0
input14test.txt View File

@@ -0,0 +1,4 @@
1
+mask = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X
2
+mem[8] = 11
3
+mem[7] = 101
4
+mem[8] = 0