From 8f265f4169d5cc047d4158d141a2ed430215e865 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Mon, 9 May 2022 11:58:15 -0500 Subject: [PATCH] aoc --- aoc2020/.gitignore | 1 + aoc2020/1.py | 16 + aoc2020/1.txt | 200 ++++ aoc2020/14.hs | 46 + aoc2020/14.txt | 592 ++++++++++++ aoc2020/15.hs | 38 + aoc2020/15.py | 35 + aoc2020/16.py | 388 ++++++++ aoc2020/2.py | 20 + aoc2020/2.txt | 1000 ++++++++++++++++++++ aoc2020/3.py | 35 + aoc2020/3.txt | 323 +++++++ aoc2020/3_ex.txt | 11 + aoc2020/4.hs | 67 ++ aoc2020/4.txt | 953 +++++++++++++++++++ aoc2020/4_ex.txt | 13 + aoc2020/4_ex2.txt | 26 + aoc2020/5.py | 37 + aoc2020/5.txt | 782 ++++++++++++++++ aoc2020/6.hs | 12 + aoc2020/6.py | 15 + aoc2020/6.txt | 2239 ++++++++++++++++++++++++++++++++++++++++++++ aoc2020/7.py | 53 ++ aoc2020/7.txt | 594 ++++++++++++ aoc2020/7ex.txt | 9 + aoc2020/8.py | 44 + aoc2020/8.txt | 634 +++++++++++++ aoc2020/8ex.txt | 9 + aoc2020/9.py | 53 ++ aoc2020/9.txt | 1000 ++++++++++++++++++++ aoc2020/p15.nim | 33 + aoc2021/2.py | 35 + aoc2021/2.txt | 1001 ++++++++++++++++++++ 33 files changed, 10314 insertions(+) create mode 100644 aoc2020/.gitignore create mode 100644 aoc2020/1.py create mode 100644 aoc2020/1.txt create mode 100644 aoc2020/14.hs create mode 100644 aoc2020/14.txt create mode 100644 aoc2020/15.hs create mode 100644 aoc2020/15.py create mode 100644 aoc2020/16.py create mode 100644 aoc2020/2.py create mode 100644 aoc2020/2.txt create mode 100644 aoc2020/3.py create mode 100644 aoc2020/3.txt create mode 100644 aoc2020/3_ex.txt create mode 100644 aoc2020/4.hs create mode 100644 aoc2020/4.txt create mode 100644 aoc2020/4_ex.txt create mode 100644 aoc2020/4_ex2.txt create mode 100644 aoc2020/5.py create mode 100644 aoc2020/5.txt create mode 100644 aoc2020/6.hs create mode 100644 aoc2020/6.py create mode 100644 aoc2020/6.txt create mode 100644 aoc2020/7.py create mode 100644 aoc2020/7.txt create mode 100644 aoc2020/7ex.txt create mode 100644 aoc2020/8.py create mode 100644 aoc2020/8.txt create mode 100644 aoc2020/8ex.txt create mode 100644 aoc2020/9.py create mode 100644 aoc2020/9.txt create mode 100644 aoc2020/p15.nim create mode 100644 aoc2021/2.py create mode 100644 aoc2021/2.txt diff --git a/aoc2020/.gitignore b/aoc2020/.gitignore new file mode 100644 index 0000000..3a696dd --- /dev/null +++ b/aoc2020/.gitignore @@ -0,0 +1 @@ +/p15 diff --git a/aoc2020/1.py b/aoc2020/1.py new file mode 100644 index 0000000..2b2eb0d --- /dev/null +++ b/aoc2020/1.py @@ -0,0 +1,16 @@ +#!/bin/bash +data = [] +with open("1.txt") as f: + for line in f: + data.append(int(line)) + +for i in data: + for j in data: + if i != j and i + j == 2020: + print(i * j) + +for i in range(len(data)): + for j in range(i, len(data)): + for k in range(j, len(data)): + if data[i] + data[j] + data[k] == 2020: + print(data[i] * data[j] * data[k]) diff --git a/aoc2020/1.txt b/aoc2020/1.txt new file mode 100644 index 0000000..c9d1743 --- /dev/null +++ b/aoc2020/1.txt @@ -0,0 +1,200 @@ +1934 +1702 +1571 +1737 +1977 +1531 +1428 +1695 +1794 +1101 +13 +1164 +1235 +1289 +1736 +1814 +1363 +1147 +1111 +1431 +1765 +1515 +1184 +1036 +1803 +1791 +1638 +1809 +1283 +1980 +1854 +1878 +1574 +1352 +1151 +730 +1581 +1990 +1919 +2003 +1538 +1663 +1735 +1772 +1830 +1152 +1022 +1774 +1544 +1551 +1835 +1383 +1614 +1396 +1715 +1530 +295 +1208 +1978 +1104 +1691 +1176 +1183 +1909 +1192 +1535 +1924 +1268 +1969 +1954 +1760 +1077 +1734 +1371 +1676 +1933 +1400 +1928 +1982 +1541 +1106 +1248 +1346 +1782 +1142 +1849 +1798 +1362 +1379 +1886 +1265 +1226 +1751 +1575 +1027 +1710 +1601 +1205 +1922 +1452 +1206 +1263 +2000 +1957 +1951 +1834 +1533 +1149 +1245 +1564 +1182 +1237 +1013 +1254 +1895 +1504 +1480 +1556 +1821 +1589 +1864 +1573 +1698 +1927 +1434 +516 +1722 +1360 +1940 +1212 +1329 +1675 +1812 +1917 +1302 +1604 +1336 +1233 +1405 +1179 +1169 +1081 +1941 +1553 +1236 +1824 +1923 +1938 +1475 +1446 +1545 +1853 +1664 +317 +1489 +1884 +1743 +1621 +1128 +1474 +1505 +394 +1387 +1509 +1627 +1914 +1913 +1949 +1843 +1847 +1882 +1486 +1082 +1802 +1645 +1690 +1629 +1377 +2004 +1044 +1191 +1014 +1857 +1813 +1572 +1055 +1002 +1721 +1273 +1417 +1968 +1888 +1863 +1278 +1141 +1964 +1259 +1823 +1181 +1779 diff --git a/aoc2020/14.hs b/aoc2020/14.hs new file mode 100644 index 0000000..43c80cb --- /dev/null +++ b/aoc2020/14.hs @@ -0,0 +1,46 @@ +import Data.Bits +import Data.Int +import Data.List +import Debug.Trace +import Data.List.Split +import Data.Maybe +import qualified Data.Map.Strict as Map + +type State = (Int64, [Int], Map.Map Int64 Int64) + +parseMask :: (Int64, [Int]) -> (Int, Char) -> (Int64, [Int]) +parseMask (oMask, flucBits) (nth, ch) = + let oMask2 = if ch == '1' then oMask .|. (shift 1 nth) else oMask + flucBits2 = if ch == 'X' then nth : flucBits else flucBits in + (oMask2, flucBits2) + +applyMask :: Bits a => a -> (Int, Int) -> a +applyMask n (i, c) = if c == 0 then clearBit n i else setBit n i + +nextState :: State -> String -> State +nextState (oMask, flucBits, intMap) origLine = + if isPrefixOf "mask" origLine then + let line = fromJust $ stripPrefix "mask = " origLine in + let len = length line - 1 in + let enumLine = zip [len, len-1..0] line in + let (oMask, flucBits) = foldl parseMask (0, []) $ enumLine in + (oMask, flucBits, intMap) + else + let line = fromJust $ stripPrefix "mem[" origLine in + let [addr, value] = map read $ splitOn "] = " line in + let flucIter = sequence $ take (length flucBits) $ repeat [0, 1] in + let enumBits lines = zip flucBits lines in + let f = foldl applyMask (addr .|. oMask) . enumBits in + let addrs = map f flucIter in + let intMap2 = foldl (\acc el -> Map.insert el value acc) intMap addrs in + (oMask, flucBits, intMap2) + + +solve2 :: [String] -> Int64 +solve2 = sumElements . foldl nextState (0, [], Map.empty) + where sumElements (_, _, map) = Map.foldl (+) 0 map + +main :: IO () +main = do + l <- lines <$> readFile "14.txt" + print $ solve2 l diff --git a/aoc2020/14.txt b/aoc2020/14.txt new file mode 100644 index 0000000..32b3a5e --- /dev/null +++ b/aoc2020/14.txt @@ -0,0 +1,592 @@ +mask = 100X100X101011111X100000100X11010011 +mem[33323] = 349380 +mem[52742] = 116688965 +mem[4113] = 11499 +mem[15819] = 313303 +mem[23239] = 755579063 +mask = X00X10X1X010110110111X00010X100X000X +mem[49207] = 466621685 +mem[34069] = 6874604 +mask = 1001100XX00011110110100XX0110000001X +mem[61278] = 56361674 +mem[51360] = 61871432 +mem[31903] = 45067 +mask = 100X100XX0101X11X1X00X00001001X101X0 +mem[22981] = 144008 +mem[12013] = 49165315 +mem[54643] = 50677 +mem[59166] = 678129 +mem[64022] = 27522 +mask = 100110X0001X11011000101X1000001X00X0 +mem[32693] = 425145 +mem[11437] = 236593490 +mem[16078] = 227582 +mem[35266] = 197465438 +mem[39279] = 127942 +mask = 10101000X0X00001X1001000010100111X00 +mem[49794] = 2082 +mem[60407] = 2129 +mem[33300] = 921 +mem[18582] = 62106545 +mem[32160] = 843912 +mem[36917] = 7740 +mem[1836] = 54721591 +mask = 100010X1X0X011X1101XX00001X01000X10X +mem[8385] = 1381 +mem[38022] = 2501412 +mem[34713] = 3648024 +mem[33245] = 1178087 +mem[22176] = 263 +mem[20535] = 1289 +mem[2092] = 88590569 +mask = X001100X00X0X01X0X100X100010110XX101 +mem[65061] = 2768 +mem[56375] = 6734 +mem[18070] = 20571066 +mem[61511] = 403157281 +mem[4164] = 179682 +mem[11801] = 5501 +mem[22339] = 14414879 +mask = X0011000001X1001X0100111110X00110111 +mem[3844] = 1046 +mem[33741] = 109390 +mem[54311] = 94183595 +mem[48744] = 112575 +mem[29663] = 2042 +mask = X00X100000101001101001001X00001000X1 +mem[25325] = 177269 +mem[919] = 50779835 +mem[52113] = 2386630 +mem[60154] = 29645195 +mem[24761] = 8101 +mask = X101X000X01011011010X100001101110X01 +mem[5169] = 2865 +mem[55126] = 50829 +mem[60154] = 124556261 +mem[48753] = 377574 +mem[48662] = 9144531 +mask = 10011X00001010011010000101110XX0X00X +mem[41623] = 632353121 +mem[10365] = 70888870 +mem[59458] = 849 +mem[18992] = 486294339 +mask = X00X100X011011111100X00001001010100X +mem[42046] = 518245944 +mem[4654] = 39071 +mem[46109] = 1540 +mem[3245] = 822 +mem[25937] = 257692 +mem[19118] = 6601278 +mask = 1001001XXX100XXX101XX0001010001000X0 +mem[34356] = 55967 +mem[52601] = 522574 +mem[31903] = 7669828 +mem[36165] = 10552 +mask = 110X101X00X0111111XX001X0001000XX10X +mem[42649] = 1534730 +mem[8324] = 467628 +mem[9447] = 3054 +mem[41788] = 28205 +mem[9353] = 14315559 +mask = 1X01X01100111111X101000000X100100000 +mem[270] = 3208 +mem[20373] = 186089492 +mem[43940] = 449607191 +mem[63389] = 674 +mem[437] = 6933780 +mask = 1001X00001X01X0X101101X0010X00110110 +mem[22829] = 3301 +mem[59260] = 6763 +mem[22305] = 203360 +mask = 10011110101010X010XX011X0010001XX000 +mem[55041] = 6199 +mem[55452] = 151 +mem[2746] = 464657 +mask = 1001000000X0X10110X01101X00100111000 +mem[54354] = 666913 +mem[44827] = 214920 +mem[44621] = 13259544 +mem[29462] = 14725 +mem[27633] = 284739975 +mem[63195] = 11668372 +mask = 10X010X10100X111001X101010101X11100X +mem[21667] = 426958 +mem[55530] = 91533 +mem[10365] = 493 +mem[51246] = 513589450 +mem[44622] = 1773 +mem[4113] = 401 +mask = 100X1000001011XXX0100XXX100010X10X00 +mem[60407] = 869913 +mem[10365] = 59083 +mem[18321] = 3019 +mem[65061] = 10794134 +mem[62827] = 2777572 +mem[20373] = 23798334 +mask = 1000X10011X010011X10X0000101X0100001 +mem[17936] = 4347 +mem[38270] = 611 +mem[7408] = 2854792 +mem[2612] = 604172 +mem[24287] = 418220 +mem[27110] = 31440 +mem[64742] = 1872667 +mask = 10X110000010100110X001X01X1000000111 +mem[30518] = 13431 +mem[64496] = 204238 +mem[62259] = 1191 +mem[17457] = 3652 +mask = 100X1X0XX1101XX11010X000X01010010011 +mem[25325] = 67829 +mem[4021] = 8039 +mask = 1XXXXX0X0010110X11100111001111101110 +mem[34600] = 4128134 +mem[47565] = 28022073 +mask = X0X110000XX010X10010X0X111X111010101 +mem[64746] = 17532220 +mem[55786] = 109034 +mem[12715] = 185475 +mask = 1001110X011010111010X1010010100XX100 +mem[28923] = 1444 +mem[7508] = 41968 +mem[39856] = 447 +mem[19698] = 4420683 +mem[60924] = 7222 +mem[8056] = 225410214 +mask = 100X10X1X0X011X10110X01X011000X10X00 +mem[58206] = 585282 +mem[10984] = 105158307 +mem[31562] = 526874 +mem[60154] = 107013 +mem[4409] = 4126230 +mask = 1010100010X0XX0111X00X00011X000X0XX0 +mem[7122] = 428629 +mem[29394] = 262029322 +mem[33832] = 6067254 +mask = 0001100XXX0010X001100010X000110001X1 +mem[1975] = 32392 +mem[14891] = 9350 +mem[19905] = 28213400 +mem[11981] = 132973999 +mem[49582] = 4347 +mem[64106] = 235564 +mem[9648] = 1440 +mask = 000110010011XXXX0X1001010001X00X0100 +mem[18992] = 628 +mem[37263] = 1031 +mem[4387] = 1442306 +mem[2471] = 1123350 +mem[1493] = 88891215 +mem[22500] = 3553 +mem[6845] = 26007 +mask = 10011X00011011X1101X00X001X1X001X111 +mem[49101] = 13289 +mem[32] = 391365 +mem[31906] = 79 +mem[48744] = 71043 +mask = 1001X0X00010100110X001011001101X01X0 +mem[25999] = 2473051 +mem[36408] = 56819077 +mem[46656] = 2074748 +mem[10871] = 8606 +mem[7122] = 2053 +mem[59403] = 5442 +mask = 1XX0X01X100X11111010X000X00X000101X0 +mem[1160] = 280063168 +mem[20571] = 19030 +mem[23225] = 51089295 +mem[40992] = 17475 +mem[63413] = 1144 +mem[19458] = 284777610 +mem[21502] = 10410 +mask = 100X100X00101X0100X0X0X11100111XX11X +mem[33860] = 160 +mem[37007] = 56420 +mem[55140] = 490726 +mem[47752] = 521745 +mem[55594] = 336661995 +mem[44008] = 265991679 +mask = 1001100001X010011100100X01X0X011111X +mem[1289] = 55191 +mem[53058] = 23079796 +mem[25362] = 57315626 +mem[8895] = 35287816 +mask = 0001100100XX00100X1X0X00XX00XX000110 +mem[12568] = 136661 +mem[9931] = 303487 +mem[38781] = 91532 +mem[25506] = 950257996 +mem[3694] = 6225663 +mem[6631] = 62710499 +mem[3205] = 7586715 +mask = X0001000001X111110100000X0110001000X +mem[61696] = 34763 +mem[42583] = 2987088 +mem[8416] = 2293694 +mem[21503] = 8071 +mem[41788] = 950960 +mem[9648] = 23284946 +mask = 100010000010XX0XX01000000X011100X1X0 +mem[30270] = 421 +mem[52379] = 86815089 +mem[16627] = 3647190 +mem[36794] = 132421727 +mem[54580] = 248096 +mask = 10X1101000X01001X00111110101110001X0 +mem[48399] = 9196559 +mem[6869] = 32793911 +mem[20422] = 1560 +mem[12101] = 15618 +mem[25154] = 390003034 +mem[23791] = 229770864 +mem[49558] = 12206144 +mask = 100X10010X101XX1XXX000001X00101X1100 +mem[3205] = 110968351 +mem[65515] = 7362194 +mem[2197] = 52580964 +mem[13004] = 3723834 +mem[46931] = 24935229 +mem[919] = 6284 +mask = 10001X11100X1X1X10X111X100X0000010X1 +mem[30162] = 1665 +mem[35687] = 3554 +mem[3735] = 8003 +mem[18258] = 44276232 +mem[48625] = 401841687 +mem[62781] = 2814958 +mem[5302] = 175144514 +mask = 1001X0XX001X101110101000X11X00010X00 +mem[38152] = 42369373 +mem[36392] = 13302 +mem[13867] = 940605082 +mask = 10001100X11010X1101000X0X11100110011 +mem[63412] = 5289 +mem[788] = 6600 +mem[27915] = 254034 +mem[24347] = 16264001 +mem[52437] = 651358 +mask = 10011X0X0110X0X11X101100101100X11100 +mem[56524] = 1244173 +mem[64911] = 2124386 +mem[3815] = 107466 +mem[14375] = 6798 +mem[16285] = 66968238 +mem[7968] = 835823180 +mask = 10X110100X101XX110X11110XX0111001010 +mem[58730] = 132998954 +mem[8056] = 754181 +mem[39247] = 126 +mask = 1001X000001XX10110101X1110110X10101X +mem[59028] = 10817 +mem[17977] = 61299509 +mask = 1X001100X1X0100110100000X111XXX001X0 +mem[2056] = 32701076 +mem[2071] = 2401082 +mem[9887] = 998417 +mask = 100110X11X101X1110X00100X0101111X0X1 +mem[33860] = 388064 +mem[59050] = 16623098 +mem[5188] = 319 +mem[37207] = 2470432 +mem[27333] = 2026 +mask = 1000X000001X1X0X00XXX00X100011X11010 +mem[24029] = 9105 +mem[14364] = 243545984 +mem[4113] = 3279 +mask = 1X0X1001X0101011110XX1000100X000X101 +mem[17781] = 509963835 +mem[37716] = 62611707 +mem[23997] = 1023138975 +mem[5927] = 32777 +mem[55304] = 264062857 +mask = 100110X001X01X01100011100X100110X11X +mem[58338] = 741 +mem[34693] = 991498 +mem[32339] = 30979944 +mem[50216] = 66393532 +mem[29090] = 11574321 +mem[30824] = 15729 +mem[16868] = 23942 +mask = 1X0XX0010X0011110X101010111011111010 +mem[48969] = 3327849 +mem[52521] = 460105388 +mem[33860] = 422661865 +mem[44621] = 6715 +mem[27762] = 11952 +mem[34536] = 4064 +mask = 1001X001001X0011001000100110010001XX +mem[195] = 487302 +mem[17992] = 889 +mem[11858] = 958195 +mem[11013] = 202443463 +mask = 1000101X100X1111011000X100110000X001 +mem[13097] = 3534 +mem[41292] = 85120 +mem[9497] = 154119 +mem[19610] = 5709354 +mem[34972] = 48311 +mem[50753] = 180578 +mem[35921] = 667946365 +mask = XX1010X00110X00111000XX00001000110X0 +mem[3712] = 2843518 +mem[34604] = 2965 +mem[54311] = 162583 +mask = 0001X0X00100100X001000001X1X10X01X10 +mem[49406] = 965493 +mem[59050] = 392048 +mem[3574] = 922708604 +mem[7419] = 33525859 +mem[1933] = 8 +mem[4367] = 11521 +mask = 1001X0X00X10X00X101X00001110X0100X00 +mem[29215] = 417522 +mem[56468] = 34229032 +mem[26868] = 552971 +mem[36368] = 420213 +mask = 100110X0X1101011101X01X01101101X001X +mem[4913] = 455 +mem[3815] = 11211510 +mem[21545] = 1469 +mem[35762] = 1806 +mem[58825] = 3743 +mem[23225] = 474872535 +mem[53173] = 46538 +mask = 1XX0X00X0X101001001010100X0X01X00010 +mem[64106] = 98247289 +mem[13686] = 54961348 +mem[38944] = 462290318 +mem[53185] = 7075 +mem[30162] = 39454 +mem[14983] = 1010603 +mem[38339] = 970 +mask = X001100X010X111110001000001X01100110 +mem[12827] = 22328 +mem[18628] = 7082210 +mem[31013] = 20804915 +mem[13966] = 86 +mem[518] = 1757 +mask = X001100XX001001001110000000000XX1110 +mem[14375] = 8414661 +mem[1568] = 225486 +mem[25775] = 336197 +mask = 100110000X00100X100001100X111X100X01 +mem[2071] = 51386682 +mem[32897] = 162194 +mem[11308] = 1799417 +mem[20829] = 299249 +mask = 1X0010XXX0001111XX1100X001X1X0000101 +mem[29189] = 36530 +mem[657] = 114543286 +mem[9356] = 451 +mask = X000100000101X0110X0011XX10000110001 +mem[30577] = 117881 +mem[60874] = 19567558 +mem[10363] = 13493 +mem[5690] = 382 +mem[61059] = 4757304 +mem[36165] = 95983791 +mask = 100X00X00010100X1010000X101000X10000 +mem[33324] = 39476477 +mem[34713] = 7398 +mem[46214] = 98709 +mem[35856] = 1020446010 +mask = 10X01X000010000X11100101011X001X0100 +mem[65061] = 61054 +mem[54052] = 92826 +mem[35603] = 58759 +mem[58037] = 40910 +mem[62217] = 45701380 +mask = 1X011000001011011010XX00X10X0X010001 +mem[15920] = 5645 +mem[28828] = 265910022 +mem[29437] = 5544 +mem[56112] = 637 +mem[45033] = 36063036 +mem[12783] = 13776458 +mask = 10011011X010100110XX100100XX11011X00 +mem[518] = 25998191 +mem[13053] = 7866406 +mem[38152] = 3208 +mem[18730] = 711 +mask = 10X11000001XX1X000100X11101XX1X10111 +mem[47121] = 11272115 +mem[43618] = 27683 +mask = 100X1101X0101001100X010000X11001X100 +mem[21702] = 34688805 +mem[43624] = 3956780 +mem[24476] = 17239393 +mem[23321] = 25573609 +mem[15163] = 1713 +mem[65338] = 27386792 +mask = 10011010010X10011X0011110XX100001111 +mem[53501] = 16700270 +mem[28069] = 20683243 +mem[33593] = 114830 +mem[9962] = 403282549 +mem[54061] = 2336 +mem[46656] = 7039 +mem[58616] = 181 +mask = 10001X11001011XX101X0100010010101100 +mem[8738] = 234383093 +mem[11512] = 1792627 +mem[54326] = 1574223 +mask = 10011X101X10100XX000X10010X01X01100X +mem[51382] = 17879 +mem[44905] = 783 +mem[57514] = 1018128542 +mem[18628] = 240492 +mem[2108] = 3429 +mem[2304] = 3748 +mask = 0X011001X0X000X000110100101000000000 +mem[4452] = 19437119 +mem[64742] = 179090 +mem[16430] = 486207 +mask = 1001X000111X1X1110110X011111100X0011 +mem[52004] = 41486 +mem[48779] = 83675 +mem[17861] = 48577395 +mem[39247] = 16952 +mem[8738] = 3981 +mem[32923] = 1168904 +mask = 10011001XX0011X11X0010X1010X10101000 +mem[33319] = 44401 +mem[4142] = 517003945 +mem[29189] = 415157 +mem[33358] = 1395165 +mask = 1001100X010010011XX00XXX1100101X0101 +mem[13618] = 246280673 +mem[58338] = 17884 +mem[10885] = 816 +mem[11277] = 24331199 +mem[17936] = 1616051 +mask = 1001100X01X01001X00011000110X0X001XX +mem[58338] = 302363844 +mem[53596] = 175604903 +mem[56468] = 419729 +mem[27915] = 581 +mem[41501] = 69718 +mask = 100110000X1010110100X1X001X00X01001X +mem[18333] = 15544 +mem[3929] = 2622169 +mem[37718] = 176413 +mem[27333] = 848 +mem[17456] = 1097 +mask = 100110101010X001X000X0001X00001011X0 +mem[53045] = 2356198 +mem[49908] = 1086 +mem[17019] = 7107107 +mem[12013] = 70971 +mem[7048] = 1585 +mem[3666] = 4937143 +mask = 10011XXXX01010011000010X1X11100XXX00 +mem[65524] = 4129175 +mem[5636] = 315661 +mem[39270] = 455882795 +mask = X1001100110010011010000001110X0X00XX +mem[50481] = 26734 +mem[57708] = 199726127 +mem[20422] = 130991 +mem[13651] = 1094687 +mem[1292] = 60536 +mask = 110X1011001XX111110100X0000010X1X101 +mem[39644] = 14574 +mem[8596] = 30400 +mask = 1000101XX0X0X1110110111X110011X00110 +mem[919] = 32148 +mem[41] = 453324 +mem[36794] = 179133 +mem[2780] = 958033590 +mask = 100010X1X11011110010X01101101110X100 +mem[20035] = 1674335 +mem[18909] = 33271 +mem[21491] = 4013451 +mem[21792] = 78760 +mem[42156] = 980 +mem[3276] = 3971405 +mask = 10XX10000X10X00111X0XX00X0010011X100 +mem[36368] = 5097527 +mem[3099] = 104365 +mem[57092] = 74461253 +mem[46314] = 30483860 +mask = X000101X101011X10110XXX001X00X11X010 +mem[9948] = 43011947 +mem[53185] = 41588 +mem[25699] = 101124 +mem[60046] = 123243 +mem[23975] = 125991 +mask = 1X00100000X01X00101011100X1010000101 +mem[65101] = 504575 +mem[55313] = 14953613 +mem[42156] = 526 +mem[55573] = 1303957 +mem[53260] = 16252 +mem[48073] = 8667 +mask = 1001100100101X11110X0X0X0111X00001X0 +mem[10402] = 793546 +mem[45910] = 18 +mem[23627] = 72728 +mem[7408] = 16579752 +mem[22105] = 10576 +mem[61054] = 1160961 +mem[2989] = 149675383 +mask = 0001X001000000XX0111X110010001010110 +mem[15867] = 14 +mem[23379] = 10511918 +mem[4217] = 4840435 +mem[29978] = 11828937 +mem[28303] = 2358671 +mask = 10010010011X0XX11010X000110000110X00 +mem[11923] = 149358903 +mem[46246] = 3148 +mem[17596] = 9370 +mem[1540] = 12848 +mem[25775] = 29444 +mem[32564] = 64008 +mem[16097] = 641 +mask = 0X011001X010X010X0100X1X0X0X000111X1 +mem[45770] = 1008133 +mem[15551] = 3912928 +mem[53058] = 188856 +mem[44827] = 9036496 +mem[59530] = 20033543 +mask = 1001100X0XX01X0110X000XX010010XX1101 +mem[2056] = 737 +mem[34972] = 30655 +mem[50728] = 927954 +mask = 10001X0000X0X0010010101010X001100110 +mem[39247] = 425181 +mem[64200] = 13111811 +mem[8169] = 1250162 +mask = 100110000X10XXX11010X0001110X011XX00 +mem[62259] = 4350710 +mem[56112] = 42327 +mem[53173] = 2221557 +mem[36759] = 242686307 +mem[29077] = 1179326 +mem[2056] = 356 +mask = 10000000001XX000101000X0X11000X10110 +mem[18542] = 454113 +mem[44192] = 501708 +mem[54994] = 149470837 +mem[54260] = 582959 +mem[65424] = 295679271 +mem[36368] = 2002 +mem[16392] = 99 +mask = 10100001XX101001X0101100101101000XX0 +mem[17861] = 3340321 +mem[24705] = 4143350 +mem[38940] = 201585 +mem[35632] = 19204465 +mem[9443] = 5273035 +mask = 10X110010010100101000X00001010X0111X +mem[2991] = 51624 +mem[56468] = 1603 +mem[35633] = 4068 +mask = 10011X01001010X10000X011000111101X11 +mem[58842] = 69158 +mem[43765] = 1624 +mem[24913] = 133864698 +mem[15015] = 247 +mem[10155] = 1064 +mem[33787] = 142284522 +mem[17457] = 15488682 diff --git a/aoc2020/15.hs b/aoc2020/15.hs new file mode 100644 index 0000000..2bb3acf --- /dev/null +++ b/aoc2020/15.hs @@ -0,0 +1,38 @@ +import qualified Data.Map.Strict as Map +import Data.Map.Strict (Map) +import Debug.Trace +import Control.Monad.State + +-- 1st is turn number +-- 2nd is map of spoken +-- 3rd is next number to speak +type S = (Int, Map Int Int, Int) + +produceInitial lst = + let len = length lst + f acc (idx, el) = Map.insert el idx acc + initMap = foldl f Map.empty $ zip [0..] lst + in (len, initMap, 0) + +speak :: Int -> State S Int +speak n = do + (turn, spoken, nextSpeak) <- get + let lastSpoke = Map.lookup nextSpeak spoken + let spoken2 = Map.insert nextSpeak turn spoken + let nextSpeak2 = case lastSpoke of + Nothing -> 0 + Just n -> turn - n + let result = (turn + 1, spoken2, nextSpeak2) + -- modify (\_ -> traceShow result result) + modify (\_ -> result) + return nextSpeak + +speakStream lst = (++) lst $ flip evalState initial $ mapM speak [0..] + where initial = produceInitial lst + +actualInput = [5,1,9,18,13,8,0] +exInput = [0,3,6] +n = 30000000 +-- n = 2020 + +main = do print (speakStream actualInput !! (n-1)) diff --git a/aoc2020/15.py b/aoc2020/15.py new file mode 100644 index 0000000..685e25d --- /dev/null +++ b/aoc2020/15.py @@ -0,0 +1,35 @@ +ex=[0,3,6] + +def iter(start): + spoke=dict() + lastSpokeD=dict() + turn=0 + nextSpeak=None + for i in start: + turn+=1 + spoke[i]=turn + yield i + nextSpeak=0 + + while True: + turn+=1 + yield nextSpeak + lastSpoke=spoke.get(nextSpeak) + spoke[nextSpeak]=turn + + if lastSpoke is None: + nextSpeak=0 + else: + nextSpeak=turn-lastSpoke + + if turn%3000000==0: + print(f"turn {turn} of 30000000 ({100*turn/30000000.0}%)") + +import itertools +print(list(itertools.islice(iter(ex), 10))) + +def nth(start, n): + return next(x for i,x in enumerate(start) if i==n-1) + +# print(nth(iter([0,3,6]), 30000000)) +print(nth(iter([5,1,9,18,13,8,0]), 30000000)) diff --git a/aoc2020/16.py b/aoc2020/16.py new file mode 100644 index 0000000..3d9bfeb --- /dev/null +++ b/aoc2020/16.py @@ -0,0 +1,388 @@ +ex=""" +class: 1-3 or 5-7 +row: 6-11 or 33-44 +seat: 13-40 or 45-50 + +your ticket: +7,1,14 + +nearby tickets: +7,3,47 +40,4,50 +55,2,20 +38,6,12 +""".strip() + +actual="""departure location: 26-404 or 427-951 +departure station: 43-307 or 325-967 +departure platform: 39-383 or 399-950 +departure track: 31-157 or 178-969 +departure date: 28-109 or 135-950 +departure time: 38-622 or 631-958 +arrival location: 35-61 or 69-957 +arrival station: 36-216 or 241-951 +arrival platform: 41-586 or 606-967 +arrival track: 47-573 or 586-951 +class: 31-439 or 445-957 +duration: 35-925 or 939-965 +price: 41-473 or 494-952 +route: 45-742 or 754-963 +row: 41-338 or 357-952 +seat: 45-848 or 873-968 +train: 37-183 or 197-952 +type: 46-509 or 522-974 +wagon: 32-69 or 81-967 +zone: 37-759 or 780-967 + +your ticket: +103,197,83,101,109,181,61,157,199,137,97,179,151,89,211,59,139,149,53,107 + +nearby tickets: +209,822,916,528,93,531,551,797,387,835,278,464,546,945,732,88,678,145,559,287 +361,364,272,676,683,606,911,903,890,600,784,669,894,428,741,92,735,276,142,836 +781,526,892,684,272,536,918,9,402,546,925,824,201,502,688,432,613,809,713,374 +524,557,363,240,554,371,58,801,96,156,449,454,573,903,365,833,632,258,785,941 +924,802,727,547,447,674,251,212,359,180,620,4,257,525,403,94,181,844,547,569 +107,673,817,281,543,800,59,557,739,570,891,216,149,105,728,649,86,336,464,933 +148,264,782,50,901,752,706,287,61,617,300,100,538,540,563,145,816,180,686,461 +781,256,535,203,24,213,804,817,145,304,924,895,890,794,199,739,734,200,400,899 +84,501,93,782,494,226,88,902,843,795,674,732,509,890,182,716,358,298,367,925 +331,82,617,102,684,545,296,878,409,887,820,181,182,875,242,907,294,428,787,714 +899,780,543,561,523,633,284,457,695,528,301,676,799,921,105,865,465,798,759,813 +203,614,843,657,791,669,453,541,854,845,209,841,806,292,105,338,694,259,698,248 +289,946,635,736,890,494,656,665,813,736,884,341,253,758,437,281,153,104,915,817 +662,897,901,104,283,731,56,655,730,204,345,542,381,641,201,297,375,806,524,565 +462,380,736,528,90,471,401,676,203,88,766,61,372,264,50,253,428,823,547,793 +381,108,787,569,711,737,879,569,803,483,277,684,463,908,526,820,368,282,366,92 +899,502,307,906,876,845,205,241,839,686,438,624,616,633,427,738,651,531,295,908 +690,638,275,216,94,5,608,141,611,615,808,247,470,292,634,829,503,833,278,505 +207,147,608,459,570,698,813,473,290,741,216,716,641,948,759,85,860,401,679,797 +241,666,345,243,51,670,83,680,842,152,251,571,279,527,635,833,549,140,906,542 +205,809,716,704,556,638,306,56,473,893,631,886,437,649,90,712,710,894,453,627 +566,61,545,208,523,550,822,700,204,57,744,947,82,555,91,613,252,377,365,820 +296,653,873,433,830,922,288,805,786,714,656,530,364,284,691,978,242,881,404,326 +553,643,614,815,448,533,902,507,324,380,879,255,898,682,876,738,713,642,665,447 +213,880,934,434,818,522,55,740,210,543,145,427,783,96,454,289,382,245,141,821 +810,910,647,935,468,52,721,330,457,509,103,890,293,280,612,642,683,669,787,281 +842,793,338,716,59,794,638,512,360,402,802,573,96,740,148,659,372,615,471,708 +334,608,522,553,137,138,277,870,305,529,85,383,149,657,95,637,270,431,179,681 +838,546,797,535,801,375,697,732,469,370,249,662,509,351,263,366,327,641,890,793 +571,651,661,456,697,706,831,464,639,731,363,533,702,498,296,635,379,924,328,110 +648,792,765,251,252,572,656,563,873,89,736,731,256,947,885,104,140,755,876,734 +546,642,781,697,923,394,711,358,255,246,793,532,566,268,526,783,708,830,819,568 +462,781,495,82,473,453,730,388,806,660,258,796,335,780,247,283,653,57,620,890 +652,245,136,795,281,464,662,250,730,101,684,2,273,379,96,783,738,543,255,811 +434,151,794,468,399,98,284,254,302,909,561,886,135,386,206,431,719,336,833,281 +567,276,378,731,726,342,612,908,650,432,501,689,641,274,140,58,470,212,815,250 +137,711,337,540,837,647,912,818,371,23,427,946,648,569,250,814,460,146,333,434 +727,654,328,148,337,648,659,848,284,378,103,851,568,473,633,784,298,758,819,941 +150,810,456,537,877,839,531,916,643,825,784,908,430,987,708,948,210,571,332,298 +98,399,106,462,528,554,151,98,439,806,505,874,757,695,333,391,648,700,619,689 +525,841,432,535,797,497,208,908,539,427,851,446,729,505,895,839,813,210,538,788 +155,149,716,606,82,903,453,274,299,607,795,292,548,533,227,148,527,99,586,713 +801,742,879,714,786,464,987,713,360,698,643,53,541,105,260,261,717,728,717,612 +105,57,90,815,939,908,92,940,620,62,529,831,261,873,694,719,94,470,50,465 +611,836,83,548,469,938,548,680,207,823,498,205,696,701,572,376,944,830,652,95 +466,719,335,434,93,883,449,314,739,649,433,290,742,901,735,472,338,337,198,376 +977,97,447,360,729,538,307,524,557,282,731,836,800,675,885,549,841,903,632,821 +259,699,94,261,667,586,524,180,808,469,576,672,681,947,697,917,804,468,370,435 +689,785,180,877,453,150,700,498,249,500,755,845,361,605,274,268,151,200,814,150 +823,920,736,64,826,157,636,831,496,297,893,689,278,915,899,837,568,465,404,202 +663,722,210,709,289,526,567,216,101,242,917,18,381,333,566,541,573,143,572,54 +734,616,621,704,736,583,437,684,501,657,565,643,641,96,200,258,463,561,563,640 +499,837,260,96,711,880,882,447,457,228,507,677,284,670,733,823,274,289,286,539 +636,571,905,137,452,718,379,811,249,69,411,823,268,401,874,87,69,921,828,271 +276,105,285,754,457,635,738,99,439,183,816,253,674,247,944,143,207,54,199,994 +709,430,371,901,895,486,896,374,724,703,617,328,559,692,899,379,306,296,242,567 +466,215,471,431,844,54,382,87,93,756,655,259,379,872,615,400,264,366,211,85 +788,688,148,807,144,374,360,270,460,672,52,391,534,888,437,363,796,197,280,471 +717,548,525,622,797,303,247,704,328,606,53,810,381,812,462,671,380,797,983,658 +204,725,99,945,912,831,759,812,757,141,159,816,245,57,827,663,472,430,59,798 +465,638,264,359,542,93,638,599,151,149,210,732,247,873,891,262,96,431,642,902 +89,558,716,291,466,242,507,359,884,16,374,358,813,808,371,818,254,922,722,798 +212,505,372,691,455,683,438,886,200,701,554,372,945,537,821,261,725,740,781,395 +653,907,672,473,338,362,109,939,254,157,382,365,670,572,706,160,903,656,56,894 +894,81,908,651,781,521,837,908,378,244,947,154,675,289,708,925,680,618,637,652 +305,657,439,117,678,287,430,632,199,840,297,920,890,829,609,645,291,286,667,922 +803,154,52,825,157,945,739,146,921,332,844,109,239,657,821,156,461,669,919,704 +211,506,826,282,213,278,795,208,363,258,277,109,531,60,590,822,697,646,359,898 +680,707,13,151,366,651,430,709,274,715,891,254,201,445,917,291,179,259,794,454 +606,458,104,457,648,281,359,538,136,139,900,369,833,614,272,197,838,567,678,597 +708,718,823,282,932,157,241,376,914,265,711,380,105,821,795,665,555,642,663,636 +632,909,307,612,463,740,380,700,782,834,296,202,457,778,93,295,672,615,557,683 +668,211,664,504,455,533,494,338,943,525,996,670,452,544,701,210,675,298,833,300 +280,643,824,549,681,241,526,282,627,566,271,469,155,99,466,460,51,305,434,137 +902,546,530,325,109,796,543,209,894,883,227,673,800,335,621,798,557,215,912,536 +696,640,712,615,473,412,294,279,268,302,552,635,401,722,55,925,737,84,368,151 +571,294,197,921,294,843,359,97,62,691,447,639,706,572,706,539,563,946,941,294 +689,374,785,401,496,360,817,698,218,758,924,831,89,562,755,248,564,302,301,732 +672,89,502,893,560,183,929,469,553,99,714,305,272,689,701,734,873,502,798,534 +102,197,528,332,643,468,635,53,690,287,383,682,591,338,258,891,664,798,741,299 +902,470,667,500,806,464,197,51,694,83,673,267,508,181,788,921,148,882,977,739 +940,891,818,883,672,855,759,401,828,335,692,651,377,182,828,759,693,215,179,139 +610,565,289,687,848,939,810,359,338,910,948,318,494,470,667,786,919,329,215,653 +371,949,271,207,294,289,337,329,365,216,688,180,525,243,684,404,102,403,236,60 +781,361,649,500,276,672,818,944,553,95,878,803,335,365,250,994,277,883,447,719 +502,839,382,374,895,377,910,292,876,701,144,929,198,684,463,827,103,542,93,692 +59,256,83,728,567,529,626,882,759,704,106,209,784,556,874,610,94,815,715,780 +283,399,359,701,244,735,845,453,557,549,893,758,636,685,657,990,146,842,400,244 +617,88,825,249,499,885,547,274,434,332,99,153,880,216,508,472,880,565,12,566 +875,737,610,447,917,91,500,561,619,461,301,256,928,718,659,108,910,892,254,614 +337,573,942,846,638,530,154,929,833,83,828,526,884,726,825,141,428,837,253,692 +54,20,363,216,496,325,306,671,921,525,714,304,87,638,277,663,703,180,530,669 +619,742,180,81,674,877,901,463,737,825,641,695,666,794,881,637,55,849,671,452 +90,614,277,136,646,375,318,99,145,810,814,817,807,197,802,435,741,679,145,87 +328,284,948,18,157,610,499,453,646,92,508,833,279,275,542,884,549,498,803,455 +721,651,253,368,387,182,915,404,818,141,659,821,91,654,293,544,739,685,782,428 +620,658,51,876,820,698,357,104,796,83,379,775,887,466,285,246,244,879,812,657 +949,278,157,156,498,377,908,555,494,374,920,797,95,840,502,127,151,838,381,848 +875,445,541,257,914,873,639,846,292,333,565,523,524,737,216,847,824,467,60,343 +501,60,616,942,338,783,453,235,242,689,81,91,685,435,918,265,647,757,839,689 +146,272,902,716,880,718,486,299,664,250,911,877,326,378,366,147,606,915,560,826 +661,882,285,400,448,683,402,834,678,752,718,632,876,802,259,794,705,326,943,647 +377,709,550,267,60,553,506,648,469,896,991,670,50,465,551,646,888,829,369,332 +989,806,884,373,809,656,298,215,156,522,645,468,55,499,816,881,249,833,756,808 +267,652,371,140,810,646,564,677,637,328,733,258,58,818,732,706,459,758,990,715 +670,373,880,697,819,74,451,612,837,297,561,887,914,657,844,242,60,541,501,95 +642,691,684,392,432,546,402,886,464,682,178,566,729,537,204,641,842,505,723,666 +792,542,218,268,247,898,182,428,944,453,796,450,914,552,909,535,97,922,718,698 +755,804,908,533,377,531,942,68,465,645,108,303,57,83,247,298,290,661,619,155 +346,302,383,828,268,365,378,817,289,299,287,922,373,618,372,257,563,946,586,522 +84,608,390,530,55,266,825,635,545,258,335,53,338,568,534,247,365,502,455,274 +253,889,246,499,250,459,211,894,683,268,734,526,675,321,257,642,550,692,839,298 +153,465,90,83,372,737,717,329,700,98,373,686,103,429,357,272,989,700,874,669 +846,683,673,781,692,823,177,273,660,792,563,672,737,675,146,507,198,507,694,562 +634,248,890,840,606,714,103,770,655,206,810,668,685,876,656,657,464,639,833,471 +791,294,693,81,201,758,386,822,757,565,734,457,741,717,264,733,247,264,243,883 +262,399,792,465,153,182,251,348,699,404,647,733,563,908,271,847,848,891,286,265 +889,471,500,261,462,659,216,711,347,246,925,913,826,530,608,366,755,651,815,670 +329,197,56,437,261,553,466,455,723,246,549,800,213,618,874,556,994,692,679,941 +807,54,285,265,904,757,784,787,610,699,258,460,852,874,97,464,532,797,915,500 +661,545,887,571,205,212,307,729,104,426,704,544,780,715,359,108,662,243,287,465 +916,140,692,532,695,891,369,275,551,500,516,198,684,215,832,713,648,502,876,831 +531,103,563,476,257,789,825,276,782,610,54,526,545,550,784,643,654,201,332,304 +373,244,333,505,803,456,368,878,98,546,565,2,924,702,278,704,681,916,435,373 +936,916,663,288,921,364,251,682,694,293,695,830,270,105,154,791,259,620,501,693 +695,940,93,724,82,178,689,106,732,296,381,281,694,367,699,831,788,700,865,252 +892,470,246,276,908,64,371,669,284,143,586,907,829,54,907,725,331,209,287,612 +280,889,977,505,206,782,887,948,699,88,904,875,465,503,149,500,259,399,569,294 +656,682,277,433,542,452,462,211,359,497,278,889,949,156,286,102,938,59,791,798 +912,909,294,541,202,335,428,563,55,798,93,197,795,740,636,919,814,364,651,237 +525,663,179,613,798,102,727,383,300,468,313,544,461,459,205,679,502,99,912,642 +336,643,283,143,636,203,561,289,670,138,429,839,472,672,351,812,107,399,893,400 +674,610,539,922,237,572,732,449,924,606,55,759,711,374,438,261,642,473,157,786 +718,338,496,247,662,757,337,528,168,399,622,609,208,910,675,949,700,914,729,85 +846,846,800,815,949,507,888,13,833,81,833,101,61,53,730,242,102,631,908,55 +844,371,81,3,825,844,183,614,742,280,569,848,561,207,535,946,523,399,571,806 +793,923,685,637,946,302,646,454,937,781,381,214,695,214,660,884,152,83,654,205 +634,895,738,632,522,648,875,713,946,251,180,299,100,784,296,289,11,899,470,182 +834,634,692,911,466,15,732,924,522,501,242,451,357,553,944,648,263,889,537,664 +718,306,941,878,653,294,894,529,94,510,467,728,98,742,942,693,463,732,139,910 +563,724,901,722,543,949,127,791,917,897,697,253,335,640,297,88,920,428,198,454 +780,691,458,732,787,684,82,299,564,835,87,407,433,427,468,701,650,792,295,145 +294,97,646,447,856,702,706,462,216,364,846,502,525,948,569,380,83,212,435,570 +504,703,363,834,135,402,494,625,892,371,569,723,641,154,673,141,801,298,841,569 +211,609,790,898,921,436,369,782,898,639,907,733,732,848,860,327,60,437,542,717 +838,657,303,246,848,680,615,296,466,263,595,50,726,553,570,338,202,818,451,296 +879,834,291,872,544,676,381,564,215,472,697,834,903,721,690,260,209,608,815,647 +97,886,496,787,545,666,335,704,457,771,307,845,662,837,723,92,790,560,648,284 +458,639,828,413,327,726,902,721,199,216,719,635,432,214,149,754,83,445,272,374 +688,563,106,883,712,535,732,113,894,256,450,494,691,205,890,833,803,723,457,328 +735,244,255,19,898,376,183,720,434,529,889,607,759,718,156,54,183,796,522,635 +698,739,367,177,698,58,688,533,809,889,733,815,781,403,527,450,618,889,60,104 +336,810,467,211,893,885,435,281,705,113,249,370,327,462,266,826,703,809,691,784 +757,798,216,153,809,149,96,536,450,332,676,261,569,229,501,722,200,634,247,796 +739,638,660,748,785,793,84,83,527,910,508,555,306,57,150,693,618,59,843,711 +294,787,656,946,691,325,432,333,452,373,901,604,361,439,59,286,813,840,700,244 +870,400,208,250,620,466,609,640,713,96,612,690,211,756,380,815,553,453,85,808 +60,272,608,846,704,728,839,903,83,361,717,673,797,787,778,790,889,504,614,704 +10,674,455,883,205,653,636,740,834,607,651,333,947,445,498,531,792,616,214,368 +399,548,157,366,757,731,536,305,199,650,828,303,607,811,4,816,539,940,456,709 +137,267,804,560,797,200,302,875,619,629,95,886,568,671,874,448,278,463,539,670 +676,798,812,643,208,775,180,294,921,548,949,86,261,641,888,143,702,788,306,899 +619,458,900,581,249,334,107,207,681,621,203,380,569,759,652,446,360,297,50,829 +528,699,289,690,823,676,674,509,466,730,902,608,305,211,737,638,617,681,700,761 +84,651,447,72,381,874,331,296,502,87,257,288,506,108,783,152,329,252,809,737 +672,921,155,332,348,533,898,399,616,664,472,293,201,216,61,729,657,722,648,814 +839,677,796,203,359,470,449,91,689,869,92,60,838,550,255,713,662,141,180,199 +709,274,439,827,785,294,199,495,260,671,198,15,470,379,671,877,713,756,609,303 +277,536,312,655,504,634,468,285,734,728,256,899,109,586,433,820,106,782,918,266 +100,608,947,780,817,721,209,99,652,60,610,297,203,936,790,568,570,799,918,290 +787,889,652,282,618,456,622,732,287,156,385,733,460,279,889,379,897,693,573,784 +466,922,683,644,99,121,835,615,97,754,945,494,947,888,156,273,613,909,333,210 +233,54,631,836,921,536,886,210,873,733,941,51,332,665,568,292,329,363,383,710 +924,262,381,939,458,148,138,57,143,364,888,997,641,820,942,261,940,820,249,733 +451,96,613,904,293,554,54,758,692,782,357,560,986,944,946,833,293,706,695,210 +471,897,434,85,241,107,918,640,606,199,464,786,740,106,942,907,238,205,813,282 +804,373,607,639,845,506,675,946,828,434,669,553,710,420,739,705,696,754,799,299 +718,501,259,662,434,107,213,484,546,286,206,617,472,533,470,154,643,921,211,360 +280,820,897,654,157,890,105,791,214,657,358,720,60,795,873,889,468,786,265,993 +147,719,730,730,466,530,827,826,788,801,446,219,808,707,360,102,464,552,897,812 +294,94,241,268,875,266,923,735,379,705,466,687,90,495,879,354,722,692,947,841 +180,95,690,461,142,561,379,101,283,676,650,247,471,509,846,931,548,700,538,522 +451,466,674,145,434,296,654,551,503,289,372,381,586,917,89,589,734,886,371,246 +715,754,758,147,638,299,895,833,833,398,940,54,100,524,546,57,241,373,455,702 +572,703,529,280,399,818,255,537,403,806,264,298,759,908,142,423,494,639,915,741 +403,82,814,355,183,823,893,364,881,733,368,815,738,614,505,497,550,146,875,896 +367,832,911,287,178,573,93,683,924,291,286,558,178,841,333,623,569,670,724,836 +810,571,87,917,758,994,51,104,534,337,681,572,559,256,879,917,293,304,917,458 +571,815,871,302,831,822,881,791,724,713,568,638,798,333,278,60,246,606,714,104 +555,712,567,837,136,553,642,19,208,616,712,893,363,325,303,531,631,789,501,813 +150,379,138,381,434,785,823,648,357,912,128,435,573,638,888,360,730,284,636,565 +671,198,93,382,527,915,263,712,253,935,267,816,453,682,527,538,399,663,886,151 +742,83,329,627,509,631,799,371,893,206,365,455,182,635,534,455,372,465,684,838 +643,896,898,873,873,796,438,448,402,540,626,685,939,672,435,209,459,495,282,729 +257,563,832,831,552,607,218,148,279,381,555,667,657,369,942,57,558,149,689,897 +208,683,569,259,978,674,697,836,215,215,140,361,714,691,940,199,57,445,302,712 +208,618,563,616,777,359,671,289,300,672,665,917,619,635,528,898,639,213,895,98 +278,781,547,307,371,787,920,215,631,925,880,565,268,361,616,891,881,643,144,321 +538,645,728,763,211,677,690,916,373,649,212,436,371,292,268,373,380,438,948,507 +257,757,917,656,560,782,664,546,925,265,795,494,647,151,531,101,534,1,613,432 +334,669,818,524,887,329,375,792,669,328,784,813,494,697,447,524,890,360,399,418 +837,554,677,816,622,534,720,893,883,255,912,712,341,291,687,890,400,921,101,819 +740,531,292,271,816,727,371,696,590,272,270,562,544,179,817,498,147,946,881,611 +616,647,847,824,845,535,700,281,153,642,478,281,197,468,447,204,908,877,550,664 +755,494,271,838,108,591,58,841,245,721,90,463,714,561,875,156,542,541,267,150 +366,757,681,946,548,533,135,896,507,359,824,282,15,638,305,780,640,827,781,798 +827,686,639,525,672,921,573,275,883,375,733,910,545,101,996,277,827,900,288,901 +254,685,548,723,729,507,100,917,763,332,634,89,404,572,690,788,921,559,839,137 +662,287,204,311,468,947,919,709,664,357,52,637,690,910,894,633,373,459,457,89 +652,434,365,754,757,626,720,642,277,85,289,664,559,213,148,813,826,504,821,157 +666,888,545,759,107,883,17,462,58,264,537,877,913,462,887,198,362,58,106,691 +101,216,650,250,328,559,854,834,622,655,447,54,946,799,727,660,705,137,95,610 +296,453,724,512,296,536,921,399,884,617,821,506,61,830,280,456,536,203,562,727 +844,561,634,452,806,607,495,107,813,147,927,848,809,879,247,705,705,707,742,136 +839,791,504,528,631,607,633,498,305,834,277,382,724,268,787,816,18,361,918,448 +716,375,438,789,250,725,886,543,275,2,523,370,108,848,897,614,60,757,911,666 +291,790,472,727,560,313,276,54,93,612,92,915,103,794,676,152,267,915,298,334 +692,547,107,188,293,83,215,69,461,939,757,244,723,632,84,754,524,451,535,403 +665,644,5,672,719,561,379,54,645,701,430,621,613,675,703,662,916,907,831,805 +288,496,724,326,305,460,714,329,839,163,829,728,638,672,450,920,286,783,543,429 +726,243,522,144,452,158,295,182,359,368,892,689,362,147,783,943,307,914,288,706 +102,434,292,617,876,57,666,524,299,258,151,462,645,919,109,533,197,4,454,542 +911,907,564,632,803,211,707,901,708,340,556,255,781,135,404,268,375,671,526,338 +802,448,451,735,99,669,349,722,609,783,429,298,692,918,642,274,135,284,428,54 +661,427,600,837,273,572,801,790,945,674,832,277,529,759,539,794,361,790,383,835 +453,537,875,203,536,246,586,453,484,330,60,642,295,328,207,494,216,668,919,373 +680,673,923,785,137,648,590,495,100,105,471,109,914,877,500,557,383,523,522,631 +534,819,694,647,691,367,468,545,689,837,64,810,146,613,909,252,756,736,690,251 +757,367,662,199,947,109,200,813,428,694,737,692,429,137,689,319,700,844,97,648 +662,803,618,178,85,295,711,259,652,717,94,893,616,139,438,779,651,885,264,357 +570,264,105,334,450,841,568,643,845,449,883,949,434,682,820,459,672,844,617,864 +531,98,150,466,921,812,464,175,260,697,278,643,876,687,914,60,61,439,297,508 +876,438,837,681,615,327,409,216,703,206,370,362,680,95,804,894,531,716,302,617 +802,366,211,532,556,791,551,999,876,336,543,281,538,181,836,109,208,556,903,270 +94,731,528,593,507,919,330,665,543,329,700,705,59,288,654,681,884,59,891,925 +531,153,759,828,242,331,835,438,612,539,631,455,616,306,985,800,826,102,725,358 +538,214,780,453,692,844,797,921,814,797,638,666,211,506,359,235,907,642,137,687 +364,525,458,179,694,568,153,197,181,461,361,293,18,888,942,699,253,290,728,718 +718,208,730,721,733,90,445,416,361,85,844,787,463,272,713,714,690,336,198,757 +105,704,302,610,947,608,544,731,264,817,719,873,740,559,927,921,277,436,820,689 +209,742,656,473,151,430,375,456,731,647,848,673,272,93,824,102,983,504,812,377 +498,898,94,707,607,826,756,471,129,466,844,915,251,789,566,506,471,873,285,652 +788,281,57,430,822,90,764,523,294,327,882,181,377,819,611,87,282,361,820,498 +381,450,892,826,603,710,670,281,399,841,274,284,675,845,805,688,613,263,673,273 +671,563,276,372,108,946,263,245,688,313,439,203,699,148,360,454,290,755,687,55 +""".strip() + +ex2="""class: 0-1 or 4-19 +row: 0-5 or 8-19 +seat: 0-13 or 16-19 + +your ticket: +11,12,13 + +nearby tickets: +3,9,18 +15,1,5 +5,14,9""".strip() + +curr="fields" +fields=[] +your=[] +nearby=[] +for line in actual.splitlines(): + line=line.strip() + if curr=="fields": + if line=="": continue + if line.startswith("your ticket:"): + curr="your" + continue + k,v=line.split(": ") + conds=[] + for cond in v.split(" or "): + l,r=list(map(int, cond.split("-"))) + conds.append((l, r)) + fields.append((k, conds)) + elif curr=="your": + if line=="": continue + if line.startswith("nearby tickets:"): + curr="nearby" + continue + your=list(map(int, line.split(","))) + elif curr=="nearby": + nearby.append(list(map(int, line.split(",")))) + +# print(fields) +# print(your) +# print(nearby) + +values=[] +for i in range(len(your)): + values.append(set()) +for (idx, ticket) in enumerate([your]+nearby): + ticket_valid=True + for val in ticket: + isvalid=False + for (prop, conds) in fields: + for l, r in conds: + if val>=l and val<=r: + isvalid=True + break + if not isvalid: + ticket_valid = False + break + if ticket_valid: + assert len(ticket)==len(values) + for i, n in enumerate(ticket): + values[i].add(n) + +print(len(values)) +valid_for=[] +for (prop, conds) in fields: + this_valid_for=set() + for (idx, prop_values) in enumerate(values): + all_valid=True + for val in prop_values: + this_valid=False + for l, r in conds: + if val>=l and val<=r: + this_valid=True + break + if not this_valid: all_valid=False + if all_valid: this_valid_for.add(idx) + valid_for.append((prop, this_valid_for)) + +valid_for.sort(key=lambda c: len(c[1])) +print(valid_for) + +pairings=list() +for i in range(len(your)): + pairings.append("") +used=set() +for k, vs in valid_for: + if len(vs)==0: continue + found=False + for v in vs: + if v in used: continue + pairings[v] = k + used.add(v) + found=True + assert found, f"{k}, {vs}, {pairings}" + +ticket=dict(zip(pairings, your)) +p=1 +for k, v in ticket.items(): + if k.startswith("departure"): + p*=v +print(p) diff --git a/aoc2020/2.py b/aoc2020/2.py new file mode 100644 index 0000000..82fd0d0 --- /dev/null +++ b/aoc2020/2.py @@ -0,0 +1,20 @@ +count1 = 0 +count2 = 0 +with open("2.txt") as f: + for line in f: + spec, data = line.split(": ") + nums, letter = spec.split(" ") + lo, hi = nums.split("-") + lo = int(lo) + hi = int(hi) + c = data.count(letter) + if c >= lo and c <= hi: + count1 += 1 + + a = lo - 1 < len(data) and data[lo - 1] == letter + b = hi - 1 < len(data) and data[hi - 1] == letter + if a ^ b: + count2 += 1 +print(count1) +print(count2) + diff --git a/aoc2020/2.txt b/aoc2020/2.txt new file mode 100644 index 0000000..8903fa4 --- /dev/null +++ b/aoc2020/2.txt @@ -0,0 +1,1000 @@ +13-16 k: kkkkkgmkbvkkrskhd +5-6 p: qpppvzp +3-4 p: psppxhlfpvkh +3-10 w: wwwwwwwwwwdwww +4-5 r: rcgrrcr +3-4 c: clvccc +1-5 x: xfsfxmctb +9-14 k: kpkmkkckhkkkkvkk +5-6 s: gsfsss +4-8 c: cccdcqdcr +2-5 k: kmkpkkfgkkkkdkkk +9-11 f: pfnsfffwxsn +8-9 w: wjwnwcwxc +7-8 q: rrxhplqs +5-10 n: gpnkqnxnbjzgjnb +18-19 p: fvpkgfkfjgwllqwhrjd +12-13 v: kvvvbmdvvvvvvcvvvv +3-5 m: mdmkmvhszpjcxl +2-7 v: qjmvzdwxc +1-4 b: bbbbbbbb +2-5 c: fzcdccfkcsjhckccrcx +2-10 d: fhdwdbdddrsldrtdjdr +1-7 z: ztszzfzztcqzrz +4-6 j: mmjjjrj +11-12 b: smbgkbbmbpbbmkbbbb +3-5 r: jxzrk +13-15 d: fppsvgqrdgrbddd +12-14 w: wwwwkcwwwpwzwzwwsz +5-6 v: lmcvvv +12-14 x: xxxxxxvxxmxbjnx +1-2 p: hpgpt +10-11 k: qmktzklkgkcknfwkh +6-7 r: ntcrrrjrznk +7-8 v: vshxvzxw +9-13 c: cncccccclcdwccwmc +5-6 r: srrrgv +6-9 w: bwfswqthk +5-7 f: hfvsfjf +11-14 v: zbksgqcrclvvwpfvfr +8-9 v: vvvvvmvvvkv +1-12 n: gnnnnnnndnqnd +10-11 j: jtjjjvbjjhj +3-10 x: vgxxxwqxkxn +5-6 z: zzzztr +2-4 z: rzdhz +10-11 m: mmmmmmmmmmvj +2-4 z: jzczpvzzs +1-4 k: rkkhk +4-8 n: nwcwmnflpbnnl +2-4 w: dwwgwwssf +1-3 m: smzm +2-6 d: dsddwwljd +13-15 w: wwwwrwwwdvwwpwg +7-10 f: bhsfffzfjdbfmf +6-7 w: wwwwtwww +3-6 b: bbbbbbxb +7-9 d: dvwdxjgdhf +12-14 n: znnnnnnnnlnfnrn +1-7 v: qvkvvvgv +2-15 x: xsxxxxxxxxxxxxbx +5-11 n: nckpwnmmnzg +4-13 d: dzdddcdkxgqddqdp +5-17 m: mkxmzbmmmmvfvmmjvmmm +11-13 p: pppzppppswhqhpppp +4-5 b: bbbgg +5-8 v: vvvvvvsv +9-10 j: jnlkmhmvjvnbjcsvlwb +2-4 x: zxxxxv +1-17 r: drrrrrrrrrrrrrrrcr +11-17 w: wqmwlszsnnwwwzwwwww +2-3 m: mmmmmmmmm +9-10 n: nrnngngnvr +4-8 z: bxjtzkdzwkzz +5-8 g: vjtvqtgqjgtggggmj +2-5 q: qfgcqw +6-11 c: cgccccchcccvc +6-8 t: tpjgfjpr +5-10 h: hhhnhbhhczhh +11-14 d: gdddddddddwdddr +1-2 l: twngrmgrckmlmh +10-12 r: rrrrrrfprfrr +7-8 m: bmmmmsrhqm +2-11 w: wlwwwwdnqsvw +10-13 j: jjjjjjtjzjjjj +4-16 f: fdvgffxfzcffffff +2-6 q: wbfvkm +4-6 d: ddddddd +2-4 p: jpxprdpn +5-6 s: tgssrrpbvsgs +3-10 j: spjgjjjcbjsjxj +5-10 w: wwqrdvwwwpwwwr +3-4 x: hpxxxzf +4-8 d: dxcpddddddrddddddqj +15-16 z: zhfxlzzkzzgzhzzz +3-5 s: ssslsnc +2-3 j: rrjrwg +7-13 x: xxxxxxpxxxxxtxx +5-8 x: xxxxxxxrxxxxxxxgx +4-10 g: dmhcmbwnwwggcw +6-8 s: qtsxflsfshzvsgpxg +7-9 c: cbvccckcwc +15-16 r: rlrrrrrrnrrrrrsx +8-10 r: kjrbrrrbrnvrrx +6-7 q: zpsmcjmmr +5-10 p: ppgpsppppkpp +3-4 k: kbkkk +1-2 b: bbbbb +8-11 s: sssvssssbsw +5-7 m: lmwrmmmmgmfhd +16-18 j: jjjjjjjjjjjjjljsjt +1-14 b: bcjlbbcwbjbxbbvbf +2-5 z: qzzrfv +4-17 t: tttrtzttttttttttxttt +5-6 w: kwwwjw +7-9 l: bclgtbghdtd +1-8 h: mqhbhhhhhhh +5-6 j: zznjjfvvjwcths +5-7 t: tttbmttd +5-14 v: vvvvpjvvvvvvhm +2-4 x: vxlx +5-15 g: gfgfnnqkbgngpdpp +1-8 n: jnnnnpnvntrp +3-4 b: bbbb +6-7 z: frszzzfz +6-9 f: pbbmlvfpwvw +4-15 g: gbjgggfgvggggdgbq +1-9 w: tgwljtgwlm +14-15 k: kkkkkkkkkkkkkzk +11-12 p: ppppppppppklp +4-8 n: nnnvpkzsn +13-16 m: fmjsqwtmwbdxmnwmlmb +2-7 c: qccgccczcc +8-11 x: xxxxkxxbxxx +1-4 g: gcgb +6-7 l: pkjllll +2-3 n: mnntpwsrlqkxkgnlb +9-10 s: sssssssscss +6-16 n: rtthnbsrfvndnsnnj +1-2 h: hjdhh +1-3 f: ffff +6-9 l: xqtvlllllpmlxtl +6-11 r: rrrrrrrrrrr +1-6 z: fzzzzzzzzzz +2-7 q: qqdqqqgqqqqtxqqqq +9-13 k: dbfkszjjmkkkfkdkklxk +5-6 j: mdjjljdfzjvqd +5-10 s: tsbskgsbtsqdd +12-14 j: tjjsjdjfjtjjfjj +9-10 x: xxxxxxxxgx +8-11 r: rrgrrrrbrrcrrr +6-18 m: vmnmhmbmmmmmmmmmmz +6-8 k: llkkqrkc +1-2 c: cccc +2-8 x: xxxxxxxxxx +7-10 p: ppzppppppwp +9-17 v: cdjwncwrbcgkfvwzvkf +6-11 w: wwftwjwwwcwwvwwvw +12-16 g: gggggggggxggggggggh +1-4 z: kzxzcdnpgczhn +3-5 t: tttmtttvxtd +4-5 h: hhhwh +4-8 d: dvddddln +8-15 l: lvllfllllxllllwmpl +7-9 s: dbsksbwtj +8-15 q: qkbqmqqqqqqqccqhq +2-6 r: grcsrrqz +14-18 s: sssssssssssssssssss +7-10 r: ffrrttnrrrrs +2-11 c: csccccccfdgccgcccccc +3-5 r: rrrrr +3-4 h: qrhh +7-9 k: kkzqkrkwk +1-5 k: khkkfgkj +3-6 l: pplnxl +10-13 k: chsxfrtrkkjgq +6-9 b: lbbblnbrbbb +3-5 n: hqnlfpnj +5-8 f: shffkcnfdmswfrnsfrpg +2-7 j: jjjjcdcnwxnbr +4-13 z: dvxnzpcbfkngk +11-13 h: hwzpzbphjhrhk +1-10 v: vqptqpbbtq +1-4 b: bdfpt +13-18 p: pppppppppppppppppp +14-15 h: hhhfhhhhhhhhhnmhh +4-14 x: wxsbxxxjvxxbxx +9-10 m: mmdmmxsrjdmpdmzsmm +11-16 s: szsbssssssszsxss +9-13 h: hhhhbhvhthhvnh +5-6 q: qqqqqq +1-3 d: ddldcqrdmd +11-17 f: ffcfkfffffpwfqffm +3-6 m: rmmmqm +9-11 l: vlblgszllwbvpn +13-15 z: ghzvdlzrvrzzcnz +3-5 l: bglllcll +1-8 h: hhhhhhhhhh +2-7 j: qjsgtjjt +1-2 d: ddbctlvpdf +11-14 v: vvvbvvvvvvtvvvvv +14-15 g: ggzgggggggswgrjggm +9-13 v: hqtcqvnbvqnmv +12-13 b: bbbbbbbbbbbjzbbbbb +5-6 r: rrfrcv +4-6 p: pppppppppppp +6-12 d: fdddddddddddrd +12-17 g: ggghgggggggxggggfgp +2-7 h: hqhhhhjhh +8-12 v: vvvlvvvvvvvv +4-5 n: nnkpg +3-12 m: mmzmmmmmmmmmmmm +11-14 b: bbbbbpbbbbbbdbbbb +6-7 z: zzzzzzr +4-7 n: snnnnfnkn +1-2 h: hnshhqvmjpghntx +15-16 b: bbbbbbbbbbbrbbbb +4-6 n: nxnnpnnnh +2-9 v: sdghvmxtkz +5-7 j: jjjjjjj +4-10 l: plbhsmlllrl +12-18 g: ggtggdlghcjwqwggggg +5-7 b: bzbxrbxgwcdbb +5-15 m: mmmmmmmmmmmmmmmmm +4-13 j: jjjjjjjjjjjjjjj +4-11 k: kshkkwlkkkkkdkbk +1-15 w: bwwwzbwwwnwwwmcww +19-20 l: pblvxmgslllnnsplldnv +3-4 z: skzx +1-5 x: xxqdxgb +2-3 g: wgggc +5-9 d: dgcddwrdf +3-6 m: mfkzjg +5-8 s: hmssmgwxhssg +10-11 s: ssssshqssll +17-19 v: vvsvfvvvvxvvvgvvvbv +11-12 t: cwssdtfqkdttjv +1-5 b: hcptprhlpbwkg +2-8 j: ljjxjjjljp +2-5 q: qqqlqr +2-8 r: jrcwdbhrcltrnsgswpm +3-4 f: ffvff +5-10 h: hhhhhhhhhhzph +5-6 z: mzzmctzz +10-13 w: wwwwwjwqwwwwwwwwww +1-4 m: mmtm +11-12 z: tddzcrptcnlmbjj +3-6 l: llmllpl +2-4 f: ffsf +5-11 g: gggrvgggggg +2-10 k: zbmpktfnddfs +5-9 l: lsbblgpjlms +1-12 s: sssssssssssss +5-7 f: fffdrsc +9-11 z: rzzzzkfzzwqzrz +3-6 z: zwzrbzv +17-18 r: rrrrrrrrrrrrrrrrrg +2-4 n: nnnrgnnn +3-4 n: nfqq +2-3 h: khhc +9-10 x: xxxffbxxxnr +5-6 d: mtgnrjdnmzhddks +3-4 b: bbbb +11-15 p: kppxppppppppppppp +13-18 t: tttdtttttttttttttttt +1-7 p: frjpppwgdpzvvfwds +1-6 k: qkzkkvpk +4-15 n: nnnxnnnnnnnnnnpqn +6-7 l: ndlrqrl +4-5 r: rchrwr +11-12 f: ffffffffhfff +1-3 j: xjjjj +9-10 z: zzzzlzzzgn +6-17 g: tgrhpggcqbjwjggmgql +11-15 v: vvvvvvvvvvlvvvhv +10-13 w: wwwwwwwtwwwwswwfwww +1-2 l: plllllllllllpll +8-9 k: kkckklwkc +2-4 b: bvbp +1-6 r: rrrnqrrrrrrrrrrrrr +8-10 d: pwnvkxddpddd +3-6 k: kkkwkf +8-15 v: vvvvvvvvvvvvvvvvvvv +13-17 g: lhqgggcxlgcvgwgdg +6-13 x: kxxxxsxxxmxxxx +3-4 r: rrrqr +2-3 r: kvrsxjrmtvtr +1-2 h: jtbh +8-9 w: wwwwwdfckw +13-18 v: vvqwvvvnvvvvvvvsvv +6-14 t: mpfthffdnmtxmx +4-5 d: dddcsd +6-7 m: mlmmmnfmmh +5-7 x: xhxpkpqxqnx +9-11 v: vgvvqgvvwmkpfvvlv +15-18 l: jlxqvmjgrrnbhccpdl +2-9 k: kkkkznkkbf +14-15 w: wwwwwwwwwwwwwbwww +9-10 k: wkkvvmkkvgfkkk +10-15 g: bfggggggggggggg +7-8 x: xxxxxxxx +12-14 t: dmtmwtztltfsthtb +6-7 k: kkkkkwk +4-5 c: ccvsz +3-4 c: mclvcfjcqh +16-17 k: skkpknhxxsrqmcvkj +12-13 v: vvvvrfdfsdtvf +1-2 q: fpqp +7-8 b: bwbbbqbbb +5-6 h: hhhhhh +5-7 z: zzvzdzzxzwz +17-18 w: wwwwjhggnwbwwwwwzb +6-8 g: gggggtggg +4-8 n: lnnnzhbn +17-18 g: lggggggggcggglgggg +2-8 v: vbvvvvvkv +1-9 v: vvxvrvvtvvvvv +13-15 j: fhvxdngcrjdqxmnz +5-17 n: nnnnnnnznnnnnnwnnn +1-4 f: fnxdmjdsqbfffnjsnkf +3-8 q: dqqgbnbrpxqclq +4-6 b: xkpbbbk +11-12 l: llqllllllldjll +9-10 c: cwvlcdnmzr +6-8 l: zkjlllvlgvlnlblspm +4-9 b: lbbbbbbbbbwbbbw +9-12 g: gfgrggvgbggg +16-17 r: rrrrrrrrrrprrrrtc +2-16 r: mrbmrrxgrrbzrrmrrj +16-17 v: vnsvvczmjwfkvjvvvsrv +2-11 l: lglrllnlllqlll +2-8 t: sllgjrxkthl +3-7 d: ddldddk +8-13 c: ccckchmcdxccccccsf +8-9 t: cttbtztttfqdqh +4-5 b: tbbxh +12-17 w: wwwwwwwwlwwtwwwvtww +1-5 t: krfwxtzxcwphw +3-10 w: wwwwwwwwwwwww +1-2 n: nnjqqkspswql +9-13 w: wwwwwwwwfwwwwww +1-3 s: ssss +13-14 x: xfxxxxxtxxxxnx +4-5 x: xxxcj +5-15 k: kkkktkkkkkkkkkf +14-16 l: lrlzjxlllpqltlblvlll +5-6 t: ttttfct +11-14 z: zzzzzzrczdkzzz +6-8 f: ffffftfj +9-11 d: ljdngglsdvdsv +10-15 c: ccrqhcqzccnnjvcfcj +11-15 w: jwvwnccwwxzcwwww +9-10 s: ssssssssss +2-4 r: vzfmrr +5-8 l: blhlnlsqb +6-7 c: ccxxcfxldckpcc +2-4 j: czjkj +2-14 d: rlxksvpqsnhhpkds +16-19 k: kkkkkkkkkkkckvkjkkwp +3-9 j: kcjcbjjjjjjjjgljml +2-7 l: ljjzdll +4-8 r: fqnqjbsssqrrwrrrrr +5-15 t: xtnvhtttdsrhtttt +1-3 l: xlzl +6-10 g: ggggncchghgggghgg +10-11 m: msmmmmmcmgj +4-6 c: mcnprhmcfcclcl +12-13 s: ssssswssssstsss +13-14 m: mmmmmmmmmmmmmmmmm +9-11 p: kqvrdbpppcpgqh +6-7 q: qqqqqqq +9-10 b: bpbbnbbbkdbbsbblqrfb +12-13 b: bbbbbbbbbbstsb +8-11 g: ggbbfrsgdxhldnt +7-8 d: dddwddssdbd +6-7 b: bbbbkbfj +3-5 z: jtdklzthgz +5-6 l: hlnlllltmvhmlmq +3-6 q: qqpxqvqp +1-3 z: zskzmzzzhzzzhzvzrzzq +2-8 h: sskhzhlhkht +2-9 r: rltcgrrrrrrr +3-16 f: zrxffkfcvffffncffgff +1-2 r: rrcrhkns +14-17 b: bbbbbbbbbbbhjbgbdblb +4-15 c: cccccccwcckclccrcc +13-14 l: lkzlclbnlhlcnk +13-14 r: rrrrrrrrrrbrrr +4-5 k: cvhkkkbj +2-5 m: kmfnmzh +14-15 n: nnnnfnnnxnnnnnnndnnn +7-10 t: wttwkbhtpf +3-9 n: qjgzpnkpn +6-7 n: nhnnnzn +5-10 n: nngtndngcn +2-5 x: rdxnp +10-13 s: sssssssssxssssssss +6-8 n: mnjnnxnnvckn +2-10 p: gpxpglqwpppp +5-7 t: twtktdts +18-20 c: cccccccccccccccccccc +6-7 d: dddddddw +10-11 x: xxxjxxxxxvzxxxx +4-7 z: zrphzzlzhgfwd +4-8 l: lllnlllkl +2-7 q: kkwsgndmdrmsvfqj +4-7 m: mmnmjfmm +2-5 s: flhkzzs +12-15 x: xxxxxlxxxxxmxxs +9-11 v: vvvvvhvkbndjvx +1-9 n: kpqgbxnkx +5-10 f: ffdfrpfffffwfffff +1-3 f: jsvqkff +5-7 j: jsjjjfxl +8-14 z: zzznrzzzzzqzzz +1-12 d: dzlbdzhgmrdddc +12-13 k: kkkkkkkkkkkbk +7-8 m: pmmmmmmmm +1-6 s: bsssssvslx +6-8 d: dddgdgrtbfdm +11-14 k: gkplwxkmskwmdpm +6-10 x: xxxxxkxxlr +4-10 l: lllxlllllklllll +1-2 t: ttstmpksrrp +10-12 s: ssssdsssshscs +10-12 z: zzzzzzzzpwjszzzz +2-4 r: grrrctkzmw +1-2 l: fspl +3-5 k: kkkkk +5-12 b: bcbbbbjbbbbb +8-9 c: ccccccctcc +3-8 p: pmplmhpp +6-7 b: bjhfsbbx +16-19 d: dddddddddwdvddddkdg +5-6 j: sjrzcj +5-8 f: mfdffdgf +1-3 q: qcqqq +9-10 s: sbsssssspm +2-4 f: dffl +3-4 n: nnnn +4-10 t: wttthjpdmtlthttgwtkt +9-10 d: jpxdmbnddddd +10-19 q: sqhswtjrpqbxwjqzfqmr +2-6 w: swwzvgwbww +1-2 m: cfmmsl +9-14 w: pwdbjwwhbnpwllm +4-5 q: qqqqqqqqk +8-15 m: mmkdmwzkrvlmpmnmmmmf +17-18 q: qqqqqqqqqqqqgqqqnvq +3-6 g: gkkngh +1-8 g: gghdzwkg +3-11 j: vxdspqtvkpj +5-7 q: qqtqgpmqdq +6-8 d: bdmddddvd +5-6 w: zwwwwwvwxfw +2-11 n: bnplrmpvbpn +7-14 k: kkktbkkkkkkkkk +3-11 b: fmkqvvbztnxzqvjc +3-6 q: sscqqq +4-7 c: cfrrdrzbjmvpk +6-9 w: pwrtzwrww +2-5 v: vvcvv +2-4 f: ffmf +8-10 k: kkkkkkkpkd +6-7 v: mvjvvvv +8-11 c: vccvcckccfk +7-8 b: bbbbbbbsr +2-3 x: xxxmvx +6-7 l: llbllwsl +8-10 r: rrrrrbrrgrrrrnrb +12-16 g: ggggggzsggmwgggv +18-19 p: pprppppppppppppppppp +3-6 s: ssssssss +2-6 x: lwxkdx +2-3 n: xgbnf +2-4 p: dzrk +2-4 h: hlhpjhh +4-5 b: bmnbb +1-7 z: zczvzczsxmxpzznp +2-9 l: nlwxdwlblzl +1-4 r: xbtcqrfkv +13-16 k: skkkkkkvkkjkxrkfqk +9-14 b: bbbfcbwfjbbcbg +1-13 r: frrrrrrrrrrrfr +1-4 w: hwwxwnvvt +2-6 l: zzhlrx +3-8 v: vmzvggqtslnlqrj +15-16 s: dhssknsjztzssssssss +2-6 q: qqqqqqqq +2-3 t: mkktlt +7-17 b: bbbbbbbbbbbbbbbbdb +11-17 s: sssssszfssxssssskj +2-7 h: hnhkhshhhhhhhh +2-15 x: xzxjxnxxpxxkzxxxxj +15-16 p: pmcmpclzphppxplp +8-9 k: kkkkkkkdpkks +2-4 r: vrwt +8-12 r: qrrrhhwjrrrhrrr +3-4 j: vjjzq +8-10 q: qqqqqqqqgs +6-7 j: zjjjjjjj +1-11 m: mdgkdkmqzmmsrhxxmmj +1-7 x: pxxxrbq +3-4 z: zrhkzz +4-5 s: ssqlss +5-8 f: vtrfffffff +7-13 j: jjjjjjdjjjjjtj +1-7 n: dnnfxwz +2-11 n: nzgnqncnnnjg +4-5 x: xxxxx +5-7 v: rhbvvvvhvxvpz +10-11 z: zlbbddzlzwzv +10-13 v: vvvvvvvvvvvvvv +3-4 s: ssrs +11-12 m: mmmcmmfdmmsmmmmnm +5-7 s: sdstsssssrs +1-3 w: bwzw +3-4 h: hphq +7-16 q: qqqfqqdwksqlfcqjxq +6-7 x: kndcxfv +10-11 m: mmmmmmmmmmm +1-4 n: fvsvnfhgwcgcnp +13-14 s: ssssssssrssswrss +5-9 x: xmvkxwgrxrtwxmrxhxx +3-5 q: jdbvvxvdg +3-15 w: zlzcksssjbwcvgp +16-19 x: bxxxxxxxxxxxxxxxxxx +3-5 z: rzzhz +4-10 f: hpttvbtjmq +3-6 n: wsngjn +4-5 p: ppphg +10-12 c: bqlccfctmchqbchhcg +9-10 z: zzzzdzzzzhzzvz +7-9 w: nwgwcvdcxqqwmzq +14-19 x: pxtxxlbrxdpvspwmxxx +2-8 t: ssktwbft +8-9 j: jjjjjgjsjzjj +7-9 v: vvvvvvdvlvvwv +4-6 x: qxxkssx +11-13 g: ggggggggkgvgg +8-9 t: tttttvttjttwt +2-8 b: pfbbcsbwbbbb +8-16 r: mkrcrtsrrrrbxmprftvx +9-10 k: hvwlqvktkkb +1-6 w: wsbwwvjwwrwh +10-19 f: nfftfffrdhjffjsnffd +13-16 h: hhzghvhhhfhhhhhhhhh +14-16 x: kskxbwrwrvjxfvfg +1-4 k: rflk +6-7 b: bbbbbbgb +4-17 v: vvvvvvvvvvvvvvvvv +12-13 s: sdstmsspfwsssscqf +9-11 z: zzwzvmrzzczzzz +4-8 s: skslmgsqtszbswsssscs +4-12 h: bdshxnpgvwhktdwgdp +3-5 t: tltst +4-5 h: hhhhh +9-11 w: wwwwwnwxxwwwwwww +6-7 n: dcnngffnnzn +1-3 l: clflll +6-7 x: xxxzxxgx +6-7 n: nnnnnkgnnnnnn +1-6 m: mmmmmmmm +5-7 t: tktttpt +4-8 v: zpcvqvzvrvgttntrbl +6-7 d: dddrddd +3-5 k: jskdkswqjfftgkfr +5-6 f: ffffgrffn +6-8 l: lwlkllgl +10-13 p: ppppkpppppppd +4-5 d: hbjdd +9-15 r: rrxrrrrrrrrrrrrrgr +4-5 b: bbbbtbx +8-11 b: brbbtlvvlbdbbbqjsb +6-8 g: zgzqgwmg +4-9 r: qstrmxrtr +5-8 m: mbmjmmmmmr +5-7 v: tvvzqvgrvqvmvncshv +17-18 g: fgggggggggggggggwr +2-12 t: nttpgcjtkdjt +6-10 k: kkkkklkkkk +2-7 q: qqqmtgqq +3-6 n: npccknvnn +5-16 k: rtlhkbtdkmmntdbl +2-3 b: wwkb +7-17 q: qqqqqqqqqqqqqqqqqq +1-4 g: ltgc +2-6 l: lxlnln +13-15 q: qqqqqqqqqqqqqqxq +3-4 j: jvjj +5-15 c: cpmzlhcckwlnhwmwgzw +3-8 b: qvblmmchbcc +5-8 b: fqhdwtcxb +4-15 k: kkvkkkcwgkkbkkdkkkkn +11-12 f: fnffffffffffffff +9-10 t: tttttttpfvt +4-10 f: nfffpftfffffffnf +2-4 m: scgxnm +7-8 z: zzzzzzxhbz +6-9 z: vznwkzzzz +3-5 k: hkcdn +3-10 k: kkskkkkkkz +2-3 p: pbdf +1-4 m: mdhmm +6-10 b: lfbbwdbbtv +8-10 g: gggggggggggg +2-3 t: qgthtztbwtppb +15-17 n: nnnnnnnnnnnnnnbnjn +8-17 v: vvvvvvgkvfvvzvvvpv +4-5 f: vwffff +8-15 w: wwbvwwwwdwwkzwwwwwwf +7-13 n: srmzrmnvcgshljkchp +5-15 q: dqjvfqvpwqnmpwqzh +1-2 h: hhfs +2-6 h: jhqwhh +3-4 t: tthg +2-4 b: sxsqrrxkjb +6-8 q: qqqqqqqqqq +6-7 c: rqcxcclxccwqcgwq +4-5 v: vvmfv +6-7 m: mmmcmmmm +2-4 j: bqfj +2-12 k: kkkkvkkkkskkkkkk +5-9 q: xjtqqrnnkdplrnqq +1-6 k: bqkrfpkcrwwkk +1-4 r: mrblr +12-18 s: ssssbfdlqbbssplswpsl +8-9 b: bhbhhbbkbzbnbcbh +3-7 t: tsdtthx +12-15 f: xcmghffxtgfffjf +12-16 n: bxnnhnhnnzfnnnwrtgl +7-9 q: qqqcqmnqdq +2-3 m: rpbjgkxqtmjrzm +11-12 s: hssssssssshc +3-5 x: xxldx +3-4 k: kkkxt +7-9 k: wlgkqndkz +5-7 l: llmtllv +2-6 v: svzvfv +5-6 d: djdddvddd +5-6 k: mhkkkkkwvkkcfk +3-4 c: rjcc +4-8 t: ttttzfttc +10-11 g: ggzggngbzgg +14-16 w: qzqwdwbcwwwmllndzlsm +2-4 z: zzpz +12-13 g: gwxpwcbsvwgtthn +1-4 b: bbbbmzc +5-7 f: cnxlfdffmt +3-4 z: znsdz +10-13 c: mrckljhmrcmnc +2-9 m: dxmdhndrwpmpgc +7-16 z: zzzzzzzzzzzzzzzzz +1-3 j: jjjjjjjjjjjjjjjj +15-18 g: mmglvtgzggzgnggggg +4-10 c: cccncccccz +1-8 n: mnnnnnntn +10-13 l: llllllltzhlvvld +2-3 r: gnnd +3-7 v: vcnfzzbd +6-7 p: pprpctdp +5-8 g: gggggqgggg +1-13 f: wfffdfpbfjlfhb +3-8 j: dmjjkqwj +4-10 j: vfjhnswwwtzlfvmcdn +2-4 v: bnjd +4-7 w: btwwlfwkwzmzhhlsvs +14-15 g: gggggggggggggpgg +10-11 w: zwwwwwwpwgrww +2-3 b: dbbcgwqfzlhwcbs +1-9 f: qfpfvffffffmfxbcpf +9-10 t: tttbpttttmttcnt +2-3 l: lgll +8-9 s: vzgvjsnns +6-8 w: wwwdwsbtswrww +13-14 h: dhhhxhdjnvhrhrflhh +7-8 d: dddddvjd +14-15 l: lllqlllllllllnlxlh +12-13 d: ddddzdjdddhhkdd +9-14 p: pvtplhjvpzdvqjqvh +9-10 r: rjrrrrrtrrrr +6-8 g: gjjgfwgg +9-14 j: jjjjjjtjcjjjjhjjj +8-9 q: phxjqqnqq +5-6 k: lkkkkk +14-15 x: xxxxxgwxxxxxxtwxq +1-4 x: xqfxx +1-8 m: mmgmnmvm +2-3 n: hnwr +14-15 z: zzzzzzzzzzzzssz +2-6 p: pspppp +1-6 z: zzxzzx +9-18 z: zzzzzzgzzzzzzzzzzgz +6-11 z: wzhtdzzfxjz +3-4 v: vzvv +16-19 q: qqqqqqqlqqqqqxqqqqq +2-4 v: vvhvvvv +2-9 p: lpxppwppppgppspb +11-12 m: mmmmmmmmmmndm +8-9 v: vvvpjvvvpvv +16-19 k: kkkkkkkkkkkkkkfkkkk +9-10 z: zxlzfzczzzczrdn +12-18 p: ppppppppppbjpplpphp +1-3 p: pvpppx +1-2 x: vxlx +10-12 l: lllnlllllwlll +4-5 b: bphwg +7-10 c: gcjjpprxxjcwvk +6-9 l: llwqklmpxlszgzlvl +9-15 s: fsxsscswksvrmsh +15-16 q: lqxqqwqpqwptqqmg +10-13 r: xmpmqrdjkrzkpzc +3-5 c: kcbcclt +17-18 f: jffffsffffffffffbsff +1-3 t: vqcqdmmgc +1-2 n: qnnn +16-18 n: nnjzhnznnnxlrmmnsn +13-19 q: srxlcdznhbfxqtsqtsqx +2-7 m: vmmmnjmmmmz +6-7 v: vlvmjvg +7-15 k: xnpkbtzwgntptwkgmxm +15-19 g: wggggggggggsggkggxg +8-17 h: hhhhhhhwhhhhhhhhhh +2-5 w: kwwwww +4-12 k: kkkqkkkkkkkqkkkkkkk +7-11 d: hddcndsgddgz +2-7 t: tdzxnth +1-7 z: lzzcrvz +5-10 h: shvchmxxdh +12-13 f: kffwgtfsssfqnvff +1-9 b: mbbbbtxbrbbc +4-12 r: rnfvrprrrrzrrr +2-6 p: qzltppwqljg +2-4 w: hwdxwmmqphfkhthczx +3-4 r: rrwj +3-4 b: lbbbpldfj +4-12 g: gggggggggggggkv +4-5 r: rrqjtrrr +4-8 n: nnnrfhnfn +4-11 h: lrnxkwkbhgnhh +1-8 l: lvjlhbffl +6-10 g: ggtgghghghpfgg +1-2 s: szsss +3-6 s: dszxsdsssskssbs +11-14 x: xxxncxxxxxxxxq +5-10 m: mtmmmmmmmdmm +1-3 r: qrgr +2-7 m: gmhmmtd +1-3 c: cccswmjcmnm +2-9 x: qbcdsxxlx +6-7 s: nsswzssv +1-14 m: trmlzmsmgqmmmnfdsmtm +5-7 d: cdddzdtdd +3-4 k: tvczkxvvrw +2-8 s: slvmswvs +10-16 p: pppppppppgpptpptpp +2-11 l: jqxsjlvpzkgzjdmt +4-7 t: ttmtpttp +4-11 r: twbrxccwcrtffpnv +6-8 k: kkckkkkqkk +10-12 v: vvvvvvvvvvvv +4-6 k: gqzkkk +3-4 r: rrmxr +12-13 p: npgppsppppqnw +1-16 x: mxxxxxxxxxxxxxxv +5-6 l: llllll +1-4 k: bkkckkkkk +10-11 v: vkvtvkjltmlvtxlnlrsj +3-11 h: mzhrhlhhhhhwl +5-6 p: pppppp +1-17 m: mmmmmmmmmmmmmzmjmmmm +2-6 v: cvvcvfbgcvvvcq +4-7 n: nnsnnwj +2-3 k: xvkxkksvb +16-17 x: xxtxxxxxxxxxxxxxr +1-13 w: lwwwwwwwwwwwxw +3-14 d: ddjdddbddddddtdddd +4-10 g: jrxggnqmjg +1-3 b: bbfbbbbb +4-5 d: pdhdm +5-7 d: mvdsdnd +17-19 m: mlmmmmmmmmhmmmmmmmm +4-6 g: gtlgxggggsgc +6-7 m: mzvmhglmmmpmmxf +10-14 j: jrjjjxcjjtjjjhpljl +9-15 w: wwwwlwwwwwwwwwjwwdw +1-3 g: wtzgjgr +5-7 m: dmmmtmm +1-8 g: ggkdgpggg +5-6 x: xnjhmx +1-7 b: bbbbbbbfbbbb +3-11 n: mnnnngnnnvnnqnnvn +2-3 l: jglgdrczl +12-14 f: tffpffsmfffffg +10-13 d: mndmdwdxjdxpd +9-10 m: mlmmmmmmzvxm +6-8 l: ptpjwltl +7-8 r: rrdrprlqrr +8-9 n: nnnnnnnrc +6-7 p: ppppphn +4-8 t: smtptgwtmlttw +4-10 j: jsjjjjjjjj +15-18 k: kkhwkkkkkkkkkkkkkk +1-2 s: sksxb +2-10 g: sggchblktg +8-12 r: rrrrrrrrbwrr +13-14 v: vvvvvvvvzvcvvvvv +3-4 p: kppp +4-14 m: mmmsmmmmmmmmmzm +5-6 n: kndmnnnnpnznjqb +3-10 d: xlddcdbdlddpqdkdl +17-18 n: tnmcvdcznnnfnznldt +6-11 g: wgbgzgggggg +16-18 z: zzzzzttzzzzzzzzkzq +11-13 x: pxxlgmtvbjrlb +2-13 p: bmphpwxpsmmthppprdk +14-16 r: rmrrrrrdmrrrrztrjr +1-5 x: xdxxx +1-3 d: dgdddfzddfd +1-9 m: ddfmgwfgf +7-11 x: xwnqqtxdmns +5-6 v: ffvvvv +3-15 g: dggggggzggggggb +10-13 p: pptpppkdpwcngppf +11-12 x: xxngxbxxdxxxxnzxbxx +3-4 n: nxqc +1-2 x: dvxxx +4-5 h: zhvhh +3-5 j: jqpjj +2-7 f: ffffffpfz +8-10 k: kkkkkkkkkk +5-12 x: xxtxxxxxxxxxxx +12-14 c: cccccccccccccc +8-9 s: vhlssssws +1-4 k: dqkk +4-10 r: rrbrrrrrrdrr +1-3 r: hqljfr +8-12 c: qcccccszgjgcccddccw +6-14 m: mmmmmxmmpmmqmcmmdm +5-6 r: mwrrdtm +1-5 t: rdjtts +6-14 c: gpcbczvfbcbcckblzc +5-6 w: wxwwww +3-4 p: rjppp +10-13 t: ttttttctdtgtttts +3-14 c: cvlcpqscwgzgxzxvkmh +3-7 h: kxqfwfddhllhj +10-18 r: mdqrrmrdxkkvxftrrr +13-14 m: cmmmcgmmmmhvmm +2-7 h: khvhhjhhjbv +5-9 r: rrrzgrrrlr +1-8 c: gccccccsccc +15-17 v: vvvvvvvvvvvvvvdvn +9-13 v: vbvdgpvjvhvhwxv +6-9 z: zzxbqznzqjzh +3-6 r: rrrrrrrrrrrrrrrrrrrr +3-4 x: nxxxxst +7-10 q: qqqqqqfqqf +9-10 j: jjbjdjqcqw +9-13 z: dhzzzzzzzzzwxkzzzzjk +3-9 q: pqxgqqcqqjql +10-11 h: ljhgjwhzdrhhhh +18-19 v: vvvvvvvvvvvvvvvvvvvv +10-11 l: vgxrhvtfblwl +2-3 v: rvvvvpj +8-9 c: smchcscccdmf +2-3 n: nqmnn +15-17 x: xxxxxxxxxxxxxxqxrxk +11-14 j: jjjjjjjjjjljjvj +7-9 z: zvzzmzjkfbvzzczczlzm +2-6 z: zzzjzjzzmfzk +9-11 m: mvcmmbmlzrmmz +6-7 r: rrrrrrr +3-6 c: jtcfscccvvf +2-5 s: cssbntxggkwvwnchn +8-10 x: xxsxjzxqxx +6-7 n: ndnnnbg +9-16 j: jgzxxsmljbhbttqjw +3-4 k: gjsk +9-10 q: qqcrqqqpqq +2-4 t: thtt +3-4 w: wrfxww +9-14 v: vvsvvkqgzvmvvvvvlvvv +9-15 m: mmmmkmxdmdmmhmmwjw +3-9 b: bbbbwcwbb +3-6 c: ctdccs +7-8 k: kkqrkkkk +5-7 l: llmllcqjljlh +5-7 w: wnzbwgw +15-17 f: fcffffffffffffffpf +1-2 t: tttft +1-7 n: zctqhnxvbn +3-8 z: hdpqzzzlzsw +3-15 l: llslllllllllllml +8-19 w: rwtbwrwjwtwxcclthdw +4-5 g: zggggg +5-14 v: vvvvhvvvvvvvmlvv +1-7 l: mlgxllpgl +2-12 b: mvwbfjcddqjb +1-3 m: qmzm +2-3 r: rrrrrffr +1-7 x: xxsgxxv +8-10 d: tdrrqdzcdddddxddl +2-4 n: crnnfdcnnnzn +3-4 n: nnnz +9-10 z: zzzzqfzzzzz +10-16 n: nnnhmnnznsnntnnc +9-16 s: vssssbsscssssssjss +9-13 w: wwkwwwqqwvwwww +4-5 d: hkdhwddtdkqwvl +3-4 l: llll +4-5 f: ffzffftld +7-9 d: ddddddddgd +6-7 t: ttthptttqxlfddstsq +5-16 c: clhwccvlnmttjqcc +4-5 k: pkkkk +7-11 m: xwmmmmchmmt +16-17 n: nnnnnnnnnnhnnnnrm +5-8 b: bbbbbbbbb +1-4 s: jsss +3-4 h: rhhhtjwfvdhz +9-10 r: rrrprlrwrrw +1-6 n: nnnnnkn +18-19 p: ppppppppppppppppppp +4-5 l: ljlrcl +3-7 m: mmmmmjmdmtm +12-13 b: bbbbbbbbbbbvf +6-11 g: hcghdwfpcqk +4-6 q: krpfvw +10-13 j: jsjkvjjjjjzjjfj +5-6 n: lcnnnnzndqkfnsq +2-4 j: nvdj +2-5 p: hppnpmpq +2-4 w: wnwbw +2-7 f: fwfxfmfszmcxf +6-8 d: dqrdbsnjds +1-3 f: ffffffmff +5-8 s: lnbwqnkxws +10-12 n: nnnnnnjnnnnnjcn +9-12 c: pccvnbccxrncrcclccc +14-18 s: ssssssssslsssstsssss +3-6 l: lldllczl +6-11 g: gggggwgggghg +11-12 h: chhhmjhzhqfh +5-6 n: qhnvcw +6-7 k: nckkkkmnkkkzkkk +6-8 d: wddgbdpdzdqxrwddjlz +1-3 h: qghp +3-5 j: mnjjjxjkgnrdzjbtdr +1-9 g: gfgcgggxgjggggggf +8-20 b: vptprmjbwwtnbhwjtnjb +7-8 j: jjjjjjjj +3-4 t: tqtt +5-10 f: fffzbxxszjjvjfhn +3-4 t: tttttttbtt +4-7 p: wjrgpnj +1-9 g: pgzllxgfg +14-15 c: cccccccccccccqm +11-12 b: btmcbzbnzcbbxr +5-6 h: hhhhhhh +1-6 s: nssmsssss +11-12 d: ddddddbddthfdddd +11-13 j: jtjjjjjjpjjjjwfjj +2-4 j: gjjj +3-9 v: vvgvvvvvrv +1-2 l: tqjjljxcsl +5-6 q: nqqqqr +12-16 h: hkhhhhhjhhhhqxhhhhhh +2-6 p: lpppkpbpzg +2-7 v: vzvvvvfv +13-16 g: ggggggggggggwggb +3-14 j: ghsjjcgmkwsdchlslpf +1-3 s: ssplw +7-8 x: xxxnxxxxxxx +3-4 h: zghhvtwtmlplvxxhsbf +4-5 g: sqgsnf +14-17 z: zzzzzzzzzzzzzwczc +1-2 z: cpzzzzk +16-17 s: ssssssssssfsqssss +3-9 j: jvjjfjdjjjjjh +1-6 v: vtvrvvj +4-8 c: clzcccccccf +4-5 d: dwldw +2-4 l: lwlrllllllll +6-11 s: zxgcsdxkrcns +14-17 r: vrhvhrprrfrsrrrrr +3-6 p: mrcztppnl +4-6 w: wwwwwwwwww +1-6 w: zwjccrqpwmnthz +2-7 t: mnjntdcq +1-5 b: bbjbbbbb +10-11 w: wwwwwtwwwwww +4-6 d: dddxdfd +2-4 f: fjfff +13-15 b: vbbbbbbbbbbbbbb +8-9 n: ncbnnnnnn +2-6 d: hdfphnnmbbdt +1-4 f: wffz +7-15 f: ffsffffffffffvzff +8-10 c: zchrckkcqcr +2-6 h: thvbvh diff --git a/aoc2020/3.py b/aoc2020/3.py new file mode 100644 index 0000000..cf39768 --- /dev/null +++ b/aoc2020/3.py @@ -0,0 +1,35 @@ +def run_by(right, down): + trees = 0 + print((right, down)) + with open("3.txt") as f: + idx = 0 + for i, line in enumerate(f): + line = line.strip() + + l = list(line) + c = line[idx % len(line)] + if i % down == 0: + l[idx % len(l)] = "X" if c == "#" else "O" + print(f"{idx}\t{len(line)}\t{''.join(l)}\t{line}") + + if i % down == 0: + idx += right + if i == 0: continue + + if i % down == 0: + if c == "#": + trees += 1 + print() + return trees + +s = [ + run_by(1, 1), + run_by(3, 1), + run_by(5, 1), + run_by(7, 1), + run_by(1, 2), + ] +print(s) + +import math +print(math.prod(s)) diff --git a/aoc2020/3.txt b/aoc2020/3.txt new file mode 100644 index 0000000..a961897 --- /dev/null +++ b/aoc2020/3.txt @@ -0,0 +1,323 @@ +............#....#............. +...........##....#......#..#..# +......#.......#......#......... +..#.#....#....#.............##. +..#........####....#...#....... +..##.....#.#.#..#.........#.... +...#.#..#..#....#..#..#........ +#.......#.........#....##.###.. +......##..#.#...#.......#.#.... +................##.........#.## +..##..........#...#.........#.# +..........#...##............... +#...#......#..#.#..#...##..#... +..##....#.......#......#..#.... +....#......#......#....#....... +.........#.....#..#............ +.#...#.#.........#........#.... +#..........####.....#.......... +......##.....#....#..#........# +#......#......#...........#.... +....#.........#....#...#..#..#. +.#........#......#.#.....#..... +..#.#.#..........#....#.......# +......#.#........##....##....## +.....#.#..#...#................ +......#......##...............# +..#..##.............#...##..... +......##......##..#......#..... +....#.............#..##.....##. +........#...............##..... +..#......#.##..#...#....#...#.. +#......#.......#.............#. +.....#....##..............#.... +#.#.........#....#..##....#.... +.#...#...#....#.#............#. +...#...#.#..##.##.......##..... +......#..#....##..#.#..#..#.... +.......##..#..#......#..#.....# +.##..#......#..........#....#.. +.....#................#..#....# +........#..#....#.......#....#. +..#......#.......#......#....#. +....#...#.##........##....#.... +.....#........#...........#.... +...#....##..........#..#...#.#. +...#.......#......#...##...#... +.#.....#........#........#.#..# +.#.........#..##.....#.......#. +....#..#....#.......#......#... +.#.#...##..##................## +......#.#...#.......#....#....# +........#....#..#.....#......#. +.......#..........#......#..... +............................... +..#..#####..#..#..........#.#.. +.....#....##................#.# +.................##............ +.#...#...#..#...........#...##. +..#..#.#...........#.....##.... +.#.......#.....#..##..#.#....#. +..........#.#......##...##..... +........##..#......##...#...... +#......................#....... +............#.....#....#.#...#. +#......#..........##..#........ +.........#.......#...#.#....... +...........##....#........#.... +#........#.....#...#........##. +.#......##......#.##.......#..# +.....#......#.#......#.......#. +.....#.#.........#............. +...........#..#....#.....#.#... +...#............#...#.......... +..#..#...#..................... +......#..#...#....#............ +.#.#.#........#..#...#......... +..........#........#..#........ +..............#...#....#....... +..#....#....##.......#...#.##.. +.#.........#...#......#........ +..#......#...#.........##.#...# +...#.....#...#..#.............# +.##........#.#.#.............#. +..#.............#..#.#...#....# +#...#.........#......#......#.. +.......##..#.#..........#...#.. +.......#.............#..#.#.... +.#..#....#.#................... +....##...#..#....#..#.......... +....#.#............#........... +###........##..#.#..#.......... +.#.#.#.......#...........#..#.# +..........##..#.............#.. +.#...........#......#.#..#..##. +...###......#.##........#.....# +....#..#..#...#................ +...#.....#........#............ +....#...#...#..#..##.##.......# +#.......#......#....#.......#.. +#.............#...#............ +##......#..#...#....##.#...#... +.##....................#....#.. +..#.....#....#.#....#......#... +.......#..#..#............#...# +.#.....#.......#..#..#..#...... +......##....................... +#..#...#.#.#....#.....#..#..... +...................#...#...#... +........#....##..#....#........ +##......#.#......##.###........ +.........#...##................ +.......#...#...#.......##...... +....#.......#......#.........## +....#....#.#..#.....#.......... +...........#.......#........#.. +..#.........###.#........#..... +.......#...........#.#.....##.. +..#...#..#..........#.......... +..........#.#....#............. +.##....#........##............. +.............#.#####........#.# +.................##...#........ +##...#.#.......##........#..... +.#...#...#..#..#....#....#..... +..#...#........#..#............ +##...#.#........#......##.#..## +.##......#..............##.#..# +.........#...#............#...# +....#..#....#...........#...... +........#..#....#...##...#..... +..#..............#...#.#.....#. +.#.......#.#.....#..###.......# +...................#.......#... +........##.....#..#.......##... +.....#....................#...# +...#.#....#............#.#..... +#.......#.......#....#......... +..#...............#............ +##...#...#...#..............#.. +...#..........#..#....##....... +#............##.##......#.#.#.. +.#...........#.........#....##. +..##....##.#....#.#.#.##...##.# +........#.#.#.............#.... +.#...........#....##...#...#.#. +.##...#.................#...... +....#.#..#....................# +.##......#........#..#......... +...#...............#........... +.#.#..##..##.#........#........ +...........#....#.#.#......#... +...................#........#.# +..#............#...#.#........# +....#....#.#.##......#...#..... +..................#............ +..........................#.... +........#...................... +......#.#...#.#..##......#.#.#. +.........#...#..#.............. +..#.......#..........##..#..... +.........#............#........ +......#..#..#...###....#....#.. +#..#..............##.###..##..# +.#..................#.....#...# +........#........#........#.... +.........#........#.##......#.. +..#.....#.#..###...#....#...... +..#................##....#..... +..#.#....##.....#......##...#.. +...#.......#........##......... +#........#...#.#..........##..# +................#...#.#.....#.. +.........#..#..#.#..#.#...#.... +##....#...##.........#.#...#.## +....#..#.....##.....#.....##... +................#............#. +..#..#...#.....#......#.....##. +....#.......#...#...#...#..#... +....#..##....#.###.#...#..#.... +#..##.....#.....#.##..##...##.# +.............###..........#.... +..................#.....###.... +..........#....#...#......#.... +...#..##.......#......#.#...#.. +..#.......................##.#. +..#..#..#....#......#...#...##. +#.............#................ +..........#.#.#.........#.#.... +.....##..#......##.#........... +.#.#.#.#....#.#...#.....#.#...# +......#.....##..............##. +#..#.......##..##.............. +#..#..#................###..... +.....#......#.........#........ +#...........#........#.#....... +#........#.#...#....#....###..# +###..#.#...........#.##.....#.# +..#..........#..#............#. +...#....#.......#..#.....###... +.#....#.##.#..###.............. +.....#.##.##.......###.##...#.# +..#..##.......###.............. +.#.........###..#.............. +..................###.....#..#. +#....#....#.........#.....#.... +.........#.#..#....#.....#..... +....##.......##.......#.#...... +.....#...#.##.....#............ +....#.#.#.......#.............. +.##..#.#..#.......##........... +....#....##..#.....##.......#.# +.....##....#..#.#........#..... +........#.#.#....#....##...#..# +..#......#.#.#..#.##....#.#.#.. +..#...#........#..#..........#. +.........#...................#. +........#.....##..#....#....#.. +#..............#..........#.... +#........#.#...........#.#..... +..#......................#.#..# +.........#.#.....#.#..........# +......#....#.#.##........#..... +.#....##......##..#...#.......# +..#........#...#.##....#..#.#.. +.......#.....#..........#.....# +.........#.#..#.........#....#. +..........#.##.........##..#... +......#.#..#.....#.#..........# +......#.#.#..#..#.#............ +...##.#..#..............#....#. +#..........#................... +.#....#..#.#.......#........#.. +...#...#......#....#......#.... +..#.#.......#.......#.......#.# +...#.#...#........#.....#...... +#.......#..#................... +#..#..#.............#..#..#..#. +#.......................#....## +.#.........#....#....#......... +...............#...#..#....#..# +#.....#.#...#.#.....#.......... +....##.#..#...#.#....###...#.#. +.................#....#........ +####.......##...##.......#.##.. +#..#....#....##............#... +..##......#..#........#........ +....#..#..........#......#...## +..#.#.............#...........# +#...............#...#.......#.# +#..#.........#.##.#.......#...# +......#.....#.............#...# +......#.##.........##...#...... +..#......##.#........#.......#. +#..#.........#.##.............. +..#....#...#...#..#.....#.#.... +................#.......#...... +#.....#..............##....#.## +##.....#...#.#.....#..##...#... +#.#............##..........#..# +..#.##......#..#....#.......... +....##.#....#.......##.....#... +......#.#....###...#........... +..................#......#....# +..............##............... +......#..#....#.....#.......... +.......#........#...#.......... +..#......#......##..#.##..#.... +..#.#...#...............#...... +....#.#.............#.#......#. +....#.#.....#......#..#.......# +........................#..#... +.................#...........#. +#......#......#.#.#.....##..... +..#....##...#.....##.#.....#..# +....#.........#....#.##.#.#.... +..#....###..................... +.....#.#....#......#....##....# +#.......#...#......##.......#.. +#....#.........##.....#........ +#.....#...........#..#.....#... +.................#.....#..##..# +..#...#......####...##......... +............................... +#........#.....#............... +.#.........#....#.#......##.... +...#..........#.........#.#.#.# +......##......#....###........# +.....................#.#.#..... +......#..#..#.......#...#...... +...##.#.............#.#.......# +..#.#...#..#....#.....#.....#.. +..#..#.....................#..# +........#....#..........#..#... +#.##....#..#.#..#............#. +..............###.............# +.#.#..........#.#....#...#....# +....#..........#.#..#......#... +.........##.#...#.............. +..................#.....#.#.... +.#....#.......#.##.#.........#. +.##..#...#......#..#........... +.#.........#..........#.#...... +#.#......#.#.#.#.......#...#.#. +.......#....#.#......#......#.. +...#..#....#.#..#..##...##..... +#.#.#.......#....#.........##.. +#..#....#........###....#.#.... +....#..#.........#....#...#.... +...#.#.#.#..#..##.....#.##..... +.......#.......#............... +#.#.#......##....#............. +...#.##........#.....#...##.#.. +...#.#.###..........#.......#.. +.....#...#.......#.........#... +............#..#...#..##....... +...#....#..##.##..........#.##. +..................#........#... +....#.##.#.##........#.#....... +.#...........##.....##.......#. +#...#.........#.....##......... +#..#....#.#.........#.......... +..#......#.#.#......#.....#..#. +..##......#..............#..... diff --git a/aoc2020/3_ex.txt b/aoc2020/3_ex.txt new file mode 100644 index 0000000..7e88cdc --- /dev/null +++ b/aoc2020/3_ex.txt @@ -0,0 +1,11 @@ +..##....... +#...#...#.. +.#....#..#. +..#.#...#.# +.#...##..#. +..#.##..... +.#.#.#....# +.#........# +#.##...#... +#...##....# +.#..#...#.# diff --git a/aoc2020/4.hs b/aoc2020/4.hs new file mode 100644 index 0000000..afa81f6 --- /dev/null +++ b/aoc2020/4.hs @@ -0,0 +1,67 @@ +import Control.Applicative +import Control.Monad +import Data.Char +import Data.Functor +import Data.List +import Data.List.Extra (stripSuffix) +import Data.List.Split +import Data.Maybe +import Text.Read +import Data.Set (Set, fromList, isSubsetOf) + +data Attr = Byr | Iyr | Eyr | Hgt | Hcl | Ecl | Pid | Cid + deriving (Show, Bounded, Enum, Eq, Ord) + +intval :: Int -> Int -> Int -> Maybe Int +intval lo hi n = guard (lo <= n && n <= hi) $> n + +nDigits :: Int -> String -> Maybe String +nDigits n s = guard (length s == n && all isDigit s) $> s + +hexColor :: String -> Maybe String +hexColor s = guard (length s == 7 && s !! 0 == '#' && all (flip elem "0123456789abcdef") (drop 1 s)) $> s + +validEcl :: String -> Bool +validEcl = flip elem ["amb", "blu", "brn", "gry", "grn", "hzl", "oth"] + +parseAttr :: String -> Maybe Attr +parseAttr s = + case splitOn ":" s of + [key, value] -> case key of + "byr" -> (readMaybe value >>= intval 1920 2002) $> Byr + "iyr" -> (readMaybe value >>= intval 2010 2020) $> Iyr + "eyr" -> (readMaybe value >>= intval 2020 2030) $> Eyr + "hgt" -> + let inch = stripSuffix "cm" value >>= readMaybe >>= intval 150 193 in + let cm = stripSuffix "in" value >>= readMaybe >>= intval 59 76 in + (inch <|> cm) $> Hgt + "hcl" -> hexColor value $> Hcl + "ecl" -> if validEcl value then Just Ecl else Nothing + "pid" -> nDigits 9 value $> Pid + "cid" -> Just Cid + _ -> Nothing + _ -> Nothing + +processLine :: String -> Maybe [Attr] +processLine = mapM parseAttr . splitOn " " + +requiredAttrs :: Set Attr +requiredAttrs = fromList $ enumFromTo Byr Pid + +combineAttrs :: [Attr] -> Maybe [Attr] +combineAttrs attrs = guard (isSubsetOf requiredAttrs $ fromList $ attrs) $> attrs + +processPassport :: [String] -> Maybe [Attr] +processPassport = combineAttrs . concat <=< mapM processLine + +processLines :: [String] -> [Maybe [Attr]] +processLines = map processPassport . splitWhen (== "") + +countValid :: [Maybe [Attr]] -> Int +countValid = length . filter isJust + +main :: IO () +main = do + content <- readFile "4.txt" + let valid = countValid $ processLines $ lines content + print valid diff --git a/aoc2020/4.txt b/aoc2020/4.txt new file mode 100644 index 0000000..0e247b0 --- /dev/null +++ b/aoc2020/4.txt @@ -0,0 +1,953 @@ +ecl:amb +pid:690616023 +byr:1994 iyr:2014 hgt:172cm hcl:#c0946f eyr:2022 + +eyr:1980 cid:97 +hcl:z ecl:#102145 iyr:2011 byr:1945 +pid:187cm hgt:179in + +ecl:amb +iyr:2011 +cid:113 +eyr:2021 hcl:#b6652a pid:004682943 byr:1940 +hgt:173cm + +iyr:2023 +cid:146 byr:2022 ecl:dne hgt:76in eyr:2040 hcl:z + +hcl:#f97e30 +cid:73 iyr:2013 byr:1929 hgt:157cm +eyr:2024 ecl:blu pid:673398662 + +hcl:5343fe +hgt:152 byr:2018 +eyr:1992 pid:85999926 iyr:1938 ecl:#15bd97 + +byr:1975 hcl:z eyr:1988 pid:#c36f52 +iyr:2018 +hgt:184cm + +byr:1954 eyr:2023 hgt:170cm iyr:2012 ecl:blu pid:299556897 hcl:#b6652a + +hgt:191cm ecl:oth hcl:#7d3b0c +iyr:2016 pid:187567535 +byr:1999 eyr:2023 + +pid:814358147 eyr:2022 iyr:2000 byr:2001 hcl:#18171d +ecl:blu +hgt:76in + +ecl:hzl +hgt:163cm byr:1955 iyr:2018 eyr:2024 hcl:#6b5442 pid:343362099 + +eyr:2020 pid:185090160 ecl:#21a5e6 +iyr:1928 byr:2006 hcl:a2ebbf hgt:104 + +hgt:153cm +hcl:#a97842 ecl:blu eyr:2028 byr:1969 iyr:2019 +pid:729700590 + +iyr:2019 byr:1981 hgt:150cm pid:606092356 hcl:#18171d eyr:2026 +ecl:grn + +pid:760899887 +eyr:2023 hcl:#866857 hgt:185cm iyr:2017 +byr:1976 ecl:gry + +byr:1965 eyr:2026 +hcl:#623a2f +ecl:blu pid:483363116 iyr:2010 hgt:178cm cid:204 + +ecl:oth eyr:2022 +pid:268557763 byr:1965 iyr:2015 hcl:#c0946f hgt:164cm + +ecl:gry hgt:168cm hcl:#623a2f eyr:2020 cid:163 pid:124082663 iyr:2016 byr:1996 + +hcl:4c44fb iyr:1957 eyr:2039 ecl:grt hgt:63cm byr:2012 cid:104 + +byr:2024 iyr:2023 +ecl:gry +eyr:2007 pid:170cm hgt:68 hcl:d57b67 cid:333 + +byr:1956 +hgt:169cm iyr:2013 pid:370491367 +ecl:gry hcl:#5bc41d + +eyr:2023 iyr:2028 byr:1969 ecl:lzr hcl:1989b1 hgt:71cm pid:#12c226 + +cid:304 pid:866132461 +byr:2022 +hcl:z hgt:191in ecl:lzr iyr:2029 eyr:1989 + +ecl:brn hcl:#9a45a7 +hgt:176cm +byr:1974 pid:758747330 iyr:2014 eyr:2020 + +cid:190 ecl:hzl iyr:2014 byr:1990 hgt:69in eyr:2037 pid:384015829 hcl:#ceb3a1 + +byr:1998 eyr:2022 iyr:2018 hgt:153cm +hcl:#733820 pid:424512443 +ecl:blu + +hcl:27c41f byr:1972 eyr:1994 pid:777840405 +ecl:gry +hgt:179cm +iyr:2021 + +hgt:166cm eyr:2032 ecl:gry byr:1936 +pid:41703652 + +hcl:#efcc98 iyr:2019 byr:1936 pid:985830958 eyr:2021 +hgt:175cm ecl:brn + +eyr:2025 pid:972163513 hgt:155cm ecl:brn cid:169 iyr:2015 +hcl:#6b5442 + +eyr:2026 +hgt:173cm +byr:1984 +cid:191 +pid:791209101 hcl:#341e13 iyr:2020 ecl:hzl + +hgt:64cm +iyr:2010 byr:1978 +pid:618891746 hcl:#d6ac23 eyr:2023 ecl:brn + +eyr:2021 hcl:#341e13 iyr:2018 pid:502081929 +ecl:blu + +ecl:amb +iyr:2018 pid:8933462515 +hgt:160cm hcl:e330f0 eyr:2030 byr:2007 + +ecl:gry byr:1980 hcl:#341e13 iyr:2015 pid:830724822 hgt:167cm cid:156 +eyr:2023 + +ecl:gry hcl:#c39b75 byr:1995 hgt:153cm +eyr:2029 pid:83056475 iyr:2013 + +byr:1965 cid:250 +ecl:oth iyr:2016 +pid:242792947 eyr:2025 hcl:#efcc98 + +byr:2011 ecl:#62fe2d hcl:#2b434a hgt:190cm +eyr:2031 iyr:1964 pid:7096872943 + +cid:258 hcl:#c0946f pid:698224453 eyr:2029 hgt:189cm iyr:2012 ecl:blu byr:1963 + +eyr:2028 byr:1942 hgt:156cm pid:836243052 iyr:2016 +hcl:#888785 cid:310 ecl:brn + +hcl:#a97842 pid:740164307 ecl:oth byr:1997 +hgt:166cm +iyr:2015 eyr:2026 + +hcl:4ee9da iyr:2020 +eyr:1933 hgt:136 ecl:#8dee29 pid:44266010 byr:1966 cid:82 + +ecl:amb byr:1921 hgt:182cm eyr:2026 +hcl:#c0946f iyr:2010 + +hgt:178cm cid:343 eyr:2023 pid:197119382 hcl:#623a2f iyr:2017 +ecl:brn byr:2002 + +eyr:2030 byr:1967 ecl:blu hgt:166cm iyr:2017 +pid:655602762 hcl:#6b5442 + +cid:143 hgt:152cm eyr:2026 iyr:2018 byr:1950 ecl:grn hcl:#866857 pid:067535973 + +byr:2019 ecl:#e3c288 iyr:1948 hgt:72cm hcl:7da71b eyr:1956 + +hcl:#cfa07d +pid:688405238 cid:200 byr:1950 +iyr:2020 ecl:hzl hgt:170cm + +eyr:2026 hgt:164cm iyr:2010 hcl:#b6652a pid:404835595 byr:1924 ecl:blu + +iyr:2016 hcl:#866857 +ecl:gry +eyr:2023 pid:986813245 cid:247 byr:1977 +hgt:173cm + +ecl:#a59335 eyr:2023 +hcl:033f22 byr:1947 hgt:152 +iyr:2029 pid:#1e686a cid:305 + +byr:2005 +ecl:amb hcl:#a97842 +iyr:1972 +eyr:1967 pid:274884869 + +eyr:2038 iyr:2018 +pid:181cm ecl:xry hgt:185in +hcl:109b28 cid:287 + +ecl:amb byr:1943 pid:002483342 hgt:178cm +hcl:#c0946f eyr:2030 +iyr:2014 + +iyr:2020 byr:1963 cid:131 hcl:#18171d hgt:181cm pid:146726616 eyr:2021 + +pid:062629370 byr:1931 hgt:188cm eyr:2021 ecl:gry +hcl:#166b3d + +pid:007028786 ecl:blu hgt:156cm byr:1981 hcl:#888785 cid:53 iyr:2019 + +iyr:2014 hcl:#623a2f +ecl:hzl eyr:2029 byr:1988 +pid:849096536 hgt:167cm cid:322 + +pid:160824363 +hcl:#19bed3 +eyr:2024 hgt:171cm +byr:1968 iyr:2019 + +eyr:2024 hcl:#dd66d0 +byr:1986 +cid:105 pid:816153574 ecl:hzl iyr:2013 +hgt:173cm + +hcl:#ceb3a1 hgt:62in ecl:gry +iyr:2017 cid:234 byr:1963 +eyr:2029 +pid:514406488 + +hcl:#fffffd ecl:blu +eyr:2020 iyr:2010 +pid:544347103 hgt:164cm byr:1939 + +eyr:2021 +pid:999479324 hgt:164in ecl:brn iyr:2016 +hcl:#a97842 byr:2020 + +pid:053149570 byr:1920 eyr:2027 hgt:190cm iyr:2011 hcl:#fffffd ecl:oth + +hgt:165cm +hcl:#cfa07d +ecl:oth +eyr:2023 +pid:186cm +byr:1937 iyr:2012 + +eyr:2026 hgt:64cm hcl:#ac426a byr:1969 +cid:345 iyr:1960 +pid:#df648a ecl:blu + +byr:1923 iyr:2017 +eyr:2027 pid:798497862 hgt:182cm +hcl:#ceb3a1 ecl:oth + +hgt:182cm eyr:1990 ecl:grn hcl:#efcc98 byr:1968 +pid:005962011 +iyr:2010 + +cid:74 eyr:2020 hgt:71in +iyr:2015 pid:487940408 byr:1952 +hcl:#733820 + +hgt:75cm cid:249 +ecl:hzl +hcl:#6b5442 pid:4860441 eyr:2020 + +ecl:hzl eyr:2025 hgt:183cm +iyr:2020 byr:1993 pid:572766871 hcl:#866857 + +hcl:#888785 pid:200125941 hgt:155cm byr:1923 +eyr:2021 iyr:2010 ecl:gry + +pid:502547835 iyr:2014 hcl:#b6652a +byr:1985 hgt:189cm eyr:2024 + +eyr:2024 hcl:#fffffd ecl:amb byr:1952 +pid:724639818 +iyr:2013 hgt:183cm + +byr:2023 +iyr:2026 ecl:gry eyr:2032 hcl:3e0fc4 pid:5620497552 +hgt:84 + +cid:79 +hgt:68cm +iyr:2021 +pid:#365b83 byr:1928 +ecl:#79a6b3 eyr:2027 hcl:54130e + +hgt:74cm byr:1953 +cid:263 iyr:2018 +ecl:zzz +hcl:#efcc98 +pid:154cm eyr:1951 + +cid:272 pid:0638528559 hcl:z hgt:63cm byr:2029 ecl:zzz +eyr:2033 + +iyr:2016 +hgt:193cm hcl:#6b5442 pid:715518898 ecl:brn cid:195 +eyr:2025 + +ecl:oth +eyr:2025 hgt:166cm byr:1944 +iyr:2017 pid:814141652 + +eyr:2025 cid:140 ecl:hzl hcl:#c0946f pid:824866056 iyr:2011 hgt:65in byr:1947 + +iyr:2016 +ecl:brn eyr:2021 +hgt:161cm +byr:1984 hcl:#602927 pid:821539320 + +hgt:175cm cid:190 hcl:#ceb3a1 ecl:brn byr:1927 iyr:2017 eyr:2029 pid:836598854 + +eyr:2026 ecl:brn hgt:157cm pid:038645205 byr:1995 +iyr:2019 cid:339 + +ecl:brn hgt:70in hcl:#c0946f +pid:535498918 cid:153 +iyr:2012 eyr:2030 + +byr:1995 +hcl:#efcc98 hgt:174cm eyr:2030 pid:180839761 +ecl:grn iyr:2010 + +hgt:59cm eyr:2035 byr:2021 iyr:2012 ecl:hzl pid:219328725 hcl:#888785 + +ecl:oth hgt:184cm byr:1984 iyr:2016 +hcl:#cfa07d + +iyr:1998 byr:2024 ecl:lzr hgt:187 hcl:z eyr:1935 pid:#789b56 + +iyr:1967 hcl:z pid:828930046 hgt:59in +cid:153 +byr:2021 +ecl:grn +eyr:1935 + +byr:1991 +hcl:#341e13 ecl:gry iyr:2018 +hgt:67in pid:157970631 eyr:2021 + +byr:1941 hgt:169cm pid:322510952 hcl:#cfa07d cid:75 ecl:oth +eyr:2021 iyr:2020 + +hcl:#7d3b0c iyr:2013 cid:78 hgt:167cm ecl:brn byr:1974 pid:237404828 + +pid:1567157833 +hcl:#7d3b0c iyr:2025 eyr:2023 +byr:2002 ecl:oth hgt:191cm + +ecl:amb iyr:2014 hgt:182cm pid:526612838 +cid:287 eyr:2025 byr:1988 +hcl:#866857 + +hcl:#866857 hgt:174cm byr:1992 eyr:2028 iyr:2015 + +eyr:2029 +hgt:190cm +hcl:#18171d +cid:245 +ecl:oth pid:3636033742 byr:2024 +iyr:2019 + +byr:1972 hgt:163cm eyr:2020 hcl:#b6652a +pid:360516396 iyr:2019 ecl:grn + +iyr:1997 ecl:#be02d2 +eyr:2020 cid:259 byr:1953 +hcl:#6b5442 +hgt:177cm pid:978155362 + +pid:377596476 cid:153 +eyr:2025 byr:2000 hgt:181cm iyr:2014 hcl:#abc5cb ecl:hzl + +cid:171 ecl:lzr iyr:2013 eyr:1973 byr:2004 +pid:#267099 hgt:101 + +hcl:#623a2f +pid:029193661 +hgt:183cm +ecl:hzl eyr:2029 iyr:2013 +byr:1977 + +ecl:amb eyr:2021 hgt:159cm byr:1970 cid:152 +hcl:#b6652a iyr:2020 pid:180512119 + +eyr:2025 +ecl:grn +hgt:60in iyr:2013 pid:697352361 +hcl:#18171d byr:1989 + +byr:1934 hgt:165cm pid:703537570 ecl:hzl iyr:2015 +hcl:#888785 + +ecl:gmt +hcl:6dd6a5 +byr:1951 +pid:#7ab761 cid:304 iyr:1924 eyr:1953 hgt:71in + +ecl:amb hcl:#733820 eyr:2030 hgt:178cm +pid:692422832 iyr:2019 +cid:276 + +iyr:2012 ecl:oth +pid:674969358 +eyr:2027 hgt:157cm cid:247 hcl:#a97842 + +byr:2017 eyr:2031 hgt:180cm hcl:#ceb3a1 pid:372071110 +iyr:2015 ecl:amb + +hgt:165cm iyr:2015 +eyr:2021 ecl:amb byr:2000 cid:235 + +eyr:2027 hcl:#623a2f pid:595874068 +ecl:amb +hgt:177cm iyr:2019 byr:1929 + +pid:8150929412 hgt:191in eyr:2031 cid:233 byr:2027 +iyr:2026 ecl:#e94348 hcl:z + +hgt:65 byr:2009 iyr:2029 hcl:#fffffd eyr:1950 pid:950012410 cid:212 ecl:#5a6042 + +ecl:#44c561 hgt:178cm eyr:2021 pid:753771724 +iyr:2014 +hcl:#70adb2 byr:1989 + +iyr:2018 pid:809109448 ecl:amb hcl:#b6652a hgt:63in byr:1976 cid:96 + +byr:2021 ecl:grn pid:9284377919 iyr:2011 hgt:75cm hcl:#18171d eyr:2026 + +ecl:oth +byr:1926 +hgt:63 iyr:1948 cid:61 hcl:a528d1 eyr:2034 + +byr:1978 pid:150503169 iyr:2015 ecl:grn hgt:172cm cid:70 eyr:2022 hcl:#7d3b0c + +byr:1957 hcl:#cfa07d iyr:2010 ecl:amb eyr:2025 pid:921901279 + +ecl:utc pid:154cm +byr:1964 eyr:1978 hgt:114 hcl:z + +byr:1929 ecl:amb eyr:2028 iyr:2013 +hcl:#fffffd pid:479814281 +cid:105 hgt:64in + +pid:949640425 +cid:205 hcl:#341e13 ecl:amb +hgt:171cm byr:1998 + +hgt:190cm cid:113 ecl:grn eyr:2037 +hcl:#ceb3a1 pid:7994792779 iyr:2011 + +hgt:152cm iyr:2010 +byr:1992 eyr:2020 +hcl:#602927 +cid:66 +pid:604149642 + +eyr:2028 +byr:1961 hgt:71in +iyr:2013 cid:135 +pid:534090716 hcl:#ceb3a1 ecl:oth + +iyr:1937 byr:1995 cid:200 +eyr:2037 pid:#daf9af +hcl:052017 ecl:zzz hgt:73cm + +ecl:amb +hcl:#a97842 +iyr:2018 +hgt:153cm +cid:149 eyr:2023 pid:533403632 + +cid:275 ecl:brn iyr:2017 pid:087665205 byr:1945 hcl:#7d3b0c +eyr:2025 + +eyr:2030 hgt:177cm hcl:#cfa07d iyr:2018 pid:734113761 +byr:1965 + +hgt:163cm byr:1924 ecl:blu cid:125 +eyr:2027 hcl:#fffffd pid:137238888 + +hgt:174cm hcl:#623a2f eyr:2023 ecl:gry pid:585758460 +iyr:2011 + +cid:183 +byr:1928 pid:471385060 +hgt:192cm +ecl:oth iyr:2010 hcl:#623a2f eyr:2020 + +hgt:177cm +cid:273 ecl:oth eyr:2020 +hcl:#efcc98 +iyr:2012 pid:246299733 +byr:1954 + +pid:052203766 cid:146 ecl:hzl byr:1974 hcl:#6b5442 +eyr:2030 hgt:173cm +iyr:2011 + +hgt:167cm +byr:1972 iyr:2010 +pid:783359411 ecl:hzl hcl:#9f8cc9 eyr:2028 + +iyr:2020 hcl:#18171d ecl:grn +byr:1992 +hgt:189cm +eyr:2023 pid:736882272 + +cid:230 ecl:utc iyr:2022 +pid:170cm +byr:2015 hcl:#c0946f +eyr:2031 + +cid:261 +byr:1922 hgt:170cm ecl:brn eyr:2021 +pid:593276915 hcl:#18171d +iyr:2017 + +hcl:#341e13 pid:038417039 hgt:61in eyr:2025 iyr:2017 +cid:117 + +iyr:2017 eyr:2026 pid:441484223 +hgt:155cm byr:1968 hcl:#ceb3a1 ecl:hzl + +eyr:2021 +hgt:64in +ecl:oth hcl:#b6652a byr:1954 pid:204959612 iyr:2016 + +hcl:z eyr:1969 +pid:162cm ecl:#944b0f +iyr:2030 byr:2029 + +hgt:114 eyr:2034 byr:2026 hcl:84fa1a +pid:47909473 +iyr:2028 +ecl:utc + +eyr:2025 ecl:blu hgt:157cm iyr:2014 hcl:#a97842 byr:1974 pid:702610675 cid:241 + +pid:732388109 +hcl:#6b5442 cid:272 eyr:2026 hgt:193cm +ecl:amb byr:1982 + +eyr:2030 byr:1994 +hgt:177in ecl:amb pid:1589147420 iyr:2011 hcl:#4bf920 +cid:252 + +ecl:oth eyr:2022 +byr:1948 +pid:177cm cid:90 hgt:102 hcl:z iyr:2028 + +hgt:157cm pid:233347213 +hcl:z +byr:2009 eyr:2027 cid:235 ecl:blu +iyr:1965 + +ecl:blu iyr:2030 eyr:2028 hcl:#18171d pid:322593908 byr:1954 +cid:215 hgt:63in + +hgt:72cm +cid:345 pid:911728732 eyr:2025 +byr:2004 ecl:#0c4af7 hcl:3bb675 + +pid:171714794 byr:2019 +hcl:#866857 +cid:290 hgt:183in ecl:#d0c30f eyr:2032 + +iyr:2016 pid:905945155 hcl:#ceb3a1 byr:1958 hgt:159cm eyr:2028 cid:180 ecl:oth + +hcl:efb614 +eyr:2022 hgt:177cm pid:46962273 +byr:1974 +ecl:#089bdd iyr:1988 + +pid:662993164 iyr:2011 eyr:2025 ecl:hzl +byr:1942 hcl:#fffffd +hgt:175cm + +hcl:#7d3b0c iyr:2016 hgt:175cm eyr:2022 pid:953132241 +byr:1963 cid:261 ecl:grn + +iyr:2013 hgt:180cm cid:318 +ecl:amb +byr:1985 pid:439097817 eyr:2029 hcl:#602927 + +hgt:162cm ecl:blu +pid:675749832 cid:73 +byr:1940 hcl:#888785 +eyr:2026 + +pid:275352007 iyr:2012 eyr:2020 +ecl:amb hcl:#623a2f hgt:175cm cid:317 byr:1988 + +hcl:z hgt:164in +iyr:2026 eyr:1961 ecl:#2df35e pid:#5c9ed5 cid:341 + +pid:848086119 ecl:oth eyr:2021 iyr:2011 hgt:180cm byr:1923 hcl:#93461b + +eyr:2028 +iyr:2014 +byr:1978 +hgt:184cm +pid:966277564 ecl:hzl +cid:176 + +hcl:#888785 ecl:amb cid:329 pid:835961958 byr:1927 eyr:2028 iyr:2016 + +pid:160cm eyr:2026 hcl:#08714b +ecl:hzl iyr:1961 +hgt:156cm byr:1984 + +ecl:gry cid:302 +byr:1965 +iyr:2019 hcl:#ceb3a1 eyr:2027 pid:458192010 hgt:156cm + +pid:058273969 byr:1942 eyr:2027 +hcl:#c0946f iyr:2013 hgt:179cm + +iyr:2019 hgt:193in pid:52144528 eyr:2036 +cid:169 ecl:grt hcl:7e7039 + +hgt:192cm ecl:blu iyr:2015 pid:544936486 eyr:2024 +byr:1972 hcl:#c0946f + +eyr:2000 +hcl:78de23 byr:2020 +hgt:171in pid:160cm cid:68 +iyr:1956 ecl:gmt + +hcl:#733820 ecl:grn iyr:2018 +byr:2001 pid:770957230 + +cid:103 ecl:grn iyr:2018 +pid:068344094 +eyr:2023 hgt:69in byr:1984 hcl:#6b5442 + +hgt:193cm eyr:2021 ecl:grn hcl:#602927 byr:1938 iyr:2011 + +iyr:1931 +hcl:c0a318 +pid:99195939 +byr:2028 ecl:grt hgt:164 eyr:2017 + +eyr:1980 +ecl:zzz +hgt:98 cid:161 +pid:#96fe01 hcl:z +iyr:1974 + +byr:1936 hgt:176cm pid:56797167 iyr:2015 +ecl:#07ad47 +hcl:z + +pid:48720181 hcl:270e76 +byr:2022 +hgt:180cm ecl:#dde399 +eyr:2035 iyr:2023 + +eyr:2030 byr:2022 iyr:2018 hgt:162in ecl:gry +hcl:#63e2ec pid:615812600 + +ecl:grn +cid:56 hcl:#623a2f eyr:2020 hgt:167cm byr:1971 iyr:2012 +pid:262692066 + +hgt:61 hcl:#efcc98 iyr:2011 eyr:2026 +byr:1938 +ecl:amb pid:385025739 + +pid:972423724 hcl:#602927 eyr:2027 ecl:oth iyr:2015 +hgt:158cm byr:1956 + +pid:530035096 +ecl:hzl +iyr:2017 +eyr:2024 hcl:#888785 byr:1962 hgt:64in + +byr:1935 eyr:2022 ecl:grn hcl:#7d3b0c pid:294714199 + +eyr:2029 +iyr:2013 +byr:1927 hgt:175cm pid:058261075 hcl:#cfa07d ecl:amb + +ecl:blu pid:188764763 hgt:155cm byr:1921 +iyr:2018 eyr:2029 hcl:#b6652a + +byr:1975 hcl:930e76 iyr:2019 +pid:169cm eyr:2009 hgt:191 +ecl:#d28c56 + +hcl:z +pid:3190617557 +hgt:160cm cid:80 ecl:oth iyr:2022 eyr:2008 +byr:2016 + +hcl:#888785 byr:1999 ecl:blu cid:238 iyr:2018 hgt:160cm +eyr:2028 pid:174517111 + +eyr:2035 +hcl:z byr:2020 +pid:262135957 cid:324 iyr:2016 hgt:161cm ecl:grn + +byr:1936 +ecl:grn +iyr:2013 hcl:#623a2f eyr:2029 hgt:166cm + +hcl:#cfa07d hgt:159cm eyr:2021 +ecl:hzl +iyr:2014 pid:816039817 byr:1935 + +pid:596634790 hgt:161cm +eyr:2036 iyr:2016 +hcl:#7d3b0c byr:2015 ecl:brn + +byr:1952 +hgt:157cm eyr:2024 cid:60 pid:876160626 +ecl:blu iyr:2011 hcl:z + +hgt:193cm iyr:2020 eyr:2026 +pid:0136642346 ecl:hzl hcl:#efcc98 byr:1995 + +byr:1934 hgt:177cm +pid:445993865 +ecl:brn iyr:2018 +eyr:2030 +hcl:#733820 + +eyr:2021 hgt:71in +pid:918630878 +hcl:#602927 iyr:2017 byr:1943 +ecl:gry + +ecl:#81de2c iyr:2021 hgt:176cm eyr:1947 hcl:#888785 pid:1370052400 + +ecl:amb +byr:1922 iyr:2012 eyr:2022 pid:098866466 hcl:#18171d hgt:63in + +eyr:2028 iyr:2010 hcl:184355 +byr:1968 pid:337089458 ecl:brn hgt:181cm + +hcl:#733820 pid:225958483 ecl:gry eyr:2030 hgt:62in iyr:2012 byr:1987 + +eyr:1955 +hcl:03199c +pid:#3e832e +byr:2014 ecl:#453931 hgt:70cm + +byr:1975 +ecl:blu hcl:#7d3b0c +cid:169 pid:582470437 hgt:151cm +iyr:2019 eyr:2027 + +iyr:2017 byr:1971 pid:343492418 hgt:150cm hcl:#fffffd eyr:2024 + +byr:1997 +eyr:2026 +cid:257 hcl:#7d3b0c ecl:blu hgt:166cm iyr:2016 pid:117625518 + +iyr:2014 cid:248 hgt:165cm hcl:#18171d pid:294270262 +byr:1925 ecl:amb +eyr:2028 + +hgt:167in ecl:dne pid:174cm iyr:2019 byr:2005 hcl:b29331 cid:86 + +hcl:#733820 pid:259969636 eyr:2023 +ecl:hzl cid:317 +hgt:185cm byr:2025 +iyr:2012 + +hcl:#cfa07d hgt:152cm pid:807755992 iyr:2020 +byr:1922 ecl:grn eyr:2025 cid:241 + +pid:997807107 byr:1958 ecl:dne iyr:2013 eyr:2023 hcl:#18171d +hgt:152cm + +ecl:blu hgt:170cm +byr:1932 +pid:775223495 eyr:2024 iyr:2015 + +iyr:2011 +ecl:grn hcl:#ceb3a1 pid:190577415 +hgt:63in +eyr:2021 +byr:1986 + +ecl:oth eyr:2025 hgt:180cm +pid:258195402 iyr:2017 +byr:1961 +cid:109 hcl:#888785 + +hgt:178cm byr:1952 eyr:2023 hcl:#733820 +pid:106939563 ecl:brn iyr:2012 + +hgt:188cm iyr:2012 hcl:#fffffd byr:1942 +ecl:brn pid:804371742 + +byr:1978 cid:120 +eyr:2026 pid:405714523 hgt:60in +hcl:#a97842 ecl:blu +iyr:2017 + +iyr:2015 byr:1958 ecl:grn +hcl:#b6652a pid:#9e8af3 +eyr:2026 hgt:167cm + +hgt:171cm hcl:#888785 +cid:274 +ecl:grn pid:919263460 eyr:2023 iyr:2020 + +pid:606726472 eyr:2022 +byr:2008 +ecl:zzz cid:72 hgt:173in + +eyr:2032 byr:2004 +hcl:z iyr:2011 ecl:hzl +pid:523494728 +hgt:70cm + +hgt:169cm pid:755822781 byr:1984 ecl:hzl hcl:#6b5442 iyr:2014 + +eyr:2020 +byr:1942 cid:85 +hgt:157cm pid:558287447 hcl:#efcc98 +ecl:hzl + +byr:1980 cid:225 pid:367501996 iyr:2016 ecl:grn hcl:#efcc98 +hgt:175cm eyr:2029 + +pid:264780775 hgt:182cm ecl:grn +hcl:#18171d +eyr:2024 +byr:1926 iyr:2013 + +byr:1969 iyr:2015 +eyr:2026 ecl:blu +hcl:#fffffd +pid:005695878 cid:273 + +ecl:brn byr:2006 hgt:152cm +hcl:#888785 +pid:171cm cid:249 iyr:2026 +eyr:2022 + +byr:2011 iyr:2020 ecl:zzz hcl:z pid:412624100 +eyr:2031 + +cid:111 hcl:df9bd0 +iyr:2022 ecl:#32fdf9 +byr:2017 eyr:2000 +hgt:166in pid:0654651026 + +eyr:2021 +ecl:gry pid:587324819 hgt:187cm byr:1951 hcl:#6b5442 + +iyr:2011 +pid:180780096 hcl:#623a2f ecl:amb hgt:160cm byr:1991 eyr:2026 + +byr:2022 hgt:152cm eyr:2023 cid:70 ecl:grn +hcl:e0a24e +iyr:1959 pid:77110462 + +pid:251982311 byr:1994 ecl:gry hgt:165cm eyr:2021 +hcl:#623a2f +iyr:2019 + +ecl:blu byr:1945 +cid:241 +pid:732768808 hcl:#efcc98 +hgt:171cm eyr:2020 iyr:2012 + +cid:243 eyr:2001 +hcl:01a022 +hgt:162 pid:507703455 +byr:2003 ecl:#c6a07b +iyr:1941 + +hcl:#733820 cid:150 +ecl:hzl pid:843607639 hgt:190cm +byr:1958 +eyr:2025 + +eyr:2030 +pid:489370607 iyr:2014 ecl:oth hcl:#cfa07d byr:1995 hgt:193cm + +hgt:68in +byr:1933 +iyr:2010 ecl:brn +pid:380075958 +hcl:#623a2f cid:279 +eyr:2025 + +iyr:2019 +byr:2001 +hcl:#cfa07d ecl:brn pid:349877352 +hgt:161cm eyr:2029 + +hgt:171cm +eyr:2040 ecl:dne hcl:#6b5442 iyr:2020 byr:1990 + +hcl:#fffffd +hgt:154cm +byr:1979 eyr:2020 iyr:2018 +pid:118713281 cid:174 + +hcl:#7d3b0c eyr:2030 ecl:brn iyr:2017 +cid:184 hgt:180cm pid:504181498 byr:1925 + +hgt:150cm +eyr:2020 byr:1999 hcl:#a97842 iyr:2011 ecl:grn pid:620166468 + +hcl:#602927 +iyr:2015 +byr:1928 +pid:083747352 +eyr:2027 hgt:193cm +ecl:hzl + +byr:1938 ecl:gry +pid:511669464 eyr:1973 hgt:70cm +cid:262 iyr:2015 hcl:#c0946f + +eyr:2029 +byr:1923 hgt:160cm hcl:#7d3b0c iyr:2013 pid:525837692 ecl:gry + +hcl:#602927 eyr:2025 +pid:232338168 hgt:174cm cid:322 iyr:2010 ecl:oth + +hgt:192in cid:126 hcl:#6b5442 +pid:101406211 byr:1922 ecl:hzl eyr:2022 iyr:2013 + +eyr:2026 ecl:amb +byr:1921 +cid:336 +iyr:2020 hgt:182cm pid:533626984 + +pid:411943955 ecl:amb eyr:2025 hgt:166cm byr:1964 hcl:#341e13 cid:285 +iyr:2010 + +ecl:grn byr:1933 eyr:2024 +hgt:153cm +hcl:#5cfb31 iyr:2019 pid:773885967 + +ecl:hzl pid:426060511 +hgt:159cm +byr:1922 hcl:#6ffd04 iyr:2017 + +byr:2025 pid:#097d1b iyr:2020 eyr:2029 hcl:73d113 hgt:69cm ecl:utc + +ecl:amb hgt:170cm eyr:2025 byr:1930 iyr:2018 hcl:#733820 +cid:262 + +iyr:2019 +eyr:2021 +cid:65 pid:258615618 +ecl:oth byr:1987 +hcl:#efcc98 +hgt:178cm + +hcl:z eyr:1980 ecl:#1c5fd1 hgt:65cm byr:2014 +cid:222 pid:#c69fd5 iyr:2020 + +cid:271 pid:#4b8380 hcl:80fab0 +byr:2024 ecl:#20e25f +iyr:1945 +eyr:1935 hgt:159cm diff --git a/aoc2020/4_ex.txt b/aoc2020/4_ex.txt new file mode 100644 index 0000000..0ff208e --- /dev/null +++ b/aoc2020/4_ex.txt @@ -0,0 +1,13 @@ +ecl:gry pid:860033327 eyr:2020 hcl:#fffffd +byr:1937 iyr:2017 cid:147 hgt:183cm + +iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884 +hcl:#cfa07d byr:1929 + +hcl:#ae17e1 iyr:2013 +eyr:2024 +ecl:brn pid:760753108 byr:1931 +hgt:179cm + +hcl:#cfa07d eyr:2025 pid:166559648 +iyr:2011 ecl:brn hgt:59in diff --git a/aoc2020/4_ex2.txt b/aoc2020/4_ex2.txt new file mode 100644 index 0000000..81712b3 --- /dev/null +++ b/aoc2020/4_ex2.txt @@ -0,0 +1,26 @@ +eyr:1972 cid:100 +hcl:#18171d ecl:amb hgt:170 pid:186cm iyr:2018 byr:1926 + +iyr:2019 +hcl:#602927 eyr:1967 hgt:170cm +ecl:grn pid:012533040 byr:1946 + +hcl:dab227 iyr:2012 +ecl:brn hgt:182cm pid:021572410 eyr:2020 byr:1992 cid:277 + +hgt:59cm ecl:zzz +eyr:2038 hcl:74454a iyr:2023 +pid:3556412378 byr:2007 + +pid:087499704 hgt:74in ecl:grn iyr:2012 eyr:2030 byr:1980 +hcl:#623a2f + +eyr:2029 ecl:blu cid:129 byr:1989 +iyr:2014 pid:896056539 hcl:#a97842 hgt:165cm + +hcl:#888785 +hgt:164cm byr:2001 iyr:2015 cid:88 +pid:545766238 ecl:hzl +eyr:2022 + +iyr:2010 hgt:158cm hcl:#b6652a ecl:blu byr:1944 eyr:2021 pid:093154719 diff --git a/aoc2020/5.py b/aoc2020/5.py new file mode 100644 index 0000000..f5d2fe7 --- /dev/null +++ b/aoc2020/5.py @@ -0,0 +1,37 @@ +def search(n): + first7 = n[:7] + lo = 0 + hi = 128 + for c in first7: + mid = (lo + hi) // 2 + if c == "F": + hi = mid + elif c == "B": + lo = mid + x = lo + + last3 = n[-3:] + lo = 0 + hi = 8 + for c in last3: + mid = (lo + hi) // 2 + if c == "L": + hi = mid + elif c == "R": + lo = mid + y = lo + + id = 8 * x + y + return id + +ids = [] +with open("5.txt") as f: + for line in f: + line = line.strip() + id = search(line) + ids.append(id) +ids.sort() +print(ids) + +print("ajsdoifapjds") +for i in range(len(ids) - 3): diff --git a/aoc2020/5.txt b/aoc2020/5.txt new file mode 100644 index 0000000..0761d83 --- /dev/null +++ b/aoc2020/5.txt @@ -0,0 +1,782 @@ +FBBBFBBLRR +BFFFBBFLRR +BFBFBBFLLR +BBFFFFBLLR +FBBFBBFRLL +BBFFFFBRLL +FBBFBFFLLR +BFFBBBFRRL +FFBFBFFRLR +FBFFFFBLLL +FBFFFFFLRL +FFFBFBBRLR +FFBFFFFLLL +BFBBBFFLLL +FFBBBFBRLR +BFFBFBFLLL +FBFBFFFLLL +BBFFBBBRRL +FBFFBFBLLL +BFFBFBFRRL +FBFBFFFRLR +BFBBBFBRLL +FFBBFBFLRL +FBBFFBFRRR +BFBBBBBLRL +FFBFBFBLRL +FFBFFFFLRL +BFBFBFBRRR +FBBBBBBRRR +BFBFFBBRLL +BBFFBFBLLL +BFBFBBFRLL +FBFBBBBRLR +BFFBBFBRRL +BFBBBFBRRR +FBBBFBBLRL +BBFFBBBLRL +FFBBFFFRRR +FBFFBFFLLL +FBFFBBFRLL +FBBBFBFRLL +BFFBBFFLRL +FFFBFBBRRR +BFBBBBFRLR +FBFBFBBRRL +BFFFFFFRRL +BFBBBBFRRL +FBFBBFFRRL +FBFFBFFRLR +FBBFFBBRRR +FBFBBFFRRR +FFFBBFFRLR +BBFFBFBRRL +FBBBBBFRRR +BFBBBBBRLL +BFFBFFBLRL +FBBBFFBRRR +BFFFBBFRLR +FFBFBBBRLL +BFBBBFFRLL +BFBBFBFRRR +FBFBFBBLLL +BBFBFBBRLL +FBBFFBBRLR +FFBBFBFLRR +FBFFFFFRLL +BFBFBBBRLR +FBFFFFBLRR +FBFFFFBRLL +BFFFFFFRLL +BBFBFFFRRL +BFBFBBBRRR +FFBFFFBLRL +BFFFBBBLLR +FBFFBFFRLL +FFFBFBBLRL +BFBFBBFRRL +FFBFFBBRLL +FBBFBFFLRR +FBFFFFFLLR +FFBFFBFRLL +FFBFFBFLRR +FBFBBBFRLR +FFBFBBFLLR +BBFFBFBLLR +FFBBBBBRRL +BFFBBBBRLL +FFBFBFFLLL +BBFFFBBRRL +FFBFFBFRRL +BBFFBFFRLR +FBFBBFFRLR +FBBFFBFRRL +FBBBFBBRRR +FFBBBBBRRR +BFFBBFBRLL +BFBFBBFLLL +FFBFBBBRRR +BBFFFBBRRR +BFFBFFBLRR +FFFBBFFLRL +BFFBBBFRLR +BFBBFBBRLL +BFBBFBBLLL +FFBFBFBRRL +BFFBBFFRRR +FBFBBBBLLL +FBFFFBFRRR +BFFBFFFLRL +FFFBFBBRRL +FBFBFBBRRR +FBBFBFBLLR +FBBBFFBRLR +FBFBFFBLLR +FBFFBBBRLL +FBFFFBBLRR +BFFFBFFLLL +BFBBBBBLLR +FFBBFFBRLR +BFBFBBFLRL +BBFFBBBRRR +FFBBFFFLRR +BFBFFFFRLR +BFBBBFBRRL +BFFBBBBRLR +BFFBFBBLLR +BFFBBFFLLR +FBFFBBBRLR +FBFFBBBLLR +BBFFBFFLLL +BFFBFBFRRR +BFBFFBFRLR +FBFFFBBLRL +FBBBFBFRRL +BBFFFFBLLL +FFBBBFFLRL +BFFBFFFRLR +FBBFBBFLLL +FBFFBFFRRL +FFBFFBBRLR +BBFFBFFLRR +FBFBBBBLLR +FFBBBFFLRR +BFBBFBFLLR +FBBFBBFLLR +FFBFFBBRRL +BBFFFFBRRL +FBBBBFBRRL +FBFBFFFLLR +BFBFBFBLLR +FFBFBFBRRR +BFFFBFFLLR +BBFFBFFRLL +FBBBFFBRLL +FBBFFFFRRL +FBBBFFFRRR +BBFFFBBRLL +BFFBBFFLRR +BFFBFBBRLR +BFFBFBBLLL +BBFBFFBLLR +FBBBBFFLLL +BFFBBFBLRL +FBBBBFBRRR +FBBFBBBRRL +BFFBBFFRLL +BFFFFFBLLR +BFFBBFBLRR +FFBBFBFRRR +BFBFFBFRRL +BFFFFBBLRR +FFFBBFBLRR +BFFFBBBLRR +FFBFBBFLRL +FBBBFFFLLL +FBFBFBFLRR +FFFBBFBLLL +FFBBFBBLLR +FBBFBBFLRL +FFBFFBBRRR +FBBBBFFRRL +FFFBBBFRLR +FBBFFFBLRL +BFFBFBBLRL +BFFBFBFLRR +BFFBFFBRRR +FFBFBBBRRL +BFFBFFFLLR +BFFBBFBRLR +FBBBFFFRRL +BBFBFFBLRL +BBFFFBBLLR +FBFBFFFRRR +BFFFBBBLRL +FBFFBFFLLR +BBFFFFFRLL +FFBFFFBLLL +BFBBFBBRLR +BFFFFFBLLL +BFBBFFFLLL +FFBBBBFRLR +BBFFFFFLLR +BFFFFBFLRL +FFBFFBBLLR +BBFFBFFLLR +BFBFFBFRRR +FBFFBFFRRR +BBFFFBFLLL +FFBFFFFRRL +FBBFBFFRRR +FFBBFBBRRL +FFBBBFFLLR +BFFFFBBLLR +FFBFBFBLLR +BFFBBBBLLR +FBBBBFBLLL +BFBFBBBRLL +FFBFBBFRRR +FFFBFBBLLR +FFFBBFBRRR +FFFBBBBLRR +FBBFFFFLRL +FFFBBFFLRR +FFBFBFFRLL +FBBFBBBRLR +FFBFBFBRLR +FBBBFFBLRL +BFFFFFFLRL +BFFBBBBLRR +FBBFFBBLRR +BBFFBBFRRL +FFBFBBBLLR +FFBFFFFRRR +FBFFFBBRRL +BFBFFFBLLR +FBBFBFBRRL +BBFBFFBRLR +FBBBBBFRLR +BFFBBBFLRR +BFFFFFBLRR +BBFFBBFRLL +FFFBBFFRRR +FBBBBFFRLL +FFBFFFFRLR +BFFFBFFRRL +FBBBBFFLRL +BBFBFFFRLL +BBFFFBBLRR +FBBBFFFLLR +BFFBFBFLRL +FFBBBBFLLL +BFFFBFFRLL +FBBFFBFLLR +BBFBFBBRRR +FFBFFFBRLL +FBFBBBFRLL +BFBBFBBLRR +FBBBBFFRLR +BFFBBBBLLL +FFFBBBBRLR +FBBFBBBRLL +FFBBBFBLRL +BBFBFFBLRR +FFBBFFFLLR +FFBBFBFRLR +BFBBBFBRLR +FBBFFFFLLL +BBFFFBFRRR +FFBFBBFLLL +FBBFBBBRRR +BFBBFFBRRR +FBBFFBFLLL +FFBFBBBLRL +FBFBBFBRRR +FBFBFFFRLL +BFFFFFFLLR +FBFBBBFLLR +BFBFFBFRLL +BFBFFBBRLR +BFFBBFBLLR +BFFBFBBLRR +BFBBBFFLRL +BFBBFBFLRR +BFBBBFFRLR +FFFBBFFRRL +BFFFBBFRRL +BFFBFBFLLR +BFBFFBBLRR +BFBBBBBRRR +FFBBFBBLRR +BFFBBFFRLR +FFBFBFBRLL +BFBBBBFLRL +FBBFBBFLRR +FBFBBBFLRL +FBFFFBBRRR +BBFBFFFRRR +FBFFBFBRLL +FBBBBBBRLL +FFBBBFFRRL +FFBBFFFRLL +FBFBBFBRLL +FFFBBBBLLL +BFBFBBBLLL +FFFBBBFLLR +FFBFBBFRLL +BBFFBBBLLR +FFFBBFBLRL +FFBBFBBLLL +FBFFFBFRLR +BFBBFBBLRL +FFFBFBFRLR +BFBFFFBRLR +FFBBBBBLLL +FBFBFFBRRR +BFFBBBBRRL +FBBBBFBLLR +BFBBFBFRRL +BBFBFBFLLR +BFFFBFBRRR +FFFBBFBRRL +BFBBBBFLLR +FBBBFBFLLR +FFBFFBFLRL +BFFFBFBLLL +BFBBBBBLRR +BFBFBBBLRR +BFFBFBBRLL +FFBFBFFLRL +FBBBFBBRRL +BFFBBFFLLL +FBFBFFBRLR +FBBFFFFLRR +FBBFBFBLRL +BBFFBBBLRR +BBFFBBFLLL +FBBBBBBRRL +BFFFFBFRRL +BFFFFBBLRL +BBFFFBFRLL +BFFBBFFRRL +FBBBFBFRLR +FBFFBFBLLR +FFBFFFFLRR +FBBBBBBLRL +FFBBFBBRLL +FFBBFBBLRL +FBFFFBBRLR +FFBBFFFLLL +BFFFFBFRRR +BFBFBFBLLL +FFFBBFFLLR +FBBBFBBRLL +BFFFFBBRLL +FBFBFFBRRL +BFBBBFBLLR +BFFBBBBRRR +BBFFFFFRLR +BFFFBBBRRL +BBFFFFFRRL +BFFBFBFRLL +BBFFFFFLRR +FBFBBBBLRR +FBFFBBBLRL +BFBFBFFRLL +FFFBBBBLLR +FBFBBBBRRR +FBBBBBFRRL +BFBFFFBRRL +BFBFFFBRRR +BBFBFBBLRR +FFBBBFBLLR +FFBBBFBRLL +BFBFFFFLLR +BFBFBFFLRL +FBFFFBBLLR +BFFFFFBRLL +BBFBFBBRRL +BFBBFFFRLL +BFFFFFFRLR +FBFFBFBRRR +BBFFBBFRRR +FFBBBFFRRR +FFBBBFFLLL +BFBBFFFLRR +FBBFFBFLRL +FBFFFFBLLR +BFBBBFBLRL +BFFBBBFRRR +BFBBBFFLLR +BFFFBBBRRR +BBFBFBFRRR +FFBFFBFRLR +FBBFFFFRLR +BFBFBBFRRR +BBFFBBFLRR +FBBBFFBLRR +BFBBFFBLRL +FBFBBBBRRL +FFFBBBFLRL +FBBFFFBRLR +FFFBBFFLLL +BFFBFBBRRL +BFFFBFBLRR +FBBFFFBRRR +FBBFFFBRRL +FBBBBBBRLR +FBFFFBFLRL +BBFFBFBLRL +FBBFFFBLLR +BFBFFBBRRR +FBFBBFFLRR +FBBFFBBLLR +FFBBBFFRLR +BFFBFFFLLL +FBBFFFFRLL +BFBFFBBLRL +BFBFFBFLLR +BFBBFFFRRR +BBFFFBFRLR +FBFBBBFRRL +FFBBFBBRLR +BFFFFFFRRR +BBFBBFFLLL +BBFBFFBRRR +FBBFFBBLLL +FFBFBFBLRR +BFBBFFFRRL +BBFBFFFLRR +FBBBBFBLRL +FBBFBFBRRR +FBFBFBBLRR +FBFFBBBLLL +FFBFBFFLRR +BFBFBFFRRR +BFBFBFFLRR +BFFFFFFLRR +FBFBFBBRLR +FFBFFFFRLL +FBBBFBFLRL +BFBFBBFLRR +FFBBFBBRRR +FBFBFFFLRR +BBFBFFBRRL +BFBFBFFLLL +FBFFBFBRLR +FBBBBBBLLR +FFBBBBFRLL +BFBFBBBLLR +FBFBBBBRLL +BFBBBBFLLL +FBFBFFBLRL +FFFBBBBRRR +BFFFFBFLLR +BBFFFFBLRR +BBFFFBFRRL +FBBFBFFLLL +BFFFBFBRLL +FBBBFFBRRL +FFFBFBBLRR +BBFFBBFLRL +BBFFBFFRRR +BFFFFBFRLR +FBFBBFBLRL +FBFFBBFLLL +FBFFFBBLLL +FFBBFFBLRL +FBBFBBFRLR +FBBFBBBLRL +FBFFFBBRLL +BFBFBBBRRL +BFBFBFBRLR +FBFFBFFLRR +BFFFBFFLRR +BFBBBFFLRR +FBBBBBFLLL +FFBFBFFRRR +BBFFBFFRRL +BFBBBFBLLL +FFBBFBFRLL +FBBBFBFRRR +FBFFBBBLRR +BBFFFFBRRR +FBFBFFFRRL +BFFFBBFLRL +FBBFFFBLLL +BFBBFFBLLR +BFBBFFBLLL +FBFFBBFRRR +BFFBBFBRRR +BFFFFFBRLR +FBBBBBBLLL +FFBFBBFLRR +FBFBFBBRLL +BBFBFFFLLR +BFFFFBBRRL +BFFBFFBLLR +BFFFBBFRLL +BBFFFFFLRL +FBFFFFFLLL +BBFFBBBRLL +BFBBFFBRRL +BFFFBBBRLL +FBFFBBFLRL +BBFBFFBLLL +FBFBBFBLRR +FFFBBBFLRR +BBFBFBFLRR +BFBBBBFRRR +BFFFBFFLRL +FBFFFFBRRL +BBFBFBFLLL +BFFFBBBRLR +FBFFBBFRRL +FBBFFBBRRL +FBFBFBFRLR +BFFBFFFRRL +FFFBFBBLLL +BFBBFBFRLL +BFFFBFBLLR +FBBFBBFRRL +FBBBBBFLRR +FBFFBFBLRR +FBBBFFBLLL +BFBBBFFRRR +BFBFFFFLRL +FFBBFFBRRL +BFFFFFFLLL +FFBFFBBLRL +FFFBBBFRLL +BFFFBBFLLL +FBBBFBBRLR +BBFBFFFRLR +BFFBFFBLLL +FFBBFBFLLR +FBFFBBBRRR +BFBFFBFLRR +FBFBFBBLRL +FFBFFFBRRR +FBBFFFFLLR +BFBBBFFRRL +FFBBBFFRLL +FFFBFBFRRR +FFBBBBFLRL +BFBFBFBRLL +FFFBBBFLLL +BFBFFFFLRR +BFFBFFBRRL +BFBFFBBLLL +FBBBBFBLRR +FFBFFBFRRR +FFBFFFBLLR +FFBBFFFRRL +BFBFFFFRLL +BBFFFBBRLR +FBFBBFBRRL +BFFFFFBLRL +FFBFFFFLLR +FBFFFBFLLR +FFFBBFBRLR +BBFBBFFLRL +FFBBBBBLLR +BFBBFBFLLL +BFBFFFFRRL +BFBBFFBRLR +FBBBFFFRLR +FBBFFBFRLR +BBFBFBBRLR +FBBBFFBLLR +FBBBFFFRLL +FBFBFBFRRR +BBFFBFBRRR +FFBBBBBRLL +FBFFBFBRRL +FBFFBBFLRR +FFFBBBFRRL +FFBBFFBRLL +BFBFFFBRLL +FBFFFBFLLL +FBBBBFFRRR +FBBFBFBRLL +BFFBFBFRLR +FFBFBFBLLL +FFBBFFBRRR +FBFFFFBLRL +FBBBFFFLRR +FFBBBBFRRL +FFBFBBBRLR +FBBBBFFLRR +BFBFBFBLRR +BBFBFFFLRL +FFFBBFBRLL +FBBBBBFLRL +FBBFBBBLLR +BFBBFFFLLR +FBFFFFFRLR +BBFFFFBRLR +FBFFFFFRRL +FFBBFFFLRL +FFBBBFBRRR +BBFFFBBLRL +FBBBBFBRLR +FBFBBFFLRL +FBFFBFFLRL +FFBFFFBRRL +FFBBBBFLLR +FBBFBFBLRR +FBFBBFBLLL +FFBBBFBLLL +BFFFFBBRRR +BBFFFBFLRL +FFFBBBBRLL +FFBFFBBLLL +FBFFFBFLRR +FBFBFFBLLL +BFFFBFFRRR +FFBBFFBLRR +BFBBFBFRLR +FFBFBFFRRL +BBFFFFBLRL +FFBBFFFRLR +BFBBFFBLRR +BBFBFBFRLL +FBFFFFBRLR +BBFFBBFLLR +FBBFFBBLRL +BFFFFFBRRL +BFBBFBFLRL +BBFFBFBRLR +BFFFFBFLRR +BFBFBFBLRL +FBFBFFFLRL +BFFFBBFLLR +BBFBFBBLRL +BFFFFBBLLL +BBFBFBBLLL +BFBBBBBRRL +FBFFBBFLLR +FFBFFBBLRR +FFBBFBFRRL +FBFBBBFLRR +FBFBBFFLLR +FFBBBBBRLR +FBFBBBFLLL +FBBFBBFRRR +FBBFBBBLLL +BFBFFBFLRL +FBFBFFBRLL +BFBFBFFLLR +FBBFFBFRLL +BFFBBBFLLR +BFFFFBBRLR +BFFBBFBLLL +BFFFFBFRLL +FFBFBBFRLR +BFFFBBBLLL +FBFBFBFLLL +BFBBBBBRLR +BFBBBFBLRR +FBBBFBFLLL +FBFFBBFRLR +BBFFBBBRLR +FFBFBBFRRL +BFBFBBFRLR +FBFFFFFLRR +BBFFFBFLRR +FBBFBFFRLR +BFBBFFFLRL +FBFBBFBLLR +BFFBBBFLRL +BFFBBBFLLL +BFBBFFFRLR +FBFFBBBRRL +BFFFBFBLRL +FBBBBBFRLL +BFFBBBBLRL +FBBFFFBRLL +FBBFBFFRLL +FBBFFBFLRR +FFBFBBBLLL +FFBFBBBLRR +BFBFFFBLLL +FFBFFFBLRR +FBFBBFBRLR +FBFBBBFRRR +FFFBFBFRLL +FBFFFBFRLL +BBFFBFBRLL +FFFBBBBRRL +FBFBFBBLLR +BBFFBBBLLL +FBBBBBFLLR +BFBFFFFRRR +FBBBBFFLLR +BFBBBBFLRR +BFBFFFBLRR +BFFFBBFRRR +FFFBBFBLLR +BFBBBBFRLL +BBFBFBFRRL +BBFBFFFLLL +FBFBFBFRLL +FBFBFFBLRR +BFBFBFBRRL +BFBBFFBRLL +BBFBFFBRLL +BFBBFBBRRR +FFBBBBFLRR +BBFFFBBLLL +FBBBFBBLLL +FFBBBFBLRR +BFBFBFFRLR +BBFBFBBLLR +BFBFFBFLLL +FBFBBFFRLL +FBFBFBFLRL +FBBFFFBLRR +BFBFFBBRRL +FFBFBFFLLR +FFBBFFBLLR +FFFBBBFRRR +BFFBFBBRRR +FFFBBBBLRL +FBBBBBBLRR +FBBBFBFLRR +FFBBBBFRRR +FFBFFBFLLL +BBFFBBFRLR +FBFFFFFRRR +FBBBFFFLRL +BFFBFFBRLR +FBFFFBFRRL +BBFFFFFLLL +FFBBFBFLLL +BFFBFFBRLL +FFBBFFBLLL +BBFFFBFLLR +FBBFBFBLLL +BFFFFFBRRR +BFBFBBBLRL +FBBFFBBRLL +BFFBFFFRLL +BFFBFFFLRR +BFFBBBFRLL +FBFBBFFLLL +FBFBFBFRRL +BFBBFBBLLR +FBFBBBBLRL +BFFFBFBRLR +FFFBFBFRRL +BBFBBFFLLR +FBBFBFFLRL +FFBBBBBLRR +FBBBBFBRLL +BBFBFBFRLR +BFBBBBBLLL +FBBBFBBLLR +FFFBBFFRLL +FFFBFBBRLL +FFBFFBFLLR +BBFFFFFRRR +BBFFBFFLRL +FBFFFFBRRR +BFBFFFBLRL +BBFFBFBLRR +FFBBBFBRRL +FBFFBFBLRL +FBBFBFBRLR +BFBFBFFRRL +BFFFBFBRRL +BFFFBFFRLR +BBFBFBFLRL +FBBFBFFRRL +BFBBFBBRRL +BFFFFBFLLL +FBBFBBBLRR +BFBFFFFLLL +FFBBBBBLRL +BFBFFBBLLR +FBFBFBFLLR +FFBFFFBRLR +FBBFFFFRRR diff --git a/aoc2020/6.hs b/aoc2020/6.hs new file mode 100644 index 0000000..edead42 --- /dev/null +++ b/aoc2020/6.hs @@ -0,0 +1,12 @@ +import Data.List +import Data.List.Split + +readlines :: FilePath -> IO [String] +readlines = fmap (splitOn "\n\n" . init) . readFile + +solution2 :: [[String]] -> Int +solution2 = sum . (map $ length . foldr1 intersect) + +main = do + input <- readlines "6.txt" + print (solution2 $ map (splitOn "\n") input) diff --git a/aoc2020/6.py b/aoc2020/6.py new file mode 100644 index 0000000..fb56ce7 --- /dev/null +++ b/aoc2020/6.py @@ -0,0 +1,15 @@ +with open("6.txt") as f: + data = f.read().split("\n\n") + def process(lines): + return len(set("".join(lines.split("\n")))) + print(sum(map(process, data))) + +from functools import reduce +with open("6.txt") as f: + data = f.read().split("\n\n") + def process(lines): + lines = lines.strip() + letters = reduce(set.intersection, map(set, map(list, lines.split("\n")))) + print(repr(lines), letters) + return len(letters) + print(sum(map(process, data))) diff --git a/aoc2020/6.txt b/aoc2020/6.txt new file mode 100644 index 0000000..d006a65 --- /dev/null +++ b/aoc2020/6.txt @@ -0,0 +1,2239 @@ +qzbw +qez + +xgedfibnyuhqsrazlwtpocj +fxgpoqijdzybletckwaunsr +pwnqsizrfcbyljexgouatd +ljtperqsodghnufiycxwabz + +uk +kupacjlriv +dku +qunk + +yjnprofmcuhdlawt +frmhulyncvweatodzjp +fhadtrcyjzwlnpumo +hrcutablndyjpfmwo + +rdclv +lrvdc +crldv +dvrcl +vrlcd + +dqrwajpb +asrfpdjwbq +wjdtarq + +nalkhgoi +bmiad +sdvpiyerma +ami + +smg +wlmdftcr +mk +my + +ebaxsun +uaxnebs +suxnbea +eanxusb +aexusnb + +zoxegrfd +qorjv +oqr +vor +roq + +jpasdnrcvhglft +dgkstavnhjrclfx +crtndjglfvwahq +hjclinvdtagrkf +gjfcdtuhlanvr + +exiopqbgrj +undhwyfkvltis + +npsxwlyog +udylki + +bnuwck +nuack + +cahpwtlozkm +ghnpzfqmoxabi + +hvwgxesraocbpnf +ewvranqcpbghoxf +paxfnwoegrhcvub +qbrawpfscexngvho +ahpxognlrvebwfc + +agqmwpvlb +waklrnbqyp +blquawtp +qltabwp + +rymhgolkustipjxbzqnafe +frzqjiuktbsxmahdepylg + +zricqdofygvtbsjmeu +vudjctzynegboiafqmrsx +rsbefoytcqgiuvzdjm +zucobitsgyjrfqemvd + +y +yc +tg +lavoqef +by + +fevykin +wxytrhqk + +pxbclzknowyq +lybwkpcoqxn +oknlpbxcyqw + +l +f +gixvd + +unogwsfavzkhi +siohufnkzgavw +ahitunswfvkzog +gvhknzuaisfow +ukasozfihnwgv + +ulhgwo +ghluo +ogulh +oughl +lphuog + +nike +bkn + +gefzwrdjsqx +fegzsjwxrpqh + +lfknweboxyrpajmig +gkpafnieojybrwl +iafesdyulrkpgnwbjo + +zjoiqtgpwxdach +iajdhqucpxtzgl + +yhav +vnshac +hcav +hvw +cyvh + +hwz +whz + +dhunracmzksvxopjgtbqi +vqhpowubyzirdksmgca + +ckrhefz +rkvexdfzcbh +heczkrf + +rbsldt +qgr + +a +ea +a + +wnadxkgehtpsv +gwnexkavshpd +bfkdpansvhewxg +kvtwdnsahpxge +xnhdpvekwgsa + +ydajvctr +drcejtgin + +kw +cbmj +l +t +n + +gyzlnp +zahsyu +rek + +vjdmhsorqw +whdjoqvrms +rhsjqdmov +omdsqjrzhv + +rcxsgnluhtqey +ldejuqpykrtc + +rylcqxt +wlgtzyrcf +yrltc +rclpyt + +frke +kfe + +nchvxtqarsejld +rkhntaexcbqljod +qhdepzrxljtifcan + +uyfshgxzbqvrdwintjlmec +oyrvdwtgeczsfbmluqih +kabdlqytwgfrhmuevczpsi + +guwmkrfyex +fxekmrygwu +wfgremukiyx +aywegkrmxufl +wukygimrxfe + +m +m +m +m +m + +hbgnkqe +khgn + +hngypzmd +oixyanpdg + +qbdklpvhjaeif +kzaiglyjfpmeurn + +ynsm +smjn +nsyum + +mpcztqkydxifv +zdqfvxtmpcyk +zkcmxfpqvydt +yopktfnqrmvxdczw +mdckxypvztqf + +va +bvhg + +fe +ef + +n +hpmqn +n +dn + +njxazhtevsmlir +txmsijvaezwn +tezacmwsvinxj + +gvzpbmeijyhaukflcrdqw +sivlhgumyzkdrjfeoxqtc + +ouq +h + +csxewy +kxoscmw +ucnvwsxg +hfocysxmiwe +wcsmx + +retcxugsdwjnykm +sfhudnxoqwjktyzarc +rklvinxudpsbywtjc + +cwfizpyguatbodsqemxrjknlv +ujikxwsmntcloyqgaebrzfdvp +jreyubofkpdnzsimxwvgaqtlc +nuewfvmlidsatzqbkcjgorpyx + +ycqolubpktxwshegafvm +djnlhafsreuzgxkb + +odasxjtqcepgrzl +jsoelxpqgtczam +qiajrhesdzoxfplcgt + +vnthkurzf +bnfpqutvekra + +gujxqsnitohp +tchxqjgoiu + +hgparlm +mjxghlqzp +fmlpahcg + +deptkcyasiwgfonv +ptqufxjhcyglrzdov + +awnxeshvrbcjm +xreswnhbcmvja +axvwnsejrmbhc +xajcmrnevhwbs +sjxhcbearmwnv + +woystmzcbgrljqhxdiukn +mzhlbgcwjusnortdqky +tunrjlzmqosygbwhkcd + +agh +ahg +agh +hga +hag + +cmzkthbquilgwypreno +tsmezpqlwkhrcginuo +gmniotwlpzyqceukrh +wztuikrglhqocnpme +ekqchwogpliumrtzn + +jqadntioypevlwcksmb +hymnfzcvtdaxsekrqijo +dvqmgiacknyoesjt + +cdnbkfzev +bfvdwcezk +kzeblcdvf +vfdkneczb +fdeovjczystkib + +rzc +pma +zwvx +zyrlt + +lmwvudafhnczxibsgpjkreoq +durlgqhmvpxofsiejwcbkzan +mieraklxftswzjbuocndvpqghy + +qlaxkbf +rfhyxtbkseaq +bxkqaf +fkxbaqn + +lpntzrufvskoqciaxhedw +arsztnpofkxcqudilhewv +srvlzcujywkenimafhtoqxp + +snxwjqapfo +nwsfqxpajo +npfqjowaxs +opjfxanwqs +sjaonwxqpf + +cswjquxv +uyecrkg +ufjcl + +qjvzl +jvqzl +lzjqv +qlvjz + +h +h + +mprvotcsgadybjfkqehz +bjsordtucqlgkhfzvepy +fsoqijpvhgkczybrted +yzsgkfhvcbjpeqtrdo +cjzdvkprbheysmofgqt + +jzontimefb +ldorvefxuatpj + +i +xi + +zhtkdvl +pchznv +jmryxuwgazvfh +lkdevczh + +subt +utsb +fsuobt +jutsb +utbjs + +n +n +n +dnk + +qkrfv +fqgvkseut +qvrfk + +w +x +n +n + +mkpoyfrngtwdcjlv +yprcuimjsz +rcyjzxphm +pjecrmyx +ipyramcqj + +puwnzsohkv +nsohwkuzvp +upnhokswvzx + +rmvjwzhx +kpxhqevglom +mzxfhbv +mhwjitfrvnx +mcusxhvwj + +vipkgth +oskhetgp +zlqhnbdjwgurxapc + +vn +vna +gwvdn + +rugcbipvzow +uogrzcvpbwi + +jwxuc +krngvmypl +jwxzi +qashtbedfco + +bzfyl +yzflb +fylbz +lyfzb +ylfbz + +uhkvb +kjhulb +vbkhu + +andlzobvguqsk +nkgvqlzbu +klbiezughvmxnrt +bunkzgljvf +yvkgjpwzubln + +t +t + +bdrjpavtiqlhxuw +pjmzbxidrtulcfw + +wqylp +mrhgfxsjcaltonedv +ywbkul +ikl + +hxpivszmbaodecnlurq +cedlpnibqmwxaghrszou +hunbrdzpsxleaitmqyco + +pymewobv +veazgoy +yvoxle +youfveix +syegdvo + +ogceirlsaqjtmvzdx +rtsaijxocelmzgdvq +dvrqjxizmgscteoal + +jeupkmhcydwaz +daykzechjpwmu +umkaejhwydpzc +aywkjphdzeucm +ypdchmujekazw + +suzacvgjnoi +evgsufjaitn +rqeanjskxbvfgiwu +dknubsaxgvji + +ojxfyetcpdbglmwqunrsi +fjletcbrdsnviogpxwuq +jcgprswxiaefdqnotlub +zfgjewrpldsioxcqntub +nxcgewpqolibrktujsfd + +vwh +hjvw +hvjw +hvwr +vhw + +md +m +m +m + +xkpu +izfmrosjbd +eywqt +xgak +hgn + +layhskgxrpfnwqmdj +mlsxywoakrectnzgqdjf +fbsxnmuikqwrljgv + +rhcn +lon +dln +pban +nhd + +uxwhl +hx + +aesduycrgfmhjblnkzt +jktlhwqioepzgcbnmda + +tbhfongxiudcrv +rqoyfnuxabjekl + +ajd +wjdmak +jda +jad + +ghimtjly +hjtgilm +ghixmjtpal +jtmhilg +imhgtjluo + +ewpfam +epmwa +epwma +ewamp + +cslywuzkdg +jfluyxgbsma +ugysbl +ytlqgaus +hsufgloxyr + +eigjpobrlxnasvhquwy +nirbjslgwyxuoaqevhp +fpnsuxbleoajwyhgirvq +ayinxhubgvweprqljso + +andu +sguand + +embqxktgpduyjia +qtjagiydempukxb +axswpjdgqbumyteik +kgaexydbupqtjmi +uqjbixkdptgmeya + +uxzwnlgyareost +nesygtowzuralx +lnguxsaoyzwtre + +thfobmluspeiwxygv +ibtfgsyouvxdpelh +txqerhuolbpsgfyvi +oehxfsmbiuvpyltg +pfoiuhlebvyxwdgst + +e +ke +e +e + +zhxyc +hczxy +ohzycx + +sylzvbx +sxzvlyb +vltysxbz +ylbxzsvf + +zxkt +xztk + +mnctogxvwkseh +owrsadeqmhtykcg +matkscwo +mcwpzbofs + +wvpybgulfrhnixjka +rgawyujfcsveki + +hbmljqxrtza +xmutqzahl +zaqlmhxtu +hziqlatxumc + +sjwq +qjws +wqjs +jqsw + +ithgcoaed +qtgsdohec + +puidogmhysnk +pgszdunhyiomk +gmyivhnksqodpt + +ionrt +yhvsiud + +xtzrljypsknh +jkhztpylxnrs +yxlkrshtpnjz + +veyflgkws +jwukvfeshmr +evfwksdz +fekvsw +vkfsew + +qbercltdyiwzpfghujxa +bvzlratfchxyijqewpdgu +hfrtqbiayzdxpwujlcge +ejhbpuwytgixrdzaflqc +phrjagczeiyxwdufltbq + +chxzbkemyjgqvltsardoi +osykewcidjtuvzpbqhg +ibqozcsvygmkedfjhtn + +czgih +zcg + +dpulzxtweoafsvnrykqg +zoasklutxwnqevyfgrd +vnrequfolxgtzsdawyk +ynurtkjfogvdqzlewsax +kuydfznpatgvrelxoqws + +fmpeunzs +sumpfzn +fzpmnus + +sadewmz +sldnwe +wjduetyxsh + +no +ou +oua +ybwdoe + +etjdmfhkvupsgob +zjvatuxrhomingds + +wcrpzale +ctyzwdsulbvmexo +ikecwnzlg +ngjwczlae +zlqhwgecj + +p +p +p +v + +x +i +p +x +bgckq + +huty +yatu +cytrqju +wtyu + +k +k +s + +ti +ut +ut + +ltyxj +vaicrwnzb +yegjqp +mjogk + +ifyupadt +idutaypf + +civyufabow +oafw +eawtof + +tdxrcuvqmaoblhsjfynpwigkze +hqfymskzljrtexwugbnacpiov +nymlpweztcgrhjqfuiasbkxvo +qxcponmlbwtvazuykfsegjrih +vuaoelhfcyztjpxingmbkqsrw + +zqtkcomfdyrs +qokdtmzyawfrlc +qdmzejfctykor + +qgkmhvx +vnqmkxlh +kqvhxmre + +aklnbydq +dqynjokaebzlu +kblqrdany + +znaepc +uthvilcm +cpbda + +cep +wgecdbpz +pce +pce + +qgtaelxzvnfr +vwlquxfbmhgdjzir +fqvryplogztx +krfvglqszx + +xebsp +vohgfurnmsa +dqws +ysl +eqyps + +fxnlgkjizbsupyt +aixlkfuwezbgcpsnh + +fliogmexzuqc +ygxqvoeklitmfu +iofxzueqmgl +qouifehxalmg +oefiuqjgdmplx + +cjqnrvu +cquvrn +vqnur +qvrnu +qwsvruxnmf + +esxbjiwnya +ibwnjsxyae +abienjwys +ijwaybnsep +ybeiasjnw + +f +f +f +f +j + +dwfgkqohamebnzly +vhyokaeqpufjdlb +ayhlqfbnoedkg + +g +ijur +ad + +oxpwmzunkjved +dgwxejtpzn +exnrwizdpljhfy +ekzxwdjnpt + +jghbztdkypsovc +arefyzdnlhwpoivbsqj + +cwvpyqnhjmsblikorx +ywjmvfxnbqoitdls +gyuloqbznavmijsxw + +tv +vt +vt + +cxvwzdbpsqnhoa +thoqpsvmaxcbkzlin +anecpvqohsxzb +xscpvobnaqhz + +axnrzgyvepoif +zovgfipynhr +grodvzhinfpy +rnipgfojyhvz + +pbmhlxwqfezrscdtykn +cfmbkwtnlryzqehxpsd +qrbylwtdnsckzefxhmp + +zkqw +wzkq +jqwxzk + +vrdnmyfspbzlxw +izepalkytdnfcxjwhg +nxuwdfqzlyp + +bc +cb + +bf +fb +bfh +efbq + +amw +mpa +maw + +bqwtvl +vlzwtq +ytlqv +zvlqtb +tlqxvc + +lbhxpnkiurmwates +fuwrqbeztjmlpsnxaik + +jpwm +zwljp +jwmp + +zep +cep +pe + +mzx +zmx +xzbck + +dlmvbnupathgjsf +blknfsvtjpgmhdu +pnufdgmhsqtbljv +ijeoufmnchvysrlwzpgtdb +xvpudhgsjmlnbtkf + +cnyuhkmbswzilxovjp +ybjtdewvsrfcznalqhgiku + +bi +rzla +j + +graezckvnqx +agwzkcqnxre +grzxeckaqn +ghercxazknq +rzqakdgexcns + +sfe +b +f +xpjtuand +boies + +kgjfzqlwic +rkcdstgp + +fgsndtox +zodnyxlgts +otxdsgn +nxtfgodis + +zwrtohqdey +teqwry +pvytwegf +ltioweyrc +myeaxntuw + +bw +bw +bw +bw +fbw + +o +gh + +owadmhy +admhoyw +wmohyda + +nywib +ceulqpzh + +zs +sz +zs +zsko +szr + +izaqf +uijrf +infgq + +w +qw +m +bzr +o + +emavls +hbxwektuqjo + +qrhspwbulzkaxdm +auwbhyxlkdvq + +turdsw +utxrwsd +rtundsw +usdtrjwo +utdowrs + +gjro +gojm + +xhnilqdp +ienxaovqldkhg + +rgjonh +nvokcjqrt +argnjo + +jmgchqb +jivdabluqf + +ylmicxtahwqfvukneopgzsbrdj +hbzpeaqvlxgotsjkwmfndyiruc + +p +rop + +delgcpurwxniqohkvyas +gurxclnvdwbikoqezs +rnxewiqvgktmosfjd + +tigwskmhvupobfnydxcre +qwmdoycrhvsjptzxngbikue +yvmetfcbahuklxpdgowrisn + +wsy +wys +syjw +wys +yws + +srwpt +wtsrp + +lhafkqwscv +aklhcvrsqfw +vfsqckalwh +hlnqskcfvwa +klfwvzsdpacmhq + +ehbzglfvtdxpkicy +dl +jnmdl +wdsl + +rew +rek +ehi +ilehwkm +axe + +bl +hzlgey + +iboqgtdxprunz +uonzipxrgqbtd + +o +o + +bldk +bkpl +fklbc + +ynmuedqwhoktxprcavz +fshlwuznoymekqtprdv + +hjtwrzo +rowhztj +wuxrojhzt +ozjhrtw +hotzwjr + +senxaq +baen +ajmne +gaielnd +htfnpkuvwoae + +joklzmcuyg +uyzrifcmlkgsj +kyoumjcagblz +uytcgqklzjm + +ujvi +ijuv +epmijuv +viju + +tahxdeq +dazexot +baelxdq +pwexdgvyiukjcaf +edrnamzx + +zxqslwyh +shgyqlwxaz + +xbs +xbs +bsx + +kwlhvxy +kqwvlyxh +klvxwyqh +hxlkwvyq +kylwpvhxd + +koznivas +basiozvkn +ovzkluniash +ksnxcavioz + +g +g +g +g +shin + +e +qtvo +ac +ksw +ae + +pay +nau +a + +czkmwrvefultigxjhdqaopsnby +flqrbdxungowzkmjsyepvhitca + +ymw +vurft + +wqpgys +ywsq +qswy +qsyew +ywsq + +ndmo +fdoznkmw +hmuzndo +mtqdrnyo +uwfomnd + +pktnzsqhyvmaejclwuor +jwznystlkmqcraeovhup +vuwmteknjqohylazsrcp + +k +k +k +okxe + +fjilbxs +ib +bi +iqb +ibeq + +gjlyop +opglehyztj +jpclgymno +dopglymwj +gojplrbcy + +nuygowpxetsahrv +jgtpyhruwonexq +rlepnuikhgybxwot +svnygeuroxhzptqw + +wkies +eisqwk +kisew +eiwks +gxbkwsiep + +oj +joe +oj +jo +oj + +gtzunomec +cezutnko +tunzeco +cuoftneazk + +vpifjqnbcuaelxzgdwos +gfsyuwzclexopjvimqabd + +npaxeizolfrygctvw +rgtpxwicvafozenl + +e +e +p +t +e + +ohiaqmdktxnbpwlc +iqcopmavhwxbgnl +bhqaoiwxlpmcnzy +oxhwifeapuncblrmq + +wghbsijofevcu +qtlmkday +xlrznmp + +zbrjh +rzbjh +vebhzr +klrzhb +rjbhznl + +kcgzmvfrxebiautyohdwq +thdkgwzymrafbxecqiovus +rgtwzvocydiafmkqubehx + +i +ry +n +xgscp + +kzjngd +rdmwgnujzok + +djpivm +mdipjv +mlvdjip + +ilbdjmvfhyzxcqwuspn +lichmuxnzpqsyvwbfj +umnvlbiwqsfchxpzyj +uylzhpvfqbscijxmwn +clwjnihuyzpmqbxsfv + +o +o +fo +pon + +aowpk +zg +dt +uc +u + +ymhiouqp +lkyoqi +ywtsvqio +lnmyoiq + +ydbhigntrexvkua +urlaigkqnydwxhb + +nfro +z +jz + +ojsag +gajso +gjsao +jhsog + +t +t +y +h + +jieqmryxv +xqvimey +umyqveix +vtedmnxliqyf + +tmd +tdm +dtm +mkdt +hmdt + +px +gwruq +pz + +tejofhqklimp +thojpkfgelwmrq + +tseirdkyqvcghwju +tjhycvgilezdws + +roqbndl +rdql +qlrd +lqremd + +qvgunystzpckrwifmxdolajehb +bgtixcwloydzqjskvnfmpeurah + +soviern +rlakxngecptvsz +nvdsre + +gzkoiysxl +vjrlmtpbsceozhauwx +kfnqdzolsx + +kwzaqnipgxfhoy +hanwlofgqxpzk +xqngazkwphof +pqwkfghaoxzn +qwnfgpakxhzo + +zhurktfoqmlbnx +mhlxorzbntufqk +qbzklhnurmotfx + +gezmci +oecmg + +pcyteovnsz +dptlfuzh + +roxjhkng +xonksrad +rxnikos + +vbgmsrecxpj +srcjxmbgep +rbgsxcepjkmq +pjgcmzbsrxe + +gkvwndflryjshmbqxtpizuocea +fwndvekqtzployghijsmruabx + +dcxtogbifek +ifkdgoxbc + +srmqlnhbwv +liwsqzvtn +wgeoqvpfs +wkyqvsacd + +yswarofhdmqclxkgut +daxhzkgumjysrlwq +qfamswzyiglxdruhk +vsnwxadlhrbgqmuyk + +rxwzkmd +kwzx +qawokzlxe +xmdnfkwz + +exo +xvqod +cv +pnrkmywh +uztea + +ma +ma +qamfr +am + +nksp +kvpn +pkn +nkvp +nkp + +pwlvdsagy +islyawu + +sgbnwulekhpmy +mjgqeyshpbwuln +yubghpanecmszwlv +euwohbysqngptlmx + +gs +e +kas +a +md + +i +x +bl + +vishqyrzgmpbeuldj +gwcpvnskbftudyorj + +ueswlatkopc +wbeosclpktau +lcpvaswokuet +ltkupsmeawoc + +iwtvopbgyc +widjykopv +ivowyp +iwyvhop + +bfnwdumyozhpxre +zhweumdnpbofy +dcsobyuhfntpmzwe + +zrlaspbhty +oyhrftzbslap +ysztbhlapr +tszhpbayrl + +wbgxh +gnhwxcb +wxbhg +gxhwb +gxbwh + +ngribvdawujskcmfx +rvskbgiwjxuca +wiyvgcsbjxkrua + +ifstrq +fk + +b +b +b +u + +hpqy +wjplyq + +zwkfgbsmedluyot +fdtrhsgeumk +vexgtudkshfim +eutigskmdrf + +imljkdnzpx +jqwknpxlhmzd +pmdyxgnjklz +rxbjmlnkzdpg +ulxbmpdnzykj + +vetubnwdy +bnwatdvyou +zfwgvtdbnki +dlvewatnb + +uj +otuj +uj + +ifstpgrbcnywaxmkdzoqvh +qkbfhovrginxapzywdct +vyofbwcdginrkqtazhxp + +mvnaokugdshybwtr +ntvsywuadrkmohgb + +fauo +pnofxadk +sfoa +sofa + +akecpnjdwrztvlfbuhsiq +jehrndzisqcauwlftkbpv +uawiskrjentfbcqlpdvhz +crtpjbdalsviwfnhqezuk +ncawkfdsqtrhpjzielvub + +otazsfhc +ltkacysow +pvtomna +tacok + +mx +x +x +x +x + +hmoy +zmyhjuo +ypmxohn +hoxym + +dm +md +dm +md + +uqvbhfdomlwtkxez +szaqwmlhytgvxkr +wmpzhxqktlv + +btkpdjinsrmogfywzhlvecau +idylbvnopjsgrkfheuczawtm +tygvsizrwjneplkohcmafudb +wtvprskenjchmiyfuzglodba +jwdafzcemrbsunotyglpihkv + +e +ouxg +ei +shp + +ul +ul +ulrspe +louy +uynlvo + +yibgqkf +uvcwx +mvxdohjlw + +q +z +z + +orxgfiqznujyplsbadv +gtzieoxspqrvndjbylfu + +hmlqcujrysbgoentdp +dyjmrbtpuhgslncw +rmyfuhdgclnpsktjb +ptucnyhsmlwrbgjd +wrhnldscjeyupmtgb + +sowieczubgx +firsgewzpbo + +txeo +exot +oext +oxte +otxe + +ontlbzyekruhpscwqvaxmdj +ahrtijxdepnokymcsgwuf + +ftsraxmwogvnkdbzqiyhju +ylsdhonjzrfwmqukc + +leiupzardbfsv +dzuwlesifrbp +ldiupzersfb +fupwslrzbedi + +jtdp +dajg + +jpglzoriafexks +gpaozketlcixs + +butisvecnfplqmygworax +jrhpbwztcveifamlyqxdung + +r +r +r +zr + +eyniaztvgdrl +dalgonxbiecywthzvr +dtzrgenvliya + +akzferolcmstgby +kmcagsbteyrlfzo +aoktgslmcrzbfye + +jqigpeydwl +mkeaxqcudzgvfhb + +ayhgbfzerjxd +rnzfaxy +wyzaxnrf +ycazxfrw +ayzxrf + +jgmkwtnizxrcbvfqhyeal +mwatrngvlezckqfiybhjx +vmrwyqnigzhtjfckxaeb +wkehnqrtcjigzxavbfym +vrczmohgtfbnaejxqiwyk + +c +c +c +c + +idx +id +id + +zaipnjbsxkg +xevnfipkjgb +ujxldqcnbhi + +hco +co + +ztlrica +ktneixcrs + +hlutcdsgoj +mwlypnzbqafvxkire + +lznhjwgsiv +wricunaxj + +fdqgyzopwlen +rkvt + +vy +gy + +ihbpfsx +pshixfb +sifxhpb + +begmqirvflkxuyanp +dmpvhfbnaxsuloqitjy + +uwamykhsnbfzxielpdo +cxzswhvtabupmqjlekond + +gisqpjrubx +rjbiuqxspg +gqpirxbsju + +u +u +v +u + +gnjqsoha +qgandhlyrs +snhqvlrabg + +vo +vo +ov +vo + +iudvwxpmtac +owlyxsangim +hbdrxmwaei +wjimax + +xmubte +yuogxa + +nwkurtxjcpqozmhgsvbe +chrmvakuyxtowqpgzbej + +manbesvzpyt +dgtwazpqjmbnr +itfkoupbhlcnax + +omhinsxf +lnmdoix +eimgrno +hyomidn +nmjodi + +qmpn +ripmn + +wfm +wmf +mwf +mfw +fwm + +uaoxphg +phoxb + +btfprm +ztmrf +mrft +ramft +tmrezfa + +uaznory +zyaiourn +nouryaz +coszugmanyr +lqazryonu + +vqlswifmcg +wzuclnxsvt + +eh +eh +he + +siuhfpb +iuhfs + +yfhciqlnwpgemoxktas +ticjauwfsygepqnhx + +ndmhwtub +zbagktxiulnwh + +txdikm +boldxtiqmf +dxtimj + +wvr +vwrb +wrv + +utyjachpfordvw +benvkudcfta +vduqiftcgsa +fcuatdxv + +doivj +jiv +vjkpyi +jvi +dijv + +mhyn +mxngywh +yjhmn +dmynhulkacb + +hpidlbezkwqtr +dgtaflrnyscm + +osqeajcvduwhzrtkl +zcaevujrqsdolgwkyt +uokqnrdjaecvwtlzs + +ovsbxzgaju +vliydjht +dvjt + +stlxuabmcwqkodevrhf +ajskvtpmlicqewbhuzfd + +g +cg +ezfo + +zqfmuxlnhkgdpvwrtjio +rkjqvomtguhpiwfzxnld +zfgxrclnimokhvpjdutwq +tgkxfqrnhdzowpvijlmu + +ni +qn +nq + +sn +qn +fdn +qn +hson + +tplicyhxqfujbkzv +qfbzvwkuycsa +vzqnbfcokyuda + +apoy +plfxotkv +iphsqjorged + +ravyhbsfelgcmzponqwikj +bitfjzwakhmvxngsoepcyrlq +cevpwyrnlobjsfziagkhmq +mswnezcpklfrjqgiyovabdh +cijelkwpbnhrsmzofygavq + +sqvnuedcytaxohplzf +cekhbgwadpmyofslxq + +gclfnxakjzsw +wzjcnsgka +ciwzsganjk +aspicokjgnwz + +qrabg +ajbgmw +yabg +vgsrba +hcgtbya + +xarbuvi +ivaku +kiuav +vzgxiah +flsivaj + +ckodrthljgyfwm +mgytohfxnrdkjbvlwc +cfdwmjoltkshrgy +yhwmrldfucogkjt +fmctpgwydhkajlro + +qvibocelnsdyzfkjhpuxmtrg +zgdksnoypqebifltcrjvuxmh +giocmuefxsprhdjkzntvqlyb + +xkcrlwomygs +grluckhsanomxwf +sriokwlmcyxg +kxgirswtcvlom + +budr +brdu +dibur +urbd + +o +o + +p +p +p +p + +wnydf +wrptghizjqk + +wnbdmltxcq +dfcwl + +ksaveflzdxqocbgyjp +bcxavldgysqozpkjfe +ozpvselaqgbdycjxfk +clpzdoebvqjgaskxfy +qykodlgvzjaxspfceb + +nrmdjstqozklxvcyag +ejzwbu + +kfgijmd +zmgjdikf +jgimfdk +ijfgkmdz +smbrfkxdwgeij + +yhtuxnfcq +tcyufhnxq +hfuxytcqn +nqtufyxch + +rlhzknoiuycefpmvxqbg +nbvgfexmqikpyhruo +hqkgnvyieomubfxpr + +bjyadnftcsxqk +lpfbvzcsumerho +wctsbf + +iyamec +myeibctka +egyicam + +ac +pvaqdb +a +au + +giltsum +ixyhncbjqped + +cinzuvkystgfodr +rksphwcfxdgey +xrdjkygcsfq +bfmdecpysrkg +gcrdyslfk + +ayqpgucwedftoxjk +eoagwdtkfqlypjuc + +ktysxp +sptx +qpxst +ptsqx + +uvclismeajkpbzgqwn +aicbqfzvlnuegpm +glecvmpzrnioudaq +kanmveflzpcgyuqi + +vklag +glv +lvg +lgv +vgl + +tyuh +hut +thu +htu +thu + +eyipwtfuhxzalmdgrs +whfcvbquxgepn + +tg +ge +g + +vk +uatvn +mzv + +jhfmpux +mhjquxkp + +gzyxjwfb +grzfxmwybj +cywfjpxztgb + +udrye +eqdyr +yerd +eryd + +kwdoynribhpsqmlgvuje +gunbjywvmheirdqpok +dnqeivoptrkwuyjhmg + +czvmpr +sxpum + +qlktsn +tkclq +sbqlkwt +luetjiqpk +lcvtqsk + +rotvsfwelbnj +fwbqmaolesn +qbfwegzislpnoc +nzoelswfpab + +wsecbml +sclabmwe +ezpsidclwtmbgvr +mcelawsb + +ngz +zg +gz +zg +gz + +xqjwnaiyb +jayxibqngw +qinjwxbay +nbaiwyxqj +jniaxqwyb + +hktywl +htwlyk +kytwlh + +ymbeahldgz +pjaoszx + +b +b +bz +kb + +gvdcqp +qpvyrcdlk + +nij +jfiub +jtieyxl +mnij +imvju + +qh +hq +hq +hq + +tez +zet +etz +etz + +wz +wz + +xc +jvxc +xpzc +rgumxc +xc + +nizsgkvylw +ngylivwzks +ylgsiznvkw +ilgyvsankzw +ilzywsnkgv + +emhpiwfyung +qlzkob +ldjx +xvat + +luzfaswdyj +jsdyuzlafw +ljdsafzuwy +yusdjwzfal +dsyjwuzafl + +uioafnlegsvjdxphr +lnfrjdpehvsxguoa +najruefdlxogvhsp + +gumjphl +mplchdjuw +hmjrlup +jmpgulh + +q +q +q +q +q + +feyimktsugrq +qygsrtlpmfkeui +sfkmrgqyitue + +xpklzsyodcnhrjq +xcznojsdpqhrlky + +btmsc +mtscbv +csmtb +tmbcsx +mbxtsc + +dvrfumay +ymafr +mrifya +ykrmaf + +do +d +andk +dcp +d + +glhmjykfaznvrd +bvmijshzga +vmjuqazhgpx +voczhgamj +wjhizgqavms + +voilgtup + +vrphtmc +bgfkjvad + +bxkfi +kixbf +xfkbi +xfikb +xfkbi + +lfixvpozghcauk +plgixmzukcovh +hyruilocxgkztqv +uglxkaihcozv + +avgptdmi +gydpvt +dptawvu +rvtdopxlqs + +rsmglpt +gpmnlthr + +tqmeukoia +kamiout +mqwauekov +macoryuk +nujbskgapmlo + +ndjrglykwoi +jrwkdnolygi +ownkidlryjg + +kwheact +txukwjcgbhar +whgotjk +kzhtw +lmvynhptdqkifw + +odkzwylprhvn +pwozvnydrh +zdhnpryowv + +crni +qdnkiou +gbwhyasjx + +bxitsamogcq +erbxklyhvtczu + +swrfxdpjhly +pwdjkvfyxrshl +sxehqrtwpdamnyjzolbui +gpdryslhwxcj + +fhldcksrpyi +qfejshrcat +wsmrvcnogxh + +vwacyofjtilrxngp +otylvxpfwgcnjria +xojfignyrtlpwvca + +qvz +ozm + +msrdwqahutefvxy +rjmyotiefuh +ltyrmenbzjuhf +felbyputmhr + +riyzo +kzroyuwi +yirozp +yoirz +roiyz + +rqjz +vjrq +qrj +prqj +zqjr + +vdx +xvd +xdvu +vdx + +xeauhryviqg +wpxkufzsjmctlnybd + +hbzwdlno +tmrj +np +lqfx +kuygescvia + +iqph +ihpq +pqhi +ihqp +qpih + +lsfwxmpkgqzvhecoay +gqfszwakhvymptcexol +cpaxwlzkfqvhsgemyo +lghfwvcmzxpokeysaq + +tgmpafqbuds +hspdfabuqgctm +tpcubdaqsvgm +mxqbktspoaujd + +xktgfvyprhndme +vntmyskfegprid +dsvpfmnkygtre +ydmvpkfretng + +npvgjzuo +mwlackhs + +gyj +myk + +w +w +w +k +w + +sgrhv +rixdgjluf +rgs +rsbg + +kmiqobutwplfryxgeajhnz +ylrtmpauodjnfvwgeixqz +extlfwjsirnmgyuqaopz + +vdngfjbwypio +sukyvfzpeqwthdxg +fyvrndgbwp +ydwfvglp + +fhsi +hsbif + +fihzecojaqm +jzchuomvwsqfr +jzchoqtfm + +kqafdzcgphvbos +qbspzodfavhck +adfozhquktlcibspv +szhpfboagdcqkv + +tmeb +takbe + +ymrhgdo +ypgzhmltd +fdbymgshcx +nghyzldm + +bxgm +gmxb +mxgb +gxbm +xbmvg + +fep +lnp +trjim +dauy +fplk + +udhzexv +dhmezvx +qdxylbhvzw +zveduxcht + +wgvhaokesjirly +osrewigqfdyvzk +kupsxrimowgbe + +skzvhanpljbogdyxtiquw +xzgdwyjluhnbstopikaqv +pasixghzovnjylbwudqkt + +wj +wj +wkj +jw +wj + +nsmyxfhc +xcfymhsn +hxscmnyf +cfxsmnlyh + +jpblgmiyunazcfd +tabnyfmupclzgd +esyvuphfgwbknodzcxlqa + +xkyqozefvgutmrw +rmhzwgeutoypx + +rzaxcemljnvo +kdwyqvohesitfb + +kfqrcezwn +qrnwkzcf +frcnqwzk +frnckvhzwq +kqzrcnfw + +fqux +qxuyfod +ufxq +qxfu +qxuf + +ztopdir +ritpozd +otrpizd +idpotzr + +jzhngmufw +zguwhfj + +ndxhmysbgcriqkewoztujva +cmtwbudvysekqaxizrojng +itncgkdyoaxswrqvmejzpbu +qyvcdusgwbomejtxznkira + +nik +yfi +i +i + +hpsdjo +hobps +ohsp +shpo +kypshio + +jbiyatwz +zbtagnrc +ztnagb +batz + +fvkurj +kfgjvru +jukfrv +kvfujr diff --git a/aoc2020/7.py b/aoc2020/7.py new file mode 100644 index 0000000..c3354e2 --- /dev/null +++ b/aoc2020/7.py @@ -0,0 +1,53 @@ +import queue +with open("7.txt") as f: + edges = dict() + edges2 = dict() + import re + pat = re.compile(""" + ^(.*)\ bags?\ contain\ + (?: + (?:no\ other\ bags) + | (?: (\d+)\ (.*)\ bags? (,\ (\d+)\ (.*)\ bags?)* ) + ) + .$ + """, flags=re.VERBOSE) + for line in f: + a, b = line.split("contain") + outer = a.strip().rstrip("bags").strip() + if outer not in edges2: + edges2[outer] = dict() + inner = b.strip().rstrip(".").split(", ") + # print(inner) + if inner == ["no other bags"]: continue + for n in inner: + num = int(re.match("^(\d+)\s.*", n).groups()[0]) + color = re.sub("^(\d+)\s", "", n) + color = re.sub("\sbags?$", "", color) + # print(color) + edges2[outer][color] = num + if color not in edges: + edges[color] = set() + edges[color].add(outer) + # print(edges) + found = set() + q = queue.Queue() + q.put("shiny gold") + while not q.empty(): + c = q.get() + r = edges.get(c, set()) + # print(c, r) + for c1 in r: + if c1 not in found: + q.put(c1) + found.add(c1) + print(len(found)) + + print(edges2) + def visit(color): + r = edges2.get(color, set()) + c = 1 + for col, n in r.items(): + c += n * visit(col) + # print(f"{color} contains {c} other bags") + return c + print(visit("shiny gold") - 1) diff --git a/aoc2020/7.txt b/aoc2020/7.txt new file mode 100644 index 0000000..d63893c --- /dev/null +++ b/aoc2020/7.txt @@ -0,0 +1,594 @@ +dull silver bags contain 2 striped magenta bags, 2 dark coral bags, 1 bright orange bag, 4 plaid blue bags. +dark plum bags contain 3 wavy teal bags. +wavy turquoise bags contain 3 bright salmon bags. +mirrored gold bags contain 3 wavy brown bags, 5 posh beige bags, 3 light crimson bags, 3 vibrant salmon bags. +drab green bags contain 4 dull white bags, 1 posh indigo bag. +faded lime bags contain 1 dim magenta bag, 1 wavy salmon bag, 4 dull purple bags. +mirrored blue bags contain 5 bright orange bags, 1 muted black bag, 2 muted brown bags, 2 vibrant gold bags. +faded crimson bags contain 4 wavy teal bags, 4 mirrored fuchsia bags, 3 plaid white bags. +faded magenta bags contain 2 clear orange bags, 5 dull green bags, 2 pale white bags. +pale red bags contain 5 shiny gold bags, 4 dull gold bags, 2 drab black bags. +dark coral bags contain 1 light turquoise bag. +faded chartreuse bags contain 4 shiny brown bags, 4 mirrored beige bags, 4 clear purple bags. +muted coral bags contain 4 pale coral bags, 4 plaid brown bags. +bright teal bags contain 5 striped blue bags, 4 faded orange bags, 2 faded crimson bags. +wavy green bags contain 5 dim chartreuse bags. +clear white bags contain 2 mirrored fuchsia bags. +clear aqua bags contain 1 faded beige bag. +vibrant yellow bags contain 5 posh brown bags. +pale lavender bags contain 1 striped beige bag, 2 striped cyan bags. +mirrored lime bags contain 3 bright orange bags. +faded tan bags contain 2 drab beige bags. +dark indigo bags contain 1 dark brown bag, 5 shiny beige bags, 1 vibrant indigo bag. +drab teal bags contain 2 vibrant fuchsia bags, 3 muted green bags, 5 dotted magenta bags, 2 shiny lavender bags. +shiny aqua bags contain 1 shiny gold bag, 4 clear white bags, 4 faded gold bags. +dull bronze bags contain 4 vibrant teal bags, 1 vibrant violet bag. +dark aqua bags contain 4 posh white bags. +dim coral bags contain 2 light yellow bags. +faded salmon bags contain 5 muted brown bags, 2 dotted red bags, 3 drab yellow bags, 4 dark red bags. +bright lavender bags contain 5 wavy maroon bags, 5 light brown bags, 5 bright silver bags, 1 dark gray bag. +mirrored cyan bags contain 4 dotted cyan bags, 5 striped orange bags, 1 vibrant gold bag. +drab aqua bags contain 3 striped black bags, 4 dark salmon bags, 1 drab white bag, 4 faded crimson bags. +striped purple bags contain 5 faded yellow bags, 2 faded brown bags. +drab fuchsia bags contain 4 vibrant violet bags, 5 mirrored yellow bags. +shiny red bags contain 3 faded cyan bags, 1 dull beige bag, 1 shiny blue bag, 5 dull cyan bags. +mirrored teal bags contain 4 clear brown bags, 5 light bronze bags, 3 light teal bags, 2 pale tomato bags. +dotted orange bags contain 3 dull white bags, 2 wavy blue bags. +dotted lavender bags contain 1 vibrant aqua bag, 4 shiny magenta bags, 3 dull plum bags. +pale crimson bags contain 4 muted cyan bags, 1 posh brown bag, 3 light magenta bags. +shiny black bags contain 4 vibrant chartreuse bags, 1 mirrored yellow bag, 3 posh brown bags, 5 vibrant violet bags. +clear bronze bags contain 5 dull violet bags, 3 pale plum bags. +striped lavender bags contain 1 dark plum bag, 2 striped yellow bags. +plaid indigo bags contain 2 plaid chartreuse bags. +shiny teal bags contain 4 wavy gray bags, 4 drab teal bags, 1 dark silver bag. +dull turquoise bags contain 1 wavy gray bag. +striped brown bags contain 1 striped olive bag, 1 wavy olive bag, 5 posh brown bags. +dotted magenta bags contain 4 drab silver bags, 3 light olive bags, 1 bright tan bag, 4 dull gold bags. +plaid yellow bags contain 5 drab black bags, 1 wavy lavender bag, 1 drab silver bag. +muted blue bags contain 5 posh aqua bags. +shiny olive bags contain 4 dark salmon bags, 1 faded gold bag, 3 drab chartreuse bags, 4 dotted yellow bags. +vibrant lime bags contain 4 shiny aqua bags, 1 bright maroon bag, 4 striped orange bags. +dim crimson bags contain 5 faded crimson bags. +vibrant gray bags contain 1 mirrored coral bag, 5 wavy beige bags, 3 drab turquoise bags. +posh chartreuse bags contain 3 light plum bags, 2 pale green bags, 5 drab white bags. +striped beige bags contain 5 dull red bags, 5 drab salmon bags, 3 vibrant salmon bags. +dotted tan bags contain 4 wavy crimson bags, 4 shiny orange bags, 1 drab turquoise bag. +vibrant aqua bags contain 1 vibrant gray bag, 5 light violet bags, 3 dim yellow bags. +faded turquoise bags contain 2 faded yellow bags, 4 mirrored coral bags. +mirrored purple bags contain 3 pale orange bags. +dim white bags contain 1 drab turquoise bag. +bright purple bags contain 5 muted chartreuse bags, 1 dotted yellow bag, 3 bright salmon bags. +drab red bags contain 1 mirrored magenta bag. +clear coral bags contain 4 drab black bags, 3 dark black bags. +mirrored orange bags contain 1 muted chartreuse bag. +wavy cyan bags contain 3 posh lime bags, 4 dark magenta bags, 4 vibrant turquoise bags. +pale magenta bags contain 4 vibrant turquoise bags, 3 clear gold bags. +posh gold bags contain 5 dotted lime bags, 5 wavy silver bags, 4 muted crimson bags, 1 dull yellow bag. +clear silver bags contain 1 drab indigo bag. +faded violet bags contain 2 mirrored bronze bags. +muted turquoise bags contain 2 plaid green bags, 2 light yellow bags, 4 dark violet bags. +striped bronze bags contain 4 striped white bags, 1 dim yellow bag, 5 clear aqua bags. +muted aqua bags contain 5 plaid green bags. +wavy teal bags contain no other bags. +pale black bags contain 5 dark salmon bags. +clear gold bags contain 2 plaid white bags, 5 drab coral bags, 5 pale coral bags. +muted chartreuse bags contain 5 faded crimson bags. +dotted fuchsia bags contain 1 plaid brown bag, 1 dark violet bag. +bright tomato bags contain 1 bright blue bag. +dim bronze bags contain 1 dotted green bag, 5 pale violet bags, 4 vibrant chartreuse bags, 3 striped yellow bags. +bright beige bags contain 1 drab blue bag. +vibrant olive bags contain 3 dotted olive bags. +clear tomato bags contain 1 light gray bag, 2 light turquoise bags, 2 striped yellow bags. +mirrored beige bags contain 3 light coral bags, 2 bright teal bags, 1 wavy magenta bag. +shiny gold bags contain 3 pale silver bags, 3 mirrored yellow bags, 2 shiny black bags, 2 light magenta bags. +plaid aqua bags contain 4 plaid crimson bags, 4 dim gray bags, 3 plaid orange bags, 2 dotted blue bags. +light green bags contain 2 light violet bags, 5 striped violet bags, 5 drab brown bags, 4 dull white bags. +vibrant beige bags contain 3 posh violet bags, 2 plaid blue bags, 4 shiny lavender bags, 5 wavy orange bags. +drab orange bags contain 3 striped beige bags, 3 posh teal bags, 5 drab silver bags, 1 dark indigo bag. +shiny orange bags contain 3 dark aqua bags, 4 clear beige bags, 2 mirrored lime bags, 3 dark violet bags. +wavy maroon bags contain 3 vibrant chartreuse bags. +wavy olive bags contain 5 dark aqua bags, 1 light yellow bag, 1 shiny crimson bag. +dotted cyan bags contain 2 drab gold bags. +muted cyan bags contain 1 clear gold bag, 4 dark plum bags, 2 wavy lavender bags, 5 vibrant indigo bags. +posh cyan bags contain 1 light fuchsia bag, 1 dark maroon bag. +faded bronze bags contain 2 muted salmon bags, 4 dim violet bags, 5 dark tan bags, 3 vibrant white bags. +pale green bags contain 4 muted turquoise bags, 1 vibrant green bag, 1 drab white bag. +clear brown bags contain 4 wavy teal bags, 4 drab violet bags. +striped salmon bags contain 5 mirrored orange bags, 1 shiny yellow bag, 1 muted beige bag, 1 clear purple bag. +posh brown bags contain 3 posh white bags, 4 drab chartreuse bags, 5 dark violet bags, 4 wavy teal bags. +mirrored green bags contain 1 dim tan bag. +bright yellow bags contain 2 striped indigo bags, 2 dark silver bags. +wavy yellow bags contain 3 dotted gold bags, 3 posh green bags. +light chartreuse bags contain 3 faded blue bags, 3 mirrored yellow bags, 3 shiny plum bags, 4 light red bags. +dark lime bags contain 5 vibrant chartreuse bags, 2 clear brown bags, 1 posh brown bag. +muted magenta bags contain 4 shiny silver bags, 2 dotted yellow bags, 4 pale fuchsia bags, 5 muted tan bags. +light plum bags contain 4 drab gold bags. +dim tomato bags contain 1 light silver bag. +pale lime bags contain 4 dull blue bags. +dim black bags contain 1 dark plum bag, 1 dull crimson bag, 5 wavy white bags, 2 plaid chartreuse bags. +muted teal bags contain 3 dim black bags, 4 mirrored lavender bags, 5 dull indigo bags, 3 clear red bags. +muted purple bags contain 1 mirrored red bag. +dull coral bags contain 5 pale teal bags, 2 faded cyan bags, 4 pale black bags, 2 muted olive bags. +vibrant red bags contain 4 light teal bags, 5 shiny fuchsia bags, 1 drab purple bag, 2 muted olive bags. +mirrored tomato bags contain 4 posh brown bags. +shiny coral bags contain 5 clear turquoise bags, 2 wavy salmon bags, 1 drab brown bag. +wavy indigo bags contain 1 vibrant brown bag, 2 dim turquoise bags, 1 posh violet bag, 1 plaid green bag. +dotted gold bags contain 5 pale aqua bags, 1 bright olive bag. +dotted violet bags contain 2 drab olive bags, 1 plaid cyan bag, 2 posh beige bags. +pale fuchsia bags contain 5 faded beige bags, 5 dark purple bags. +shiny chartreuse bags contain 1 striped tan bag, 5 pale tomato bags. +clear gray bags contain 1 bright fuchsia bag, 4 dotted olive bags, 2 light teal bags, 4 shiny magenta bags. +vibrant tomato bags contain 1 clear crimson bag, 3 pale purple bags, 3 faded gray bags. +light orange bags contain 5 plaid brown bags. +shiny tomato bags contain 3 light olive bags, 5 dim silver bags, 3 posh violet bags, 2 striped lavender bags. +faded green bags contain 2 dotted gold bags, 1 dark plum bag, 1 dull gray bag, 5 dark brown bags. +dim gray bags contain 5 muted white bags, 2 mirrored yellow bags, 1 muted tomato bag. +faded black bags contain 3 faded teal bags, 3 striped lavender bags, 2 striped blue bags, 4 muted lavender bags. +clear lime bags contain 3 mirrored yellow bags, 1 light yellow bag. +dark silver bags contain 4 wavy orange bags, 2 muted green bags. +plaid black bags contain 3 wavy indigo bags, 1 pale red bag. +mirrored black bags contain 5 dull black bags, 4 clear coral bags, 1 wavy olive bag, 4 dull silver bags. +light coral bags contain 5 drab black bags, 1 dark magenta bag, 1 drab teal bag, 1 mirrored crimson bag. +shiny yellow bags contain 5 faded indigo bags. +posh plum bags contain 3 faded maroon bags, 2 vibrant indigo bags, 1 bright turquoise bag. +faded olive bags contain 1 vibrant gray bag, 4 drab teal bags, 5 wavy teal bags. +dim plum bags contain 1 plaid white bag, 4 wavy beige bags, 3 wavy green bags. +muted tomato bags contain 5 dotted red bags, 1 drab purple bag, 1 light orange bag. +clear fuchsia bags contain 1 mirrored olive bag, 2 faded salmon bags. +striped violet bags contain 2 light olive bags, 1 plaid olive bag, 5 light white bags. +dim aqua bags contain 2 vibrant purple bags, 5 drab silver bags. +striped crimson bags contain 5 muted coral bags. +bright indigo bags contain 3 muted gold bags. +dotted black bags contain 4 shiny crimson bags, 5 dark salmon bags, 5 faded crimson bags, 2 vibrant magenta bags. +faded indigo bags contain 1 drab tomato bag. +bright bronze bags contain 1 wavy lime bag, 4 pale violet bags. +drab turquoise bags contain 2 drab gold bags, 2 vibrant gold bags, 4 pale tomato bags. +wavy black bags contain 2 dotted brown bags, 1 light salmon bag. +posh green bags contain 1 striped olive bag, 5 vibrant turquoise bags, 4 pale coral bags. +clear green bags contain 4 dull bronze bags, 4 shiny crimson bags, 1 light white bag. +dull chartreuse bags contain 2 dim aqua bags, 3 shiny black bags. +drab lime bags contain 1 wavy chartreuse bag, 4 mirrored chartreuse bags, 1 posh olive bag, 5 mirrored lavender bags. +bright tan bags contain 4 muted tan bags, 5 shiny gold bags, 1 mirrored red bag, 3 dull crimson bags. +dim maroon bags contain 3 clear red bags, 5 dark brown bags, 2 bright maroon bags, 1 muted teal bag. +drab tomato bags contain 4 dim orange bags, 2 mirrored violet bags, 3 faded purple bags. +muted gold bags contain 1 dim cyan bag. +striped white bags contain 1 plaid white bag, 1 posh purple bag, 3 muted cyan bags, 2 pale crimson bags. +wavy beige bags contain 2 plaid white bags, 3 dark brown bags. +vibrant turquoise bags contain 2 muted turquoise bags, 3 plaid green bags, 1 shiny crimson bag. +dark fuchsia bags contain 1 pale purple bag, 1 dim fuchsia bag, 3 light teal bags, 3 vibrant magenta bags. +dotted aqua bags contain 1 bright white bag, 5 clear gold bags, 5 clear tomato bags. +faded silver bags contain 1 light lime bag, 4 wavy gold bags. +faded brown bags contain 4 light aqua bags. +bright gray bags contain 3 faded red bags, 2 muted plum bags, 1 wavy brown bag. +wavy tan bags contain 1 pale maroon bag, 5 posh black bags. +bright blue bags contain 5 posh purple bags. +striped gold bags contain 4 dull tan bags, 1 shiny crimson bag, 2 clear blue bags. +bright magenta bags contain 4 shiny orange bags. +dotted brown bags contain 4 faded teal bags, 5 mirrored coral bags. +muted silver bags contain 5 striped black bags, 3 faded beige bags, 4 plaid crimson bags, 2 wavy brown bags. +wavy purple bags contain 1 dim brown bag, 1 bright yellow bag, 5 shiny lime bags. +dull plum bags contain 1 posh black bag, 4 vibrant fuchsia bags, 5 dull bronze bags. +dotted red bags contain 5 striped tomato bags, 4 shiny orange bags, 4 clear magenta bags, 5 pale coral bags. +light violet bags contain 2 bright beige bags, 5 mirrored plum bags, 3 wavy fuchsia bags, 1 clear tan bag. +dark teal bags contain 3 dull gray bags, 2 dark aqua bags, 1 clear beige bag. +light fuchsia bags contain 2 muted silver bags, 2 striped beige bags. +posh blue bags contain 5 striped olive bags, 5 dim coral bags. +light black bags contain 2 drab coral bags, 2 shiny indigo bags. +pale chartreuse bags contain 5 pale tomato bags. +drab gold bags contain 1 faded gold bag, 5 shiny gold bags. +posh bronze bags contain 2 drab aqua bags, 5 pale gray bags. +light tomato bags contain 5 wavy lime bags. +dull tan bags contain 3 drab blue bags, 4 dull green bags, 4 clear violet bags. +muted beige bags contain 5 clear white bags, 5 faded crimson bags. +faded fuchsia bags contain 5 plaid purple bags, 1 shiny silver bag, 4 muted violet bags. +bright green bags contain 5 dim teal bags, 5 shiny crimson bags, 5 clear crimson bags. +mirrored fuchsia bags contain 4 posh white bags, 5 wavy teal bags, 2 dark violet bags. +vibrant plum bags contain 2 posh yellow bags. +plaid bronze bags contain 4 dotted coral bags, 4 dull green bags, 2 plaid chartreuse bags. +plaid fuchsia bags contain 5 bright white bags. +dull red bags contain 2 mirrored fuchsia bags, 3 vibrant violet bags, 2 bright olive bags, 1 dim orange bag. +faded gray bags contain 1 dull purple bag, 2 posh salmon bags. +wavy plum bags contain 4 pale violet bags, 3 striped magenta bags, 4 pale red bags. +dark crimson bags contain 4 dim yellow bags, 1 dotted purple bag, 2 wavy indigo bags, 4 clear black bags. +pale cyan bags contain 5 shiny coral bags, 4 shiny beige bags, 2 plaid olive bags. +dull violet bags contain 3 wavy olive bags, 1 dull gray bag, 5 vibrant turquoise bags, 1 plaid purple bag. +wavy chartreuse bags contain 1 dotted magenta bag, 3 bright orange bags, 1 mirrored red bag. +dark cyan bags contain 5 dotted turquoise bags, 1 clear purple bag, 1 dim teal bag. +posh coral bags contain 3 muted bronze bags. +pale yellow bags contain 1 drab tomato bag. +plaid turquoise bags contain 1 muted gray bag. +dotted purple bags contain 5 posh silver bags, 4 dark salmon bags. +light indigo bags contain 4 mirrored red bags, 4 light olive bags. +faded plum bags contain 3 mirrored gold bags. +faded coral bags contain 5 dull tan bags. +clear indigo bags contain 5 mirrored magenta bags, 1 clear maroon bag, 1 bright blue bag, 5 light aqua bags. +dim cyan bags contain 5 plaid green bags. +dotted maroon bags contain 5 pale maroon bags, 2 dark indigo bags. +faded beige bags contain 1 plaid chartreuse bag. +striped indigo bags contain 1 dark gray bag, 3 drab olive bags. +clear yellow bags contain 4 dull gray bags, 1 muted green bag. +light lavender bags contain 4 pale coral bags, 2 light yellow bags, 2 light indigo bags. +light turquoise bags contain 5 pale fuchsia bags, 5 vibrant fuchsia bags, 5 vibrant magenta bags, 3 pale indigo bags. +light purple bags contain 2 light cyan bags. +bright gold bags contain 1 dark aqua bag. +muted bronze bags contain 2 light teal bags. +striped gray bags contain 2 light cyan bags, 1 pale black bag, 5 plaid plum bags. +wavy orange bags contain 2 pale coral bags, 2 dim coral bags. +wavy silver bags contain 2 posh white bags, 1 faded beige bag. +clear chartreuse bags contain 1 vibrant lime bag, 2 faded plum bags, 1 striped chartreuse bag, 5 clear maroon bags. +vibrant tan bags contain 3 striped lime bags, 4 pale maroon bags, 2 muted turquoise bags, 4 dark lime bags. +posh aqua bags contain 2 muted tan bags, 2 shiny blue bags, 2 posh purple bags. +bright orange bags contain no other bags. +drab coral bags contain no other bags. +light white bags contain 5 striped yellow bags. +wavy violet bags contain 1 pale silver bag, 2 shiny fuchsia bags, 1 vibrant violet bag, 1 shiny plum bag. +dark white bags contain 4 shiny maroon bags, 2 dim brown bags, 2 dark beige bags, 1 pale blue bag. +vibrant violet bags contain 4 striped blue bags, 1 mirrored lime bag, 1 posh white bag. +vibrant lavender bags contain 4 dotted magenta bags, 1 wavy red bag, 3 pale coral bags, 3 clear indigo bags. +dark purple bags contain 4 posh white bags. +mirrored lavender bags contain 5 clear brown bags, 2 faded gold bags. +striped silver bags contain 3 light yellow bags, 1 drab violet bag. +faded blue bags contain 3 muted violet bags, 4 wavy plum bags, 2 pale indigo bags, 1 wavy bronze bag. +drab cyan bags contain 4 dim tomato bags, 1 plaid lavender bag, 4 pale red bags, 2 drab olive bags. +clear lavender bags contain 3 wavy olive bags, 5 bright gray bags, 3 wavy beige bags, 2 dim violet bags. +striped aqua bags contain 3 mirrored lavender bags. +plaid tomato bags contain 2 posh cyan bags, 3 pale silver bags. +plaid salmon bags contain 1 muted lavender bag, 5 muted green bags, 3 bright aqua bags. +light blue bags contain 1 light white bag, 4 clear violet bags, 3 dark brown bags. +dark blue bags contain 5 posh aqua bags. +faded teal bags contain 3 light beige bags. +plaid chartreuse bags contain 4 wavy teal bags. +wavy gray bags contain 3 drab white bags, 2 muted lavender bags. +pale maroon bags contain 4 faded crimson bags, 4 vibrant chartreuse bags, 1 plaid green bag, 1 vibrant turquoise bag. +dark bronze bags contain 4 faded turquoise bags, 2 faded silver bags, 5 faded salmon bags. +pale coral bags contain 3 mirrored yellow bags, 4 dark plum bags, 2 dark aqua bags, 4 plaid white bags. +mirrored magenta bags contain 5 vibrant lime bags, 4 vibrant chartreuse bags, 3 striped aqua bags. +mirrored salmon bags contain 4 striped salmon bags, 1 posh tan bag, 3 faded bronze bags. +drab tan bags contain 5 vibrant violet bags. +vibrant indigo bags contain 1 pale coral bag, 1 light teal bag, 2 light magenta bags. +plaid lavender bags contain 1 striped silver bag, 1 clear lime bag. +muted plum bags contain 2 plaid crimson bags. +posh gray bags contain 5 mirrored lime bags. +clear maroon bags contain 5 wavy bronze bags, 3 dim gold bags, 2 muted beige bags, 5 posh coral bags. +striped maroon bags contain 2 dotted violet bags, 4 bright fuchsia bags, 4 striped aqua bags. +faded yellow bags contain 2 wavy teal bags, 3 wavy lavender bags. +posh black bags contain 1 drab silver bag, 2 clear white bags, 5 muted silver bags. +muted indigo bags contain 1 dark green bag, 1 plaid chartreuse bag, 3 bright indigo bags, 5 wavy silver bags. +wavy brown bags contain 5 faded red bags, 4 bright orange bags, 3 dim black bags. +vibrant coral bags contain 5 plaid white bags, 5 vibrant indigo bags. +wavy white bags contain 1 plaid green bag, 3 drab chartreuse bags, 1 posh white bag. +pale violet bags contain 2 shiny orange bags, 4 plaid crimson bags. +clear black bags contain 4 wavy blue bags, 5 plaid tan bags, 4 clear magenta bags. +faded aqua bags contain 2 wavy teal bags. +dotted green bags contain 5 shiny orange bags, 1 light magenta bag. +bright coral bags contain 2 shiny fuchsia bags, 4 light lime bags, 1 shiny gold bag. +vibrant fuchsia bags contain 1 vibrant chartreuse bag, 1 striped black bag. +dark turquoise bags contain 5 shiny salmon bags, 2 light lavender bags. +shiny green bags contain 1 pale silver bag, 4 dim red bags, 3 dark lime bags, 4 drab coral bags. +clear red bags contain 5 light teal bags, 5 posh brown bags. +dull gold bags contain 1 drab tan bag, 4 striped tomato bags, 5 pale maroon bags, 2 dim crimson bags. +mirrored red bags contain 3 shiny crimson bags, 4 plaid brown bags, 2 shiny black bags. +pale blue bags contain 1 wavy crimson bag, 4 faded beige bags, 4 shiny chartreuse bags. +clear beige bags contain 4 plaid crimson bags, 5 shiny crimson bags. +drab salmon bags contain 4 dim crimson bags, 3 light magenta bags, 1 clear violet bag. +vibrant magenta bags contain 4 dim black bags. +dark salmon bags contain 3 dull green bags, 4 faded red bags. +posh white bags contain no other bags. +light lime bags contain 5 dark aqua bags. +vibrant salmon bags contain 4 striped tomato bags, 4 clear aqua bags. +clear teal bags contain 3 striped gray bags. +plaid silver bags contain 3 vibrant violet bags, 2 muted magenta bags, 3 dark olive bags, 4 mirrored gold bags. +striped cyan bags contain 4 light gold bags, 2 dotted magenta bags. +wavy bronze bags contain 1 plaid crimson bag, 1 dull gray bag, 5 dull tan bags, 1 mirrored teal bag. +dim olive bags contain 4 vibrant lime bags, 2 shiny crimson bags, 2 muted turquoise bags. +dotted blue bags contain 4 vibrant gray bags, 2 shiny beige bags. +plaid blue bags contain 5 drab silver bags. +dark olive bags contain 1 pale coral bag, 4 vibrant indigo bags. +pale gray bags contain 3 dotted crimson bags, 1 striped magenta bag, 5 wavy white bags, 2 vibrant blue bags. +mirrored brown bags contain 2 bright cyan bags, 4 plaid brown bags, 5 faded turquoise bags. +wavy gold bags contain 1 wavy coral bag. +pale teal bags contain 3 vibrant magenta bags. +mirrored turquoise bags contain 4 mirrored olive bags, 5 bright yellow bags. +dark chartreuse bags contain 4 dotted cyan bags, 5 shiny turquoise bags, 5 vibrant salmon bags, 4 wavy yellow bags. +muted gray bags contain 3 dim orange bags. +posh turquoise bags contain 4 clear lavender bags, 5 dim coral bags, 2 striped salmon bags. +shiny cyan bags contain 4 striped gold bags. +drab olive bags contain 2 plaid cyan bags, 1 mirrored lime bag. +posh tomato bags contain 2 drab tan bags, 3 shiny orange bags. +muted fuchsia bags contain 1 pale salmon bag, 3 wavy violet bags, 3 mirrored maroon bags. +pale bronze bags contain 3 drab yellow bags, 3 muted chartreuse bags. +striped green bags contain 3 striped orange bags, 2 dull green bags, 3 vibrant tan bags. +faded orange bags contain 3 mirrored plum bags, 5 mirrored lime bags, 5 faded red bags. +dull aqua bags contain 2 striped coral bags. +dotted olive bags contain 4 faded salmon bags, 1 wavy green bag. +vibrant silver bags contain 4 mirrored yellow bags, 2 dotted salmon bags, 3 drab silver bags. +striped olive bags contain 1 mirrored fuchsia bag, 1 faded gold bag, 1 mirrored lavender bag. +dark violet bags contain no other bags. +mirrored olive bags contain 5 dull teal bags, 1 dim white bag. +plaid tan bags contain 4 pale gray bags, 2 dim crimson bags, 1 clear violet bag, 1 wavy lime bag. +pale tomato bags contain 5 posh green bags, 4 faded red bags. +dim turquoise bags contain 1 shiny gold bag, 5 drab blue bags. +muted lime bags contain 3 vibrant lime bags, 1 pale plum bag, 1 dark indigo bag. +drab beige bags contain 3 vibrant magenta bags. +posh beige bags contain 2 dark violet bags. +muted olive bags contain 2 pale brown bags, 5 light gray bags, 3 wavy green bags, 2 drab tan bags. +dim orange bags contain 1 clear lime bag, 4 faded beige bags, 2 mirrored fuchsia bags. +dull salmon bags contain 4 striped coral bags, 3 striped aqua bags. +dull maroon bags contain 3 clear brown bags, 5 dull magenta bags, 1 dim red bag. +mirrored coral bags contain 5 muted tan bags, 4 dotted magenta bags, 5 dim olive bags. +posh olive bags contain 4 dull magenta bags, 4 wavy blue bags, 2 drab yellow bags, 5 dotted gold bags. +mirrored violet bags contain 2 pale fuchsia bags. +drab bronze bags contain 4 drab chartreuse bags. +wavy fuchsia bags contain 2 dark gray bags, 5 muted silver bags. +pale plum bags contain 3 vibrant salmon bags, 5 drab chartreuse bags, 2 posh violet bags. +mirrored aqua bags contain 2 pale aqua bags. +bright silver bags contain 3 drab black bags, 5 dark salmon bags, 2 shiny beige bags, 2 posh lavender bags. +plaid lime bags contain 4 faded teal bags, 5 pale brown bags, 5 dim red bags. +dotted turquoise bags contain 3 dim olive bags, 2 mirrored blue bags, 3 dull lime bags, 4 vibrant lavender bags. +drab maroon bags contain 5 bright red bags. +wavy lavender bags contain 1 striped lime bag, 1 posh brown bag. +shiny beige bags contain 5 shiny aqua bags, 3 muted teal bags, 5 clear gold bags. +dark gold bags contain 4 clear maroon bags, 2 dotted maroon bags, 3 light red bags. +light aqua bags contain 2 dim red bags, 3 pale red bags. +posh teal bags contain 3 muted brown bags, 5 shiny gold bags, 5 dotted purple bags. +dull lavender bags contain 5 shiny blue bags. +dark tan bags contain 1 muted tan bag, 5 vibrant turquoise bags, 4 dark violet bags, 4 muted plum bags. +light beige bags contain 2 mirrored fuchsia bags, 1 drab chartreuse bag, 1 muted tan bag. +pale olive bags contain 3 clear brown bags. +dark maroon bags contain 5 dull plum bags, 3 muted green bags. +muted red bags contain 4 pale tan bags, 1 bright white bag. +light tan bags contain 3 light purple bags, 2 pale aqua bags, 3 wavy bronze bags. +clear magenta bags contain 3 vibrant chartreuse bags, 1 dim crimson bag. +dark orange bags contain 2 posh cyan bags, 1 wavy brown bag, 5 dull black bags. +dim lavender bags contain 5 drab fuchsia bags. +dotted beige bags contain 5 light blue bags, 4 plaid tan bags, 2 wavy maroon bags, 5 dim crimson bags. +dim green bags contain 3 plaid tan bags, 1 drab blue bag, 1 clear aqua bag. +plaid brown bags contain 3 muted turquoise bags, 4 drab chartreuse bags. +bright black bags contain 5 striped white bags. +plaid gold bags contain 3 shiny lime bags, 1 plaid maroon bag, 4 bright blue bags. +pale white bags contain 4 drab chartreuse bags, 3 pale tan bags, 5 pale aqua bags. +drab violet bags contain no other bags. +light magenta bags contain 3 faded crimson bags. +light gold bags contain 1 dim lavender bag, 3 light magenta bags, 5 drab gold bags. +plaid coral bags contain 1 vibrant salmon bag, 3 striped tomato bags, 3 posh blue bags. +dotted white bags contain 1 wavy lavender bag. +striped yellow bags contain 4 drab black bags, 2 faded red bags, 2 shiny gold bags, 4 dark aqua bags. +dark yellow bags contain 5 wavy bronze bags, 5 bright purple bags. +faded white bags contain 3 light tomato bags. +muted white bags contain 5 faded gold bags, 1 plaid magenta bag, 3 drab white bags, 5 dim brown bags. +faded red bags contain 1 posh brown bag, 2 muted turquoise bags, 3 plaid crimson bags, 4 shiny orange bags. +dark red bags contain 5 shiny salmon bags. +dull gray bags contain 2 posh white bags. +bright salmon bags contain 2 shiny aqua bags, 3 dotted crimson bags, 1 drab violet bag, 4 pale chartreuse bags. +mirrored chartreuse bags contain 1 vibrant magenta bag, 3 plaid salmon bags, 1 plaid chartreuse bag, 3 muted violet bags. +vibrant orange bags contain 5 posh yellow bags. +dark gray bags contain 1 plaid chartreuse bag, 2 drab violet bags, 1 bright chartreuse bag, 1 muted purple bag. +mirrored crimson bags contain 3 drab coral bags, 5 dull lime bags. +muted violet bags contain 3 dotted crimson bags, 3 light olive bags. +shiny brown bags contain 2 dark lavender bags, 2 vibrant yellow bags, 1 dark black bag, 2 drab olive bags. +muted green bags contain 1 dull cyan bag, 5 dull red bags, 4 pale chartreuse bags. +drab yellow bags contain 3 pale tomato bags. +dotted tomato bags contain 2 shiny magenta bags, 3 mirrored tomato bags, 5 plaid chartreuse bags. +plaid red bags contain 3 pale cyan bags. +bright red bags contain 1 shiny beige bag. +plaid purple bags contain 5 dull gold bags. +dark green bags contain 3 pale salmon bags, 3 dim brown bags, 2 wavy violet bags, 2 pale chartreuse bags. +plaid orange bags contain 1 vibrant chartreuse bag, 2 dotted coral bags, 1 posh teal bag. +plaid violet bags contain 1 shiny maroon bag. +posh tan bags contain 1 shiny beige bag, 2 dim magenta bags, 1 dark violet bag. +bright aqua bags contain 1 drab brown bag, 4 dotted purple bags. +vibrant white bags contain 4 light gray bags, 2 dark fuchsia bags, 1 pale cyan bag. +striped red bags contain 5 faded gold bags, 5 drab crimson bags, 3 faded turquoise bags. +dull purple bags contain 1 pale crimson bag. +shiny blue bags contain 1 pale violet bag, 5 mirrored plum bags, 3 posh white bags, 1 light yellow bag. +clear salmon bags contain 2 striped lime bags, 1 dull violet bag. +faded gold bags contain 3 light teal bags, 3 wavy teal bags. +mirrored yellow bags contain 2 muted turquoise bags, 4 drab chartreuse bags. +plaid gray bags contain 4 plaid plum bags. +plaid white bags contain no other bags. +drab black bags contain 2 mirrored yellow bags, 2 drab chartreuse bags, 1 shiny orange bag. +dotted chartreuse bags contain 2 vibrant cyan bags, 2 light salmon bags, 3 vibrant red bags, 5 light turquoise bags. +faded lavender bags contain 3 dark tomato bags, 5 muted lime bags, 4 light fuchsia bags, 4 dull lavender bags. +vibrant cyan bags contain 2 clear crimson bags, 3 pale orange bags, 4 dull indigo bags, 3 light red bags. +bright maroon bags contain 2 muted tan bags, 2 light teal bags. +drab silver bags contain 3 bright chartreuse bags, 4 pale crimson bags, 5 dotted crimson bags, 5 faded yellow bags. +drab purple bags contain 5 drab blue bags. +dim gold bags contain 1 bright cyan bag, 5 dull white bags, 3 vibrant blue bags. +dark beige bags contain 4 pale coral bags, 1 pale indigo bag. +dotted salmon bags contain 2 drab violet bags, 5 posh white bags. +vibrant crimson bags contain 5 faded teal bags, 3 dotted green bags, 1 clear maroon bag. +dim chartreuse bags contain 3 clear white bags. +bright violet bags contain 1 dim yellow bag, 1 muted purple bag, 4 muted teal bags, 5 striped cyan bags. +dim magenta bags contain 1 pale aqua bag, 4 pale maroon bags, 5 mirrored red bags, 4 drab yellow bags. +dim brown bags contain 5 faded salmon bags, 4 dotted magenta bags, 5 drab tomato bags, 2 faded teal bags. +shiny lime bags contain 5 dotted black bags, 4 plaid turquoise bags, 2 dim tomato bags, 2 clear magenta bags. +drab magenta bags contain 3 dark beige bags. +faded cyan bags contain 2 striped lime bags, 4 bright red bags. +dark brown bags contain 4 mirrored lime bags, 1 bright orange bag. +posh fuchsia bags contain 5 shiny gold bags, 5 pale salmon bags, 1 light coral bag, 1 mirrored plum bag. +shiny magenta bags contain 4 dark aqua bags. +dark lavender bags contain 1 pale purple bag, 3 vibrant yellow bags. +vibrant brown bags contain 2 posh teal bags, 1 wavy silver bag, 2 pale plum bags. +muted black bags contain 5 faded crimson bags, 3 dim crimson bags, 4 vibrant magenta bags. +muted brown bags contain 5 striped olive bags, 5 dark brown bags, 2 clear brown bags, 4 plaid white bags. +pale orange bags contain 4 bright blue bags, 3 dark aqua bags, 1 clear gold bag. +light cyan bags contain 3 muted silver bags. +drab white bags contain 2 drab tan bags, 2 striped tomato bags, 4 dull gray bags, 5 drab blue bags. +dim tan bags contain 3 mirrored bronze bags, 3 faded salmon bags, 4 drab purple bags. +dull tomato bags contain 3 clear lime bags. +wavy aqua bags contain 3 dotted orange bags, 5 shiny crimson bags. +shiny lavender bags contain 5 vibrant blue bags, 4 pale purple bags, 1 wavy bronze bag, 2 posh violet bags. +shiny white bags contain 5 faded blue bags, 5 pale cyan bags. +wavy blue bags contain 4 vibrant chartreuse bags, 4 plaid brown bags, 3 plaid white bags, 2 faded gold bags. +striped magenta bags contain 2 dark olive bags, 5 bright chartreuse bags. +vibrant black bags contain 4 plaid white bags, 2 dull silver bags, 5 striped purple bags, 1 dark plum bag. +dull green bags contain 2 dull crimson bags. +vibrant chartreuse bags contain 2 bright orange bags, 4 dark aqua bags. +dim violet bags contain 2 dark teal bags, 4 plaid brown bags, 4 mirrored yellow bags. +clear blue bags contain 5 posh maroon bags. +faded tomato bags contain 5 clear beige bags, 4 bright orange bags. +posh violet bags contain 3 clear gold bags. +striped tomato bags contain 2 shiny black bags. +muted crimson bags contain 4 light aqua bags, 3 dim gold bags. +clear tan bags contain 4 drab tomato bags, 4 mirrored bronze bags, 1 shiny chartreuse bag. +posh magenta bags contain 4 posh red bags, 3 light bronze bags. +dim blue bags contain 5 dim gray bags, 1 light turquoise bag, 5 muted bronze bags. +drab plum bags contain 1 vibrant plum bag, 4 striped coral bags. +pale silver bags contain 5 drab black bags. +posh purple bags contain 2 dark brown bags. +drab indigo bags contain 1 muted lavender bag, 2 posh salmon bags, 1 pale brown bag. +striped blue bags contain 4 wavy teal bags. +wavy magenta bags contain 1 dotted salmon bag, 1 drab black bag, 2 dull tan bags, 1 drab silver bag. +pale turquoise bags contain 4 dark lime bags, 4 drab maroon bags. +shiny tan bags contain 4 plaid coral bags, 3 dim black bags, 1 dull plum bag. +light teal bags contain 3 dark violet bags. +mirrored silver bags contain 1 striped salmon bag, 1 clear chartreuse bag, 2 clear orange bags, 2 posh aqua bags. +wavy coral bags contain 2 muted teal bags, 1 wavy white bag. +wavy crimson bags contain 1 shiny aqua bag, 3 muted beige bags. +shiny bronze bags contain 1 posh indigo bag, 5 wavy blue bags, 1 faded gold bag, 3 striped tomato bags. +shiny maroon bags contain 1 clear tomato bag, 1 wavy crimson bag. +bright turquoise bags contain 3 dull tan bags, 3 vibrant teal bags. +faded purple bags contain 1 plaid chartreuse bag. +bright white bags contain 2 faded gold bags. +clear orange bags contain 4 striped blue bags, 2 mirrored lime bags, 5 muted turquoise bags. +clear cyan bags contain 1 dim plum bag, 3 shiny brown bags, 1 muted purple bag, 2 plaid lime bags. +plaid teal bags contain 2 faded aqua bags, 4 wavy olive bags. +dotted lime bags contain 5 posh olive bags, 2 pale orange bags. +muted tan bags contain 1 dull gray bag, 2 dark aqua bags, 1 pale violet bag. +striped orange bags contain 3 mirrored lime bags, 2 dull crimson bags, 4 faded gold bags, 3 pale silver bags. +light olive bags contain 2 dark tan bags, 3 dim orange bags, 5 mirrored yellow bags. +plaid magenta bags contain 2 wavy orange bags, 1 wavy chartreuse bag, 5 striped coral bags. +dark magenta bags contain 3 bright white bags, 3 plaid purple bags, 3 striped black bags, 4 light beige bags. +dark black bags contain 3 pale tan bags, 4 mirrored orange bags, 3 dull teal bags. +posh orange bags contain 4 bright aqua bags, 1 dim crimson bag, 4 dim turquoise bags, 1 dotted bronze bag. +dull crimson bags contain 4 vibrant violet bags. +clear turquoise bags contain 1 muted brown bag, 2 dull yellow bags, 3 pale black bags, 1 plaid crimson bag. +vibrant blue bags contain 2 clear beige bags. +dull lime bags contain 4 shiny plum bags, 3 vibrant magenta bags, 3 dark olive bags. +drab brown bags contain 4 clear green bags. +mirrored plum bags contain 2 faded red bags. +shiny fuchsia bags contain 2 muted cyan bags, 4 dark aqua bags, 3 light olive bags, 2 clear gold bags. +vibrant purple bags contain 3 pale aqua bags, 3 dark lime bags, 1 bright chartreuse bag. +bright crimson bags contain 1 vibrant gold bag. +shiny plum bags contain 2 clear olive bags, 4 dark plum bags. +shiny crimson bags contain no other bags. +dull beige bags contain 1 mirrored coral bag. +dim salmon bags contain 1 clear tomato bag, 2 shiny teal bags, 4 plaid olive bags, 3 plaid purple bags. +muted maroon bags contain 2 muted violet bags, 4 dark white bags. +pale aqua bags contain 4 dark beige bags, 1 muted brown bag. +bright plum bags contain 4 dim black bags. +striped tan bags contain 3 bright orange bags, 3 dark violet bags, 4 drab blue bags, 2 vibrant lime bags. +clear crimson bags contain 3 wavy brown bags, 1 faded blue bag, 2 striped cyan bags. +dim indigo bags contain 3 dotted lime bags, 1 dotted purple bag. +pale tan bags contain 2 drab blue bags, 5 dim orange bags, 5 wavy olive bags, 3 striped tomato bags. +vibrant bronze bags contain 5 clear red bags, 5 posh red bags. +dotted bronze bags contain 1 light yellow bag. +wavy salmon bags contain 2 striped olive bags, 4 muted teal bags. +shiny turquoise bags contain 3 dark teal bags, 1 plaid yellow bag. +faded maroon bags contain 1 vibrant salmon bag, 5 dotted magenta bags, 1 faded tan bag, 5 striped tomato bags. +vibrant teal bags contain 4 light teal bags, 3 pale orange bags, 5 drab white bags. +vibrant gold bags contain 1 muted cyan bag, 2 mirrored plum bags, 1 drab coral bag, 4 dark lime bags. +bright cyan bags contain 2 muted silver bags, 5 plaid bronze bags, 3 light beige bags, 2 faded crimson bags. +shiny silver bags contain 4 mirrored fuchsia bags, 2 clear violet bags, 3 faded beige bags. +dark tomato bags contain 4 clear lime bags, 2 light beige bags, 3 bright turquoise bags. +mirrored indigo bags contain 5 posh chartreuse bags, 5 clear tomato bags. +dotted indigo bags contain 2 drab olive bags, 2 dim indigo bags, 5 dotted magenta bags. +shiny gray bags contain 4 muted chartreuse bags, 4 plaid gray bags, 3 dull red bags, 5 striped orange bags. +dim yellow bags contain 1 muted cyan bag, 4 mirrored fuchsia bags, 1 faded gold bag, 1 drab turquoise bag. +bright lime bags contain 5 shiny bronze bags, 3 wavy aqua bags, 4 plaid turquoise bags. +dotted gray bags contain 2 shiny gold bags. +striped black bags contain 1 wavy teal bag, 5 dim chartreuse bags, 4 mirrored lavender bags. +pale beige bags contain 2 posh black bags, 4 clear white bags. +posh indigo bags contain 5 plaid white bags. +dull blue bags contain 4 dark violet bags, 2 clear magenta bags, 4 dotted crimson bags. +mirrored white bags contain 5 faded yellow bags. +bright brown bags contain 3 pale gray bags. +light gray bags contain 3 clear magenta bags, 5 wavy brown bags, 3 dotted salmon bags. +muted orange bags contain 1 bright magenta bag, 1 bright plum bag. +clear purple bags contain 1 shiny gold bag, 1 dark white bag. +striped coral bags contain 5 pale gray bags, 3 wavy chartreuse bags. +plaid green bags contain no other bags. +plaid maroon bags contain 5 posh brown bags, 3 striped crimson bags, 4 plaid green bags. +light maroon bags contain 3 muted gray bags, 5 dull crimson bags, 2 shiny maroon bags. +pale purple bags contain 2 striped white bags, 3 plaid chartreuse bags, 1 mirrored lime bag. +muted yellow bags contain 5 vibrant purple bags, 1 dark teal bag. +plaid olive bags contain 1 light crimson bag, 1 faded gold bag, 1 vibrant blue bag. +dim beige bags contain 4 muted silver bags, 3 mirrored beige bags, 4 striped violet bags. +striped chartreuse bags contain 3 dull teal bags. +muted salmon bags contain 2 posh salmon bags, 2 posh silver bags. +dim red bags contain 2 drab blue bags, 4 plaid crimson bags, 3 vibrant gold bags. +dull magenta bags contain 5 faded crimson bags, 1 shiny orange bag, 1 dark tan bag. +plaid beige bags contain 1 vibrant turquoise bag. +striped teal bags contain 2 dim chartreuse bags, 4 dark green bags. +dotted plum bags contain 2 light cyan bags. +dotted yellow bags contain 5 posh black bags, 5 dull tan bags, 2 dull violet bags, 5 muted plum bags. +dotted coral bags contain 1 striped tomato bag, 2 light crimson bags, 3 clear violet bags. +dull fuchsia bags contain 3 plaid purple bags, 4 mirrored red bags. +dull yellow bags contain 5 vibrant violet bags, 2 dark olive bags. +dull white bags contain 5 posh olive bags, 5 pale tomato bags, 2 bright teal bags. +pale brown bags contain 3 dim crimson bags, 3 pale indigo bags, 1 dim chartreuse bag, 4 muted teal bags. +shiny violet bags contain 1 muted tomato bag, 2 dull yellow bags, 1 drab teal bag. +drab blue bags contain 3 vibrant gold bags, 4 drab black bags. +posh lavender bags contain 5 shiny plum bags, 3 drab salmon bags, 4 dim brown bags, 4 plaid blue bags. +dull teal bags contain 2 drab turquoise bags, 1 shiny crimson bag, 5 shiny aqua bags. +shiny purple bags contain 3 drab orange bags, 4 dark red bags, 4 vibrant fuchsia bags, 2 light fuchsia bags. +pale salmon bags contain 2 plaid chartreuse bags, 3 striped white bags. +posh silver bags contain 4 clear magenta bags, 5 light magenta bags. +light salmon bags contain 4 vibrant olive bags. +striped turquoise bags contain 1 faded magenta bag, 3 shiny indigo bags, 4 striped lavender bags. +dotted crimson bags contain 2 pale silver bags, 2 striped magenta bags, 1 striped white bag. +dull brown bags contain 5 clear crimson bags, 1 dotted green bag, 4 dull magenta bags, 3 dim tan bags. +plaid cyan bags contain 1 striped orange bag, 2 muted cyan bags. +muted lavender bags contain 5 mirrored fuchsia bags. +dim lime bags contain 1 muted black bag. +light bronze bags contain 1 dull crimson bag, 5 dim chartreuse bags. +dull olive bags contain 2 vibrant coral bags, 3 shiny teal bags, 4 plaid purple bags. +posh yellow bags contain 5 dark lime bags, 3 mirrored plum bags. +bright fuchsia bags contain 1 striped silver bag. +posh maroon bags contain 4 dotted magenta bags, 4 posh yellow bags, 2 drab beige bags. +posh salmon bags contain 2 muted green bags. +mirrored gray bags contain 4 striped silver bags. +dull cyan bags contain 2 bright orange bags, 4 dark plum bags. +light crimson bags contain 3 drab fuchsia bags, 3 bright blue bags, 1 dark purple bag. +light red bags contain 3 dim maroon bags, 4 muted green bags, 3 dotted olive bags. +dull indigo bags contain 2 plaid brown bags, 1 wavy white bag, 2 vibrant turquoise bags, 5 drab chartreuse bags. +drab crimson bags contain 2 vibrant salmon bags. +posh red bags contain 3 mirrored violet bags, 1 striped tomato bag, 2 striped olive bags. +drab chartreuse bags contain no other bags. +posh lime bags contain 3 drab violet bags, 1 bright coral bag. +wavy red bags contain 4 striped gray bags, 3 posh salmon bags, 1 dotted violet bag, 3 striped aqua bags. +striped fuchsia bags contain 3 bright crimson bags, 3 dark silver bags, 1 clear magenta bag, 3 drab salmon bags. +striped plum bags contain 2 drab tan bags, 5 pale gold bags, 1 dull white bag, 1 clear coral bag. +mirrored maroon bags contain 1 dark magenta bag, 1 plaid purple bag, 2 light gray bags. +shiny indigo bags contain 2 drab teal bags. +dim silver bags contain 1 striped aqua bag, 3 dull tan bags, 3 striped tan bags, 2 wavy maroon bags. +shiny salmon bags contain 5 faded beige bags. +dull black bags contain 3 vibrant plum bags, 2 plaid chartreuse bags, 1 muted brown bag, 2 clear tomato bags. +clear plum bags contain 3 striped maroon bags, 2 dark white bags. +vibrant green bags contain 5 light orange bags, 5 mirrored magenta bags, 3 bright teal bags, 2 striped brown bags. +drab gray bags contain 1 plaid maroon bag, 2 pale tan bags, 1 plaid white bag. +wavy lime bags contain 2 clear gold bags, 2 bright chartreuse bags, 1 faded crimson bag. +light silver bags contain 4 dim maroon bags, 1 mirrored teal bag. +light brown bags contain 5 muted magenta bags. +dim fuchsia bags contain 5 pale purple bags, 5 wavy orange bags, 5 clear lime bags. +vibrant maroon bags contain 4 light gray bags. +dim purple bags contain 2 muted white bags, 2 shiny aqua bags. +clear olive bags contain 3 bright olive bags. +drab lavender bags contain 4 mirrored crimson bags, 3 bright violet bags, 5 posh gold bags, 2 bright olive bags. +light yellow bags contain 1 posh brown bag, 2 pale violet bags. +plaid crimson bags contain 1 plaid green bag, 3 shiny crimson bags. +pale indigo bags contain 3 clear aqua bags, 2 pale silver bags. +mirrored bronze bags contain 4 muted tomato bags, 4 bright white bags, 1 faded crimson bag. +dim teal bags contain 1 muted salmon bag. +clear violet bags contain 2 dim coral bags, 2 faded beige bags. +dotted silver bags contain 2 posh plum bags, 4 pale chartreuse bags. +pale gold bags contain 2 vibrant gold bags, 1 dotted magenta bag. +posh crimson bags contain 4 dull yellow bags, 3 clear fuchsia bags. +dull orange bags contain 3 dull silver bags, 3 clear violet bags, 4 clear chartreuse bags, 3 faded salmon bags. +striped lime bags contain 5 mirrored plum bags, 4 faded gold bags, 3 wavy white bags, 3 light teal bags. +mirrored tan bags contain 4 dull silver bags, 4 light coral bags, 2 plaid lavender bags. +wavy tomato bags contain 4 clear orange bags, 5 shiny fuchsia bags, 3 light red bags. +dotted teal bags contain 5 dark salmon bags, 1 light indigo bag, 4 pale white bags, 5 clear olive bags. +bright olive bags contain 1 dark tan bag, 4 striped orange bags, 3 bright orange bags. +plaid plum bags contain 1 shiny maroon bag, 1 dotted coral bag. +bright chartreuse bags contain 2 wavy blue bags. diff --git a/aoc2020/7ex.txt b/aoc2020/7ex.txt new file mode 100644 index 0000000..1cec74f --- /dev/null +++ b/aoc2020/7ex.txt @@ -0,0 +1,9 @@ +light red bags contain 1 bright white bag, 2 muted yellow bags. +dark orange bags contain 3 bright white bags, 4 muted yellow bags. +bright white bags contain 1 shiny gold bag. +muted yellow bags contain 2 shiny gold bags, 9 faded blue bags. +shiny gold bags contain 1 dark olive bag, 2 vibrant plum bags. +dark olive bags contain 3 faded blue bags, 4 dotted black bags. +vibrant plum bags contain 5 faded blue bags, 6 dotted black bags. +faded blue bags contain no other bags. +dotted black bags contain no other bags. diff --git a/aoc2020/8.py b/aoc2020/8.py new file mode 100644 index 0000000..271eb6e --- /dev/null +++ b/aoc2020/8.py @@ -0,0 +1,44 @@ +with open("8.txt") as f: + ins = [] + for line in f: + ins.append(line.strip()) + +def term(ins): + f = set() + f2 = set() + acc = 0 + ip = 0 + while True: + if ip >= len(ins): + break + i = ins[ip] + if ip in f: + if ip in f2: + return None + f2.add(ip) + f.add(ip) + # print(ip, i) + c, v = i.split(" ") + v = int(v) + if c == "acc": + acc += v + elif c == "jmp": + ip = ip + v - 1 + ip += 1 + return acc + +for i in range(len(ins)): + l = ins[i] + if not (l.startswith("jmp") or l.startswith("nop")): continue + orig = l + if l.startswith("jmp"): + new = l.replace("jmp", "nop") + elif l.startswith("nop"): + new = l.replace("nop", "jmp") + ins[i] = new + r = term(ins) + if r is None: + ins[i] = orig + else: + print(r) + break diff --git a/aoc2020/8.txt b/aoc2020/8.txt new file mode 100644 index 0000000..62e61dd --- /dev/null +++ b/aoc2020/8.txt @@ -0,0 +1,634 @@ +acc +15 +acc +2 +acc -14 +jmp +362 +acc +22 +nop +236 +jmp +474 +acc +10 +jmp +1 +acc +0 +jmp +236 +acc +10 +acc +14 +jmp +334 +acc +12 +acc -1 +jmp +478 +jmp +90 +jmp +208 +acc +49 +jmp +94 +acc +2 +acc -8 +jmp +375 +nop +21 +acc +0 +acc +10 +nop +25 +jmp +492 +nop +182 +acc +49 +acc -12 +jmp -14 +acc -16 +jmp +140 +acc -3 +acc -18 +acc +28 +acc -6 +jmp +558 +acc +2 +acc +27 +nop +438 +acc +41 +jmp +508 +acc +13 +jmp +117 +acc +21 +acc -13 +acc +34 +jmp +1 +jmp +1 +nop +451 +acc +28 +acc +31 +acc +31 +jmp +280 +acc +32 +acc +35 +acc -18 +jmp +509 +acc -15 +acc -8 +nop +288 +acc -16 +jmp +376 +acc -19 +acc -8 +acc +11 +acc +10 +jmp +50 +acc +19 +nop -58 +acc -9 +jmp +43 +acc +10 +acc +2 +nop -63 +jmp +280 +acc -7 +jmp +175 +jmp +69 +acc +16 +acc +9 +acc -2 +acc -5 +jmp +276 +nop +195 +acc +50 +acc -8 +jmp -55 +nop +1 +nop -78 +acc +31 +jmp +535 +acc +9 +acc +33 +acc +4 +acc +48 +jmp +8 +acc +30 +acc +42 +acc +18 +acc +37 +jmp -69 +nop +121 +jmp +44 +acc +3 +acc +33 +acc -6 +acc +37 +jmp +403 +acc -6 +jmp +245 +jmp -93 +acc +5 +jmp +406 +jmp -26 +nop -47 +jmp +239 +acc +7 +acc +31 +acc +14 +acc +0 +jmp +291 +acc +46 +jmp +394 +acc +44 +acc +36 +nop +45 +jmp +137 +acc -16 +acc +10 +acc -4 +acc +7 +jmp +76 +acc +24 +jmp +93 +acc +17 +acc +0 +acc +6 +acc +4 +jmp +385 +acc -8 +acc +49 +acc +28 +jmp +95 +nop +12 +acc +33 +jmp +153 +nop +254 +acc +18 +acc -16 +acc +50 +jmp +299 +acc +27 +acc +47 +acc -17 +jmp -15 +acc +35 +acc +14 +jmp +204 +jmp +93 +acc +46 +nop -5 +nop -158 +jmp +221 +jmp +321 +acc -2 +acc +49 +acc +3 +acc -17 +jmp -52 +jmp +7 +nop +52 +acc +25 +jmp +376 +acc -3 +nop -133 +jmp +32 +jmp +328 +nop +374 +acc +37 +acc +6 +jmp +92 +acc +47 +nop +394 +jmp -13 +jmp -170 +acc +9 +jmp -47 +acc -18 +acc +27 +jmp +1 +acc +3 +acc -5 +jmp +337 +acc +21 +jmp +364 +acc +24 +acc +43 +acc +50 +jmp +58 +jmp -18 +acc +30 +jmp +144 +nop +5 +acc +50 +nop +245 +nop +133 +jmp +270 +jmp -22 +nop -76 +jmp +398 +acc +40 +acc +30 +jmp +361 +acc +36 +acc +30 +jmp +392 +acc -17 +nop +71 +acc -12 +jmp +102 +acc +17 +jmp +283 +acc -16 +jmp +65 +nop -2 +jmp +149 +jmp -103 +jmp -179 +acc +46 +jmp +289 +acc +48 +jmp +114 +acc +13 +jmp +114 +nop +215 +nop -89 +jmp +337 +acc -2 +acc +2 +acc -7 +jmp -18 +jmp -51 +acc +30 +acc +43 +acc +28 +jmp -188 +acc +36 +acc +7 +acc -5 +acc +38 +jmp +88 +jmp +225 +acc -14 +acc -3 +acc -15 +jmp +66 +acc +7 +acc +43 +nop -210 +acc -9 +jmp +109 +acc -10 +jmp +242 +acc -5 +acc +15 +acc +8 +jmp +310 +acc +31 +acc -2 +acc +11 +acc -15 +jmp +103 +acc +32 +jmp -92 +acc -10 +acc +6 +acc -1 +jmp -131 +acc +43 +acc +30 +acc +13 +acc +33 +jmp +25 +acc +9 +acc -14 +acc +19 +acc +44 +jmp -50 +acc -8 +acc +9 +jmp +312 +jmp -96 +acc -3 +acc -3 +acc +24 +jmp +94 +acc -15 +jmp +61 +acc +19 +nop -89 +acc +24 +nop -94 +jmp +5 +acc -13 +acc +25 +acc +42 +jmp +1 +jmp +137 +acc +44 +acc +44 +acc +41 +jmp +152 +jmp +144 +acc -1 +nop +293 +jmp -120 +acc -17 +nop -171 +acc +27 +jmp -173 +jmp +231 +acc +3 +jmp +109 +acc +18 +acc +32 +acc -14 +acc -8 +jmp +177 +acc +28 +jmp -134 +nop +277 +jmp -124 +jmp +167 +nop +274 +acc +6 +acc +43 +acc +10 +jmp -320 +acc +28 +acc -9 +acc +22 +jmp -90 +jmp -203 +jmp -133 +jmp -6 +jmp -181 +jmp +170 +acc +40 +acc +5 +jmp -274 +acc +36 +acc +24 +nop +6 +jmp -339 +jmp -251 +acc +10 +acc +10 +jmp -347 +jmp +263 +acc +37 +jmp -201 +acc -11 +acc +42 +jmp +153 +nop -179 +acc -9 +jmp +8 +jmp -289 +jmp -25 +acc +45 +jmp -142 +acc +42 +acc -10 +jmp +83 +acc +43 +acc +3 +acc -6 +jmp -222 +acc +41 +acc +14 +acc +7 +acc +2 +jmp -35 +jmp +168 +acc +11 +acc +18 +acc +8 +acc -4 +jmp -203 +acc +44 +jmp +10 +nop -184 +acc +0 +jmp +91 +acc -5 +nop +226 +acc +46 +acc -10 +jmp -15 +jmp -321 +acc +0 +acc +33 +jmp +82 +jmp +1 +acc -12 +acc +30 +jmp +152 +acc +6 +jmp -208 +acc +43 +jmp +39 +acc +23 +acc +23 +acc +24 +acc +26 +jmp -390 +acc +15 +acc +3 +acc +14 +acc +46 +jmp -239 +acc -10 +acc +19 +jmp +167 +acc +46 +acc +0 +jmp -280 +acc -7 +jmp -107 +acc +13 +jmp -76 +acc +48 +jmp -65 +nop +23 +nop -89 +acc +47 +jmp -304 +acc -5 +jmp +1 +acc +50 +acc +37 +jmp -129 +acc +27 +jmp +1 +jmp -212 +acc +18 +acc +29 +acc +1 +jmp -74 +acc +24 +acc -12 +jmp -173 +acc -18 +acc -6 +nop -156 +jmp -309 +acc +46 +acc -13 +acc +41 +acc +11 +jmp -188 +acc +32 +jmp -190 +acc +31 +acc +30 +jmp -122 +acc -7 +jmp +37 +acc +2 +acc +16 +acc +45 +acc +44 +jmp -376 +acc +47 +jmp +1 +jmp -147 +acc +47 +acc -18 +acc -1 +acc +2 +jmp -152 +acc +12 +acc -8 +jmp +90 +nop +67 +acc +9 +jmp +1 +jmp -377 +jmp +1 +jmp -238 +jmp +1 +acc +47 +acc +7 +acc +31 +jmp -427 +acc +10 +acc +13 +nop +13 +jmp -8 +nop -292 +acc +11 +nop -203 +jmp -164 +jmp -19 +acc +31 +jmp -289 +acc -7 +acc -16 +acc +35 +jmp -333 +jmp -500 +acc +32 +acc +29 +acc +18 +acc +14 +jmp -161 +jmp -60 +jmp +6 +acc +4 +nop -108 +acc +27 +jmp +2 +jmp -133 +acc +2 +jmp -103 +acc +40 +nop -512 +acc +48 +jmp -196 +acc +47 +acc +40 +nop -346 +acc -2 +jmp -530 +acc +17 +nop -31 +acc +1 +jmp -74 +acc -15 +acc +4 +nop -330 +acc +32 +jmp -115 +acc -3 +jmp +1 +acc +14 +acc +31 +jmp -352 +jmp -10 +acc +18 +jmp -322 +acc +41 +jmp +59 +acc -16 +nop -359 +acc +29 +acc +26 +jmp -418 +acc +10 +acc +47 +jmp -519 +acc -5 +nop +40 +acc +30 +jmp -195 +acc +31 +acc +3 +acc +8 +jmp -10 +acc -12 +acc +21 +acc -1 +jmp +30 +jmp -341 +acc -5 +jmp -405 +acc -13 +jmp -170 +acc +24 +acc -16 +acc +20 +acc +17 +jmp -145 +acc +42 +acc +33 +jmp -395 +nop -142 +acc +45 +acc +15 +jmp -399 +nop -223 +jmp -299 +jmp -453 +acc -6 +nop -498 +acc +42 +jmp -112 +acc +39 +acc +46 +acc +4 +acc +27 +jmp -234 +jmp +1 +acc +45 +acc +47 +jmp -307 +jmp -378 +jmp -431 +acc +13 +acc +29 +jmp -282 +acc +4 +acc -3 +acc +37 +acc +40 +jmp -32 +nop -148 +acc +38 +acc +40 +acc +18 +jmp -171 +nop -546 +jmp -490 +acc +36 +jmp -514 +acc +27 +acc -10 +nop -560 +acc +44 +jmp +1 diff --git a/aoc2020/8ex.txt b/aoc2020/8ex.txt new file mode 100644 index 0000000..178df53 --- /dev/null +++ b/aoc2020/8ex.txt @@ -0,0 +1,9 @@ +nop +0 +acc +1 +jmp +4 +acc +3 +jmp -3 +acc -99 +acc +1 +jmp -4 +acc +6 diff --git a/aoc2020/9.py b/aoc2020/9.py new file mode 100644 index 0000000..f797901 --- /dev/null +++ b/aoc2020/9.py @@ -0,0 +1,53 @@ +import itertools + +prev=None +sums = dict() +ns = [] +with open("9.txt") as f: + for i in range(25): + ns.append(int(f.readline().strip())) + for a in ns: + for b in ns: + if a == b: continue + if a not in sums: sums[a] = set() + sums[a].add(a + b) + + for line in f: + n = int(line.strip()) + for v in sums.values(): + if n in v: + break + else: + print("NOT", n) + bad = n + break + fi = ns[0] + del sums[fi] + ns.pop(0) + sums[n] = set() + for a in ns: + sums[n].add(a + n) + ns.append(n) + + +with open("9.txt") as f: + ns = [] + for line in f: + n = int(line.strip()) + ns.append(n) + + for a in range(len(ns)-1): + running = ns[a] + found = False + for b in range(a+1, len(ns)): + running+=ns[b] + if running==bad: + r = ns[a:b+1] + print(bad, sum(r), min(r)+max(r), r) + found = True + elif running > bad: + break + #print(a, running, ns[a:b]) + if found: break + + diff --git a/aoc2020/9.txt b/aoc2020/9.txt new file mode 100644 index 0000000..8246acc --- /dev/null +++ b/aoc2020/9.txt @@ -0,0 +1,1000 @@ +12 +6 +33 +7 +21 +32 +30 +37 +26 +34 +18 +3 +49 +1 +11 +24 +15 +16 +4 +20 +5 +25 +31 +10 +40 +9 +13 +36 +17 +6 +58 +19 +32 +81 +33 +12 +18 +41 +7 +14 +11 +21 +27 +15 +16 +20 +90 +35 +22 +68 +23 +24 +26 +38 +42 +25 +29 +47 +56 +19 +28 +103 +31 +18 +30 +32 +46 +43 +66 +34 +45 +37 +40 +50 +41 +51 +44 +48 +85 +81 +49 +52 +59 +53 +47 +80 +55 +58 +61 +120 +73 +71 +96 +181 +92 +77 +101 +84 +88 +89 +91 +103 +97 +99 +189 +100 +289 +141 +102 +105 +113 +116 +119 +150 +190 +162 +193 +161 +200 +165 +178 +188 +381 +177 +180 +191 +196 +197 +199 +216 +202 +281 +316 +299 +218 +229 +235 +417 +326 +323 +343 +338 +349 +355 +356 +375 +357 +368 +393 +379 +755 +428 +401 +437 +724 +420 +447 +597 +746 +713 +783 +558 +649 +975 +666 +804 +687 +704 +711 +1403 +725 +736 +830 +772 +780 +821 +829 +1241 +857 +1268 +1487 +1224 +1283 +1517 +1207 +1294 +1245 +1873 +1484 +1370 +1412 +1391 +1966 +1436 +1461 +1497 +2653 +1629 +1650 +2297 +2102 +2290 +4587 +2151 +2431 +3090 +3357 +2452 +2730 +2539 +2615 +2636 +2761 +3702 +3780 +3463 +2827 +2897 +2933 +2958 +5213 +3279 +4102 +4742 +4253 +6237 +4690 +5385 +5557 +4883 +4991 +6599 +8776 +5154 +5175 +5397 +7211 +6360 +5724 +5760 +5785 +12145 +9136 +5891 +7060 +12415 +9256 +8985 +10668 +10268 +10776 +10440 +9874 +10037 +10145 +19014 +10329 +10551 +10572 +10899 +11121 +16296 +11484 +11509 +17375 +20880 +15928 +21228 +12951 +17328 +19022 +18241 +18859 +19911 +20019 +20936 +20182 +21358 +27437 +20696 +22020 +20901 +22383 +21471 +22630 +39142 +40330 +22993 +24460 +28879 +34179 +31810 +30279 +67767 +35569 +48898 +37100 +38770 +106909 +43079 +42829 +57172 +43326 +41597 +42716 +42372 +44464 +43854 +44101 +53339 +47453 +51872 +53272 +58639 +67379 +74133 +111911 +65848 +78648 +85698 +81486 +75870 +81142 +84676 +83969 +85201 +89825 +84313 +85088 +86226 +133679 +87955 +100725 +91554 +119251 +146027 +119120 +120651 +170899 +147334 +139981 +141718 +149817 +154518 +161071 +169441 +250896 +185401 +168282 +169057 +173043 +179509 +169401 +255987 +289708 +192279 +341325 +371788 +264597 +266454 +411967 +239771 +275169 +281699 +311159 +354458 +304335 +521470 +315589 +605297 +473776 +408053 +348566 +361680 +412814 +590758 +454678 +409172 +432050 +467448 +531051 +616494 +539766 +675626 +506225 +761241 +720331 +556868 +586034 +757738 +619924 +652901 +761380 +844864 +867492 +710246 +756619 +774494 +770852 +821986 +841222 +863850 +1514357 +1615716 +973673 +1156260 +1045991 +1126149 +1520393 +1063093 +1142902 +1176792 +1698892 +1545346 +1330170 +1394418 +1363147 +1466865 +1481098 +1484740 +1984124 +3030086 +1592838 +1989999 +1663208 +2560348 +2643657 +2303843 +2019664 +2036766 +2109084 +2172140 +2205995 +2239885 +2965838 +2319694 +2769630 +2693317 +2947963 +3256046 +2830012 +2844245 +3701922 +3869203 +4128748 +4093208 +6667760 +4229884 +4056430 +4878714 +4802401 +4145850 +6334743 +7571125 +5016385 +4281224 +4445880 +7008396 +5009515 +6448442 +9246269 +5462947 +8315083 +5674257 +6100291 +14415374 +6546167 +7758352 +9162235 +9083625 +8375734 +8202280 +8337654 +8427074 +10479332 +8591730 +8727104 +9297609 +9290739 +13858643 +9455395 +9908827 +16794010 +13221299 +11563238 +12646458 +11137204 +11774548 +12220424 +14302571 +14304519 +14748447 +25865809 +22680253 +16578014 +27525818 +19206436 +16764728 +17717813 +17318834 +17882469 +18753004 +18588348 +18746134 +21046031 +19364222 +21472065 +22700442 +28352562 +22911752 +45117290 +29492361 +23994972 +26522995 +32067281 +43359194 +44405464 +33342742 +34083562 +35784450 +36128950 +34482541 +35600282 +35201303 +45467037 +37334482 +37952570 +39634379 +38110356 +67602717 +40836287 +57182983 +45612194 +73710638 +46906724 +56062253 +59865737 +78946643 +58590276 +65410023 +68566103 +67426304 +91933018 +95696632 +69683844 +70082823 +70801585 +72934764 +72535785 +75287052 +160499121 +76062926 +77744735 +95293339 +124651459 +100702024 +105497000 +101674447 +184517196 +102968977 +137945808 +144970896 +124000299 +126016580 +135492846 +180713712 +145746770 +142618608 +198951344 +142219629 +334444190 +143337370 +170580391 +175989076 +151349978 +153807661 +171356265 +173038074 +195995363 +383468540 +280165437 +526805910 +422385066 +245188606 +226969276 +250016879 +259493145 +261509426 +371989418 +396538584 +284838237 +285556999 +472157882 +258585477 +293569607 +349803024 +294687348 +305157639 +539875954 +322706243 +415317087 +644977966 +400007350 +422964639 +508602356 +563743116 +672401945 +476986155 +544704227 +1016862109 +543586486 +518078622 +1103619070 +880591774 +543423714 +590714638 +544142476 +949144037 +552155084 +1235692604 +1029141239 +710004435 +627863882 +815324437 +722713593 +822971989 +1027871232 +876993505 +931566995 +985588511 +1061665108 +1020572641 +1474990709 +1406039075 +1062221098 +1061502336 +1070233706 +1096297560 +1087566190 +1095578798 +1134857114 +1172006358 +1337868317 +1367479521 +2182803958 +1754538984 +1964559695 +1350577475 +1599707098 +2162728346 +1850843221 +1808560500 +1862582016 +2149787288 +2073154701 +2082074977 +2082793739 +2222423304 +3259025906 +2123723434 +4306527392 +2165812504 +6115087892 +2183144988 +2472725431 +2306863472 +2509874675 +2705347838 +3213159491 +4037714396 +3408267598 +2950284573 +3201420696 +3450550319 +3881715201 +3890635477 +4085005320 +3935736717 +4155229678 +4155948440 +4304498281 +4206517173 +4289535938 +5906768534 +4306868422 +5616362823 +4348957492 +4490008460 +6994883776 +6358552171 +4816738147 +8225005745 +7137157413 +6151705269 +6400834892 +9315036132 +7440293033 +6651971015 +8752474864 +7772350678 +7826372194 +9905898761 +10707509663 +10113285707 +8462816862 +8511015454 +8496053111 +8779544398 +9123606569 +8655825914 +13472564061 +17885636385 +9306746607 +10968443416 +12257031180 +17133118801 +15599974275 +14896888003 +14904180133 +14478343209 +15162986469 +14092264048 +14424321693 +17007068565 +15598722872 +17118642776 +23215870617 +22871808446 +30078317484 +16958869973 +26265616580 +23552713917 +25738414371 +18430353176 +17962572521 +22779310668 +20275190023 +21563777787 +25392765109 +26349295228 +28516585741 +28570607257 +29382523342 +33334533309 +28902664902 +29255250517 +29690986920 +44501387774 +48610222817 +51786477874 +34077512749 +34921442494 +35389223149 +36392925697 +37234059996 +39994130963 +77835921083 +38237762544 +38705543199 +39526350308 +41838967810 +66065165561 +46956542896 +51742060337 +66754348285 +57087192998 +57473272159 +58637773859 +106083494976 +65080210069 +58946237437 +78231893507 +68998955243 +69466735898 +70310665643 +176394160619 +77228190959 +71782148846 +73626985693 +75471822540 +76943305743 +77764112852 +96178815358 +91268410645 +100785205247 +132573223130 +120583528589 +98698603233 +125369046030 +167539553532 +114560465157 +129255421005 +117584011296 +124026447506 +190894194232 +128412973335 +198347641441 +197811719548 +161579076288 +167960964204 +145409134539 +147253971386 +204727243545 +149098808233 +152415128283 +294507942772 +195348124148 +187447226003 +229198178582 +199483808480 +213259068390 +319374571654 +308478205528 +232144476453 +253281868511 +238586912663 +281670549288 +241610458802 +292663105925 +467785091245 +277511781568 +339862354286 +296352779619 +297824262822 +428681987062 +299669099669 +301513936516 +519122240370 +391002040946 +405696996794 +419591702456 +424546302730 +386931034483 +737160192590 +412742876870 +445403544843 +667268899725 +470731389116 +772245325632 +534952417799 +480197371465 +534273564727 +537963238421 +577180881237 +1001727183967 +573864561187 +594177042441 +599338199338 +597493362491 +601183036185 +686600134152 +688444970999 +777933075429 +796699037740 +792628031277 +962509541151 +1349440575634 +960795595670 +916134933959 +983366783264 +1077690733956 +1371583524970 +1005004953843 +1285938333490 +1014470936192 +1018160609886 +1578908065204 +1111827799608 +1370563598927 +2078566364767 +1168041603628 +1191670404932 +1284093496643 +1198676398676 +1738728671099 +1589327069017 +1466378046428 +1889760875037 +2375607102944 +2332379120640 +3260324473964 +1975266531862 +2980271485705 +1899501717223 +2449274258926 +2019475890035 +2116832753451 +2023165563729 +2186202213514 +2206141341124 +3168235134221 +2279869403236 +2310504198284 +2359712008560 +3143308135490 +2366718002304 +3558388407236 +3650811498947 +2665054445104 +3055705115445 +3489543610157 +3672519387552 +4205678103549 +3874768249085 +3918977607258 +3922667280952 +3994742421897 +5720759560549 +4348775976149 +4476544762011 +5789352141003 +7573478779899 +4496706411798 +4466071616750 +4486010744360 +4670216206844 +9440163639950 +5422423117749 +4726430010864 +6614093522681 +6572396105853 +6154598055261 +12059489524259 +9715501982446 +6545248725602 +7162062997709 +13788939616099 +14192046744457 +8491448833695 +7841644888210 +7917409702849 +9771199093898 +8962555506371 +8962778028548 +8942616378761 +9166922618642 +9192501627614 +11888493008573 +8952082361110 +15737750353216 +10092639324593 +10148853128613 +12036516640430 +10881028066125 +12699846780863 +15515012484614 +13316661052970 +16877564980155 +16114145358819 +20617256483712 +15003707885919 +15759054591059 +16784261266971 +18129700647190 +17925333534919 +25820181358916 +17894698739871 +17905171885132 +17914860389658 +18109538997403 +18119004979752 +18144583988724 +19044721685703 +36132268968326 +20241492453206 +20973667390718 +30166217287620 +36049755873856 +26016507833833 +29484108047834 +29430806411789 +28320368938889 +30762762476978 +31117853244738 +31787969152890 +33653753330930 +33664226476191 +34678960006842 +35799870625003 +47603113027586 +35809559129529 +36014710882535 +67597528282419 +36033865369410 +73619620861419 +38360497432958 +57804476986723 +48561861392095 +61284070532358 +50404473802507 +46990175224551 +69478350677696 +66927412374267 +62999328945731 +74160368057961 +57751175350678 +62905822397628 +61880615721716 +81267339503777 +65441722483820 diff --git a/aoc2020/p15.nim b/aoc2020/p15.nim new file mode 100644 index 0000000..a6d54fa --- /dev/null +++ b/aoc2020/p15.nim @@ -0,0 +1,33 @@ +import tables + +iterator play(start: seq[int]): int = + var spoke = initTable[int, int]() + var turn = 0 + var nextSpeak = 0 + + for i in start: + turn += 1 + spoke[i] = turn + yield i + nextSpeak = 0 + + while true: + turn += 1 + yield nextSpeak + var lastSpoke = spoke.getOrDefault(nextSpeak, -1) + spoke[nextSpeak] = turn + + if lastSpoke == -1: + nextSpeak = 0 + else: + nextSpeak = turn - lastSpoke + +proc solve(s: seq[int], n: int): int = + var i = 0 + for x in play(s): + inc i + if i == n: + echo x + break + +echo solve(@[5,1,9,18,13,8,0], 30000000) diff --git a/aoc2021/2.py b/aoc2021/2.py new file mode 100644 index 0000000..2570a4a --- /dev/null +++ b/aoc2021/2.py @@ -0,0 +1,35 @@ +with open("2.txt") as f: + data = f.read() +with open("2.txt") as f: + lines = list(map(lambda s: s.rstrip(), f.readlines())) + +x = 0 +y = 0 +for line in lines: + if not line: continue + p = line.split(" ") + n = int(p[1]) + if p[0] == "forward": + x += n + elif p[0] == "down": + y += n + elif p[0] == "up": + y -= n + +print(x * y) + +x = 0 +y = 0 +aim = 0 +for line in lines: + if not line: continue + p = line.split(" ") + n = int(p[1]) + if p[0] == "forward": + x += n + y += aim * n + elif p[0] == "down": + aim += n + elif p[0] == "up": + aim -= n +print(x * y) diff --git a/aoc2021/2.txt b/aoc2021/2.txt new file mode 100644 index 0000000..ea580b6 --- /dev/null +++ b/aoc2021/2.txt @@ -0,0 +1,1001 @@ +forward 9 +forward 9 +forward 3 +down 2 +forward 8 +down 8 +forward 1 +down 6 +down 9 +down 9 +forward 1 +up 5 +up 4 +up 8 +down 6 +down 7 +forward 4 +forward 6 +forward 2 +forward 2 +forward 4 +down 2 +down 6 +forward 6 +forward 9 +up 4 +up 6 +down 2 +forward 7 +up 7 +down 8 +down 4 +down 6 +forward 1 +down 2 +up 1 +forward 8 +down 9 +forward 6 +up 9 +down 8 +forward 5 +forward 8 +down 8 +up 3 +up 9 +down 2 +down 2 +forward 5 +up 7 +forward 5 +down 6 +forward 4 +down 2 +up 2 +up 7 +up 1 +down 4 +down 8 +forward 6 +down 2 +forward 7 +down 1 +forward 7 +forward 1 +up 1 +down 4 +down 3 +down 4 +down 4 +up 8 +down 1 +up 7 +forward 8 +down 5 +up 1 +down 4 +down 3 +forward 4 +up 7 +forward 1 +down 4 +down 2 +down 4 +up 8 +up 6 +down 1 +up 3 +down 5 +forward 4 +down 3 +forward 9 +down 9 +forward 2 +down 4 +up 3 +down 4 +forward 1 +forward 7 +forward 9 +forward 7 +forward 3 +forward 6 +down 4 +forward 7 +down 5 +down 1 +forward 7 +up 1 +down 8 +down 7 +down 7 +down 7 +down 3 +forward 4 +forward 6 +forward 6 +forward 1 +down 7 +down 6 +down 8 +up 5 +down 7 +up 6 +forward 9 +down 7 +down 1 +down 9 +forward 8 +up 5 +down 6 +forward 3 +up 2 +down 1 +forward 2 +down 3 +up 6 +forward 8 +forward 1 +forward 3 +down 9 +forward 1 +down 3 +up 7 +forward 8 +up 8 +down 7 +down 2 +forward 3 +up 7 +forward 6 +down 7 +down 6 +up 5 +forward 9 +down 7 +up 5 +forward 6 +up 5 +up 6 +forward 6 +down 8 +down 1 +forward 7 +forward 6 +down 5 +down 6 +forward 9 +down 6 +up 5 +forward 9 +forward 4 +down 1 +forward 5 +down 4 +forward 5 +forward 1 +down 1 +forward 4 +down 5 +forward 4 +up 8 +down 1 +forward 6 +down 5 +forward 8 +forward 8 +forward 5 +down 7 +down 4 +forward 4 +up 1 +up 8 +down 6 +up 5 +forward 6 +forward 5 +forward 9 +down 3 +down 5 +forward 3 +down 6 +forward 6 +up 7 +up 6 +down 6 +down 1 +forward 8 +forward 9 +up 5 +forward 8 +forward 9 +forward 9 +down 2 +down 8 +forward 8 +down 2 +up 8 +down 2 +down 2 +up 1 +down 5 +down 6 +down 1 +down 8 +down 9 +forward 3 +forward 2 +down 6 +up 8 +forward 9 +forward 7 +forward 1 +down 8 +up 8 +forward 8 +down 5 +down 3 +up 3 +forward 6 +forward 5 +down 4 +forward 4 +down 4 +forward 5 +forward 9 +forward 2 +forward 9 +down 1 +down 3 +down 6 +forward 6 +down 7 +forward 3 +forward 4 +forward 1 +down 6 +forward 1 +forward 4 +forward 2 +forward 2 +forward 1 +forward 2 +down 1 +up 2 +forward 1 +down 3 +forward 8 +down 3 +down 9 +forward 5 +down 3 +down 3 +forward 2 +forward 9 +down 9 +forward 4 +down 2 +forward 5 +up 8 +down 4 +forward 5 +down 1 +forward 9 +down 1 +forward 7 +forward 2 +down 2 +down 6 +up 3 +forward 7 +up 4 +forward 7 +forward 6 +down 8 +forward 2 +down 3 +forward 9 +forward 4 +forward 8 +down 6 +forward 8 +down 9 +down 2 +down 3 +forward 1 +down 5 +down 3 +forward 2 +forward 7 +down 4 +down 3 +forward 9 +down 2 +forward 2 +forward 1 +up 6 +up 4 +down 5 +forward 5 +up 8 +down 7 +forward 6 +down 5 +forward 3 +forward 3 +forward 7 +up 9 +up 6 +down 5 +up 7 +forward 2 +forward 5 +down 9 +down 6 +forward 7 +down 9 +up 2 +up 5 +forward 1 +forward 8 +forward 9 +up 8 +forward 9 +forward 5 +up 9 +down 4 +down 7 +forward 2 +forward 1 +down 4 +up 8 +down 5 +down 7 +down 9 +down 3 +down 9 +up 8 +up 7 +up 8 +down 8 +down 2 +down 6 +down 6 +up 5 +up 9 +forward 1 +down 8 +up 4 +up 3 +forward 7 +up 7 +down 3 +up 1 +forward 3 +down 7 +forward 8 +forward 2 +down 6 +down 2 +up 7 +up 5 +forward 7 +forward 1 +forward 6 +up 6 +forward 5 +down 2 +up 4 +forward 2 +down 9 +forward 6 +forward 3 +forward 3 +forward 4 +forward 2 +down 6 +forward 9 +forward 7 +down 4 +up 1 +forward 4 +down 6 +down 6 +up 1 +up 1 +forward 3 +down 5 +up 5 +down 3 +down 6 +up 8 +down 2 +up 6 +up 1 +forward 8 +up 6 +down 8 +forward 9 +forward 4 +forward 9 +down 7 +down 9 +down 6 +down 1 +forward 9 +forward 9 +down 6 +down 5 +up 6 +down 9 +up 4 +up 5 +forward 8 +down 4 +down 5 +forward 8 +forward 7 +down 2 +forward 2 +forward 6 +forward 7 +down 1 +down 7 +down 1 +down 6 +forward 2 +up 2 +down 4 +down 8 +forward 1 +down 1 +down 3 +down 3 +up 9 +down 9 +forward 3 +up 4 +forward 1 +down 9 +down 8 +down 9 +forward 5 +forward 4 +up 3 +down 8 +forward 2 +down 3 +up 5 +forward 4 +down 7 +down 8 +down 9 +forward 8 +down 8 +forward 4 +down 6 +down 3 +forward 5 +down 3 +down 9 +down 4 +up 8 +forward 4 +up 6 +down 3 +forward 6 +down 9 +down 7 +forward 7 +forward 3 +forward 2 +forward 4 +down 4 +down 5 +up 9 +down 2 +down 6 +down 9 +forward 7 +forward 3 +up 3 +forward 3 +down 4 +down 7 +forward 2 +down 2 +forward 3 +down 8 +down 7 +down 7 +forward 2 +forward 2 +up 6 +forward 8 +forward 9 +up 3 +forward 8 +forward 5 +forward 7 +up 3 +forward 3 +forward 6 +down 5 +down 5 +down 4 +forward 1 +forward 8 +forward 4 +forward 3 +down 1 +forward 8 +down 4 +up 5 +forward 4 +down 2 +forward 7 +down 2 +forward 9 +down 1 +forward 6 +forward 8 +forward 6 +forward 7 +forward 1 +forward 6 +down 5 +up 3 +forward 7 +down 6 +forward 2 +down 2 +forward 8 +forward 9 +up 7 +forward 1 +forward 1 +up 1 +forward 1 +down 2 +forward 6 +down 9 +up 1 +up 2 +forward 6 +forward 1 +forward 7 +down 1 +up 8 +forward 7 +up 6 +up 4 +down 1 +forward 2 +down 4 +down 1 +down 7 +down 4 +up 3 +forward 8 +forward 3 +forward 5 +down 7 +down 8 +forward 5 +forward 2 +down 5 +down 2 +forward 2 +up 9 +down 3 +down 5 +up 7 +down 4 +down 2 +down 7 +forward 6 +down 2 +forward 1 +up 4 +forward 2 +forward 2 +down 5 +down 1 +down 1 +forward 7 +forward 6 +down 7 +down 5 +up 1 +up 3 +forward 3 +forward 9 +forward 4 +down 1 +down 5 +forward 3 +forward 7 +down 8 +forward 8 +forward 2 +forward 7 +up 7 +down 7 +down 4 +down 2 +up 6 +up 1 +forward 8 +up 8 +up 6 +down 8 +forward 1 +down 5 +forward 3 +down 3 +down 3 +forward 1 +up 3 +up 3 +forward 8 +forward 8 +down 8 +forward 6 +forward 2 +down 7 +forward 8 +down 7 +up 5 +forward 7 +down 1 +forward 9 +up 6 +down 2 +up 2 +up 5 +forward 6 +forward 9 +forward 3 +down 8 +forward 8 +down 2 +up 5 +down 9 +forward 5 +down 6 +down 3 +down 9 +up 8 +up 3 +down 2 +forward 7 +forward 4 +forward 4 +forward 8 +up 6 +up 4 +forward 9 +down 6 +down 8 +up 3 +up 5 +forward 8 +forward 7 +forward 4 +down 8 +forward 1 +forward 5 +down 9 +forward 8 +up 6 +down 6 +down 8 +down 2 +forward 4 +forward 9 +forward 2 +forward 7 +down 3 +forward 3 +up 6 +down 4 +forward 2 +up 4 +down 4 +forward 4 +forward 3 +forward 1 +up 6 +forward 1 +down 1 +forward 7 +up 4 +forward 3 +down 4 +up 6 +up 2 +up 8 +down 1 +down 6 +down 6 +down 1 +down 7 +forward 8 +down 9 +forward 5 +up 2 +up 7 +up 5 +down 6 +up 1 +up 6 +forward 4 +down 7 +forward 5 +forward 1 +down 6 +forward 2 +down 2 +forward 9 +down 9 +up 6 +forward 1 +up 7 +down 7 +forward 1 +down 6 +up 1 +forward 2 +forward 1 +down 4 +forward 9 +forward 7 +forward 5 +down 1 +forward 2 +down 2 +down 2 +down 5 +forward 1 +up 8 +forward 9 +down 7 +forward 9 +down 2 +up 5 +down 9 +down 8 +down 5 +forward 8 +forward 4 +down 4 +down 6 +forward 1 +down 5 +up 6 +down 3 +down 3 +forward 9 +down 9 +forward 6 +down 5 +up 6 +down 5 +up 7 +forward 9 +down 2 +down 4 +down 8 +forward 4 +up 7 +forward 9 +forward 7 +up 5 +down 7 +down 5 +down 1 +forward 5 +forward 4 +down 2 +up 3 +forward 1 +up 4 +up 9 +down 4 +forward 3 +down 4 +down 9 +forward 4 +up 2 +up 3 +forward 7 +up 6 +down 8 +down 8 +forward 6 +forward 2 +forward 3 +forward 9 +forward 7 +down 6 +down 7 +down 4 +down 2 +forward 8 +down 6 +forward 6 +forward 6 +forward 9 +down 8 +down 1 +up 5 +down 1 +forward 9 +down 1 +up 8 +forward 8 +down 3 +forward 1 +down 9 +forward 6 +forward 4 +forward 8 +down 2 +up 8 +down 2 +up 8 +down 9 +down 4 +up 7 +forward 7 +forward 5 +down 5 +down 4 +up 8 +forward 1 +down 7 +forward 1 +up 9 +forward 9 +forward 7 +forward 9 +down 9 +forward 4 +down 7 +forward 6 +forward 6 +up 3 +forward 2 +down 5 +up 8 +down 1 +up 8 +down 4 +down 1 +up 6 +forward 4 +forward 3 +forward 6 +down 3 +forward 4 +forward 4 +forward 4 +down 8 +forward 3 +up 8 +up 8 +down 8 +forward 6 +forward 8 +up 5 +forward 6 +down 8 +down 7 +up 4 +forward 6 +forward 9 +down 9 +forward 4 +up 2 +forward 1 +up 3 +down 9 +down 8 +forward 8 +forward 8 +forward 7 +down 6 +down 1 +up 6 +up 6 +forward 9 +forward 7 +forward 7 +down 3 +down 6 +down 9 +down 4 +forward 7 +forward 3 +forward 3 +down 7 +up 5 +down 3 +forward 6 +forward 3 +forward 5 +up 3 +down 7 +forward 2 +up 7 +forward 9 +down 3 +down 9 +forward 8 +forward 5 +up 7 +up 2 +up 8 +forward 6 +down 8 +forward 2 +forward 4 +up 2 +forward 2 +forward 8 +forward 4 +down 8 +forward 5 +down 4 +down 7 +forward 3 +down 3 +up 1 +down 9 +forward 9 +down 2 +down 1 +forward 1 +down 6 +down 3 +forward 5 +down 3 +down 8 +up 7 +down 1 +up 9 +down 4 +forward 9 +down 4 +forward 3 +forward 6 +down 3 +forward 3 +down 2 +down 7 +down 1 +up 4 +down 9 +down 1 +down 3 +down 4 +down 8 +down 7 +forward 4 +down 4 +down 9 +forward 2 +forward 7 +forward 2 +down 6 +up 8 +forward 6 +down 2 +forward 6 +up 8 +forward 6 +down 9 +forward 2 +forward 6 +