From 35f21f5b5bbb8251cd213c8638306f1830f0cb73 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Tue, 1 Dec 2020 00:00:04 -0800 Subject: [PATCH 01/52] Initial setup and day1 --- .gitignore | 2 + 2020/Makefile | 10 +++ 2020/day1.cpp | 79 +++++++++++++++++++ 2020/day1.input | 200 ++++++++++++++++++++++++++++++++++++++++++++++++ 2020/types.cpp | 47 ++++++++++++ 2020/types.hpp | 70 +++++++++++++++++ LICENSE | 21 +++++ README.md | 3 + 8 files changed, 432 insertions(+) create mode 100644 .gitignore create mode 100644 2020/Makefile create mode 100644 2020/day1.cpp create mode 100644 2020/day1.input create mode 100644 2020/types.cpp create mode 100644 2020/types.hpp create mode 100644 LICENSE create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1a8f3a8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +out/ +*.out diff --git a/2020/Makefile b/2020/Makefile new file mode 100644 index 0000000..fe418f1 --- /dev/null +++ b/2020/Makefile @@ -0,0 +1,10 @@ +day1.out: out/types.o day1.cpp day1.input + g++ $(flags) day1.cpp out/types.o -o $@ + +out/types.o: types.hpp types.cpp + mkdir -p out/ + g++ $(flags) -c types.cpp -o $@ + +.PHONY: clean +clean: + rm out/* day*.out diff --git a/2020/day1.cpp b/2020/day1.cpp new file mode 100644 index 0000000..a9a028c --- /dev/null +++ b/2020/day1.cpp @@ -0,0 +1,79 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include + +#include "types.hpp" + +// Find 2 numbers that sum to 2020 +auto find_2020_x2(const std::vector & list) -> void { + auto begin = 0; + auto end = list.size() - 1; + auto sum = 0; + while ((sum = list[begin] + list[end]) != 2020) { + if (sum < 2020) { + ++begin; + } else { + --end; + } + } + std::cout << (list[begin] * list[end]) << std::endl; +} + +// Find 3 numbers that sum to 2020 +auto find_2020_x3(const std::vector & list) -> void { + for (auto n0 = 0; n0 < list.size() - 2; ++n0) { + for (auto n1 = 1; n1 < list.size() - 1; ++n1) { + for (auto n2 = 2; n2 < list.size(); ++n2) { + if (list[n0] + list[n1] + list[n2] == 2020) { + std::cout << (list[n0] * list[n1] * list[n2]) << std::endl; + return; + } + } + } + } +} + +i32 main(i32 argc, char * argv[]) { + auto list = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("day1.input"); + while (getline(file, line)) { + list.push_back(std::stoi(line)); + } + } + std::sort(list.begin(), list.end()); + + find_2020_x2(list); + find_2020_x3(list); + + return 0; +} diff --git a/2020/day1.input b/2020/day1.input new file mode 100644 index 0000000..3bea509 --- /dev/null +++ b/2020/day1.input @@ -0,0 +1,200 @@ +1587 +1407 +1717 +1596 +1566 +1752 +1925 +1847 +1716 +1726 +1611 +1628 +1853 +1864 +1831 +1942 +1634 +1964 +1603 +1676 +1256 +1906 +1655 +1790 +1666 +1470 +1540 +1544 +1100 +1447 +1384 +1464 +1651 +1572 +907 +1653 +1265 +1510 +1639 +1818 +376 +1378 +1132 +1750 +1491 +1788 +1882 +1779 +1640 +1586 +1525 +1458 +1994 +1782 +1412 +1033 +1416 +1813 +1520 +1968 +715 +1396 +1745 +1506 +1024 +1798 +1870 +1615 +1957 +1718 +1349 +1983 +1387 +1738 +1588 +1321 +1160 +1907 +1861 +1940 +1475 +2004 +1852 +1760 +1608 +1028 +1820 +1495 +1811 +1737 +1417 +1316 +1087 +1803 +1595 +1346 +1971 +1692 +1678 +1330 +1480 +1097 +1898 +1973 +1567 +1733 +1336 +1381 +1327 +1670 +1436 +1989 +1334 +89 +1862 +1715 +1743 +1967 +1765 +1402 +1729 +1749 +1671 +1196 +1650 +1089 +1814 +1783 +1225 +1823 +1746 +2009 +1886 +1748 +1481 +1739 +1912 +1663 +1668 +1314 +1594 +705 +1449 +1731 +1487 +1648 +1466 +1317 +1979 +1799 +1926 +1703 +1656 +1978 +2005 +1865 +1982 +1951 +1892 +1713 +1744 +1598 +1606 +1583 +1895 +1804 +1430 +1816 +1364 +1575 +1918 +1431 +1812 +1471 +1797 +928 +1934 +1156 +94 +1563 +1909 +1453 +1392 +1427 +1819 +1524 +1695 +1866 +2008 +1413 +1698 +1051 +1707 +1904 +1681 +1541 +1621 +1421 +1809 +1576 diff --git a/2020/types.cpp b/2020/types.cpp new file mode 100644 index 0000000..cc4d3da --- /dev/null +++ b/2020/types.cpp @@ -0,0 +1,47 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include "types.hpp" + +constexpr auto operator "" _u8 (unsigned long long int num) noexcept -> u8 { return u8(num); } +constexpr auto operator "" _i8 (unsigned long long int num) noexcept -> i8 { return u8(num); } +constexpr auto operator "" _u16 (unsigned long long int num) noexcept -> u16 { return u16(num); } +constexpr auto operator "" _i16 (unsigned long long int num) noexcept -> i16 { return i16(num); } +constexpr auto operator "" _u32 (unsigned long long int num) noexcept -> u32 { return u32(num); } +constexpr auto operator "" _i32 (unsigned long long int num) noexcept -> i32 { return i32(num); } +constexpr auto operator "" _u64 (unsigned long long int num) noexcept -> u64 { return u64(num); } +constexpr auto operator "" _i64 (unsigned long long int num) noexcept -> i64 { return i64(num); } +constexpr auto operator "" _usize(unsigned long long int num) noexcept -> usize { return usize(num); } + +constexpr auto operator "" _c8 (char c) noexcept -> c8 { return c8(c); } +constexpr auto operator "" _c16(char c) noexcept -> c16 { return c16(c); } +constexpr auto operator "" _c32(char c) noexcept -> c32 { return c32(c); } +constexpr auto operator "" _c8 (unsigned long long int c) noexcept -> c8 { return c8(c); } +constexpr auto operator "" _c16(unsigned long long int c) noexcept -> c16 { return c16(c); } +constexpr auto operator "" _c32(unsigned long long int c) noexcept -> c32 { return c32(c); } + +constexpr auto operator "" _f32(long double num) noexcept -> f32 { return (f32) num; } +constexpr auto operator "" _f64(long double num) noexcept -> f64 { return (f64) num; } diff --git a/2020/types.hpp b/2020/types.hpp new file mode 100644 index 0000000..bc94dab --- /dev/null +++ b/2020/types.hpp @@ -0,0 +1,70 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#ifndef GNARWHAL_REDWOOD_TYPES +#define GNARWHAL_REDWOOD_TYPES + +#include +#include + +using u8 = std::uint8_t; +using i8 = std::int8_t; +using u16 = std::uint16_t; +using i16 = std::int16_t; +using u32 = std::uint32_t; +using i32 = std::int32_t; +using u64 = std::uint64_t; +using i64 = std::int64_t; +using usize = std::size_t; + +constexpr auto operator "" _u8 (unsigned long long int num) noexcept -> u8; +constexpr auto operator "" _i8 (unsigned long long int num) noexcept -> i8; +constexpr auto operator "" _u16 (unsigned long long int num) noexcept -> u16; +constexpr auto operator "" _i16 (unsigned long long int num) noexcept -> i16; +constexpr auto operator "" _u32 (unsigned long long int num) noexcept -> u32; +constexpr auto operator "" _i32 (unsigned long long int num) noexcept -> i32; +constexpr auto operator "" _u64 (unsigned long long int num) noexcept -> u64; +constexpr auto operator "" _i64 (unsigned long long int num) noexcept -> i64; +constexpr auto operator "" _usize(unsigned long long int num) noexcept -> usize; + +using c8 = u8; +using c16 = u16; +using c32 = u32; + +constexpr auto operator "" _c8 (char c) noexcept -> c8; +constexpr auto operator "" _c16(char c) noexcept -> c16; +constexpr auto operator "" _c32(char c) noexcept -> c32; +constexpr auto operator "" _c8 (unsigned long long int c) noexcept -> c8; +constexpr auto operator "" _c16(unsigned long long int c) noexcept -> c16; +constexpr auto operator "" _c32(unsigned long long int c) noexcept -> c32; + +using f32 = float; +using f64 = double; + +constexpr auto operator "" _f32(long double num) noexcept -> f32; +constexpr auto operator "" _f64(long double num) noexcept -> f64; + +#endif // GNARWHAL_REDWOOD_TYPES diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4ee42b8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +Mit License + +Copyright (c) 2020 Gnarwhal + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..02a3830 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Advent of Code + +https://adventofcode.com/ From 789e759e05043e7cbed3cc9a2b993d159c143c0c Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Tue, 1 Dec 2020 00:00:04 -0800 Subject: [PATCH 02/52] Initial setup and day1 --- .gitignore | 2 + 2020/Makefile | 10 +++ 2020/day1.cpp | 79 +++++++++++++++++++ 2020/day1.input | 200 ++++++++++++++++++++++++++++++++++++++++++++++++ 2020/types.cpp | 47 ++++++++++++ 2020/types.hpp | 70 +++++++++++++++++ LICENSE | 21 +++++ README.md | 3 + 8 files changed, 432 insertions(+) create mode 100644 .gitignore create mode 100644 2020/Makefile create mode 100644 2020/day1.cpp create mode 100644 2020/day1.input create mode 100644 2020/types.cpp create mode 100644 2020/types.hpp create mode 100644 LICENSE create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1a8f3a8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +out/ +*.out diff --git a/2020/Makefile b/2020/Makefile new file mode 100644 index 0000000..fe418f1 --- /dev/null +++ b/2020/Makefile @@ -0,0 +1,10 @@ +day1.out: out/types.o day1.cpp day1.input + g++ $(flags) day1.cpp out/types.o -o $@ + +out/types.o: types.hpp types.cpp + mkdir -p out/ + g++ $(flags) -c types.cpp -o $@ + +.PHONY: clean +clean: + rm out/* day*.out diff --git a/2020/day1.cpp b/2020/day1.cpp new file mode 100644 index 0000000..a9a028c --- /dev/null +++ b/2020/day1.cpp @@ -0,0 +1,79 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include + +#include "types.hpp" + +// Find 2 numbers that sum to 2020 +auto find_2020_x2(const std::vector & list) -> void { + auto begin = 0; + auto end = list.size() - 1; + auto sum = 0; + while ((sum = list[begin] + list[end]) != 2020) { + if (sum < 2020) { + ++begin; + } else { + --end; + } + } + std::cout << (list[begin] * list[end]) << std::endl; +} + +// Find 3 numbers that sum to 2020 +auto find_2020_x3(const std::vector & list) -> void { + for (auto n0 = 0; n0 < list.size() - 2; ++n0) { + for (auto n1 = 1; n1 < list.size() - 1; ++n1) { + for (auto n2 = 2; n2 < list.size(); ++n2) { + if (list[n0] + list[n1] + list[n2] == 2020) { + std::cout << (list[n0] * list[n1] * list[n2]) << std::endl; + return; + } + } + } + } +} + +i32 main(i32 argc, char * argv[]) { + auto list = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("day1.input"); + while (getline(file, line)) { + list.push_back(std::stoi(line)); + } + } + std::sort(list.begin(), list.end()); + + find_2020_x2(list); + find_2020_x3(list); + + return 0; +} diff --git a/2020/day1.input b/2020/day1.input new file mode 100644 index 0000000..3bea509 --- /dev/null +++ b/2020/day1.input @@ -0,0 +1,200 @@ +1587 +1407 +1717 +1596 +1566 +1752 +1925 +1847 +1716 +1726 +1611 +1628 +1853 +1864 +1831 +1942 +1634 +1964 +1603 +1676 +1256 +1906 +1655 +1790 +1666 +1470 +1540 +1544 +1100 +1447 +1384 +1464 +1651 +1572 +907 +1653 +1265 +1510 +1639 +1818 +376 +1378 +1132 +1750 +1491 +1788 +1882 +1779 +1640 +1586 +1525 +1458 +1994 +1782 +1412 +1033 +1416 +1813 +1520 +1968 +715 +1396 +1745 +1506 +1024 +1798 +1870 +1615 +1957 +1718 +1349 +1983 +1387 +1738 +1588 +1321 +1160 +1907 +1861 +1940 +1475 +2004 +1852 +1760 +1608 +1028 +1820 +1495 +1811 +1737 +1417 +1316 +1087 +1803 +1595 +1346 +1971 +1692 +1678 +1330 +1480 +1097 +1898 +1973 +1567 +1733 +1336 +1381 +1327 +1670 +1436 +1989 +1334 +89 +1862 +1715 +1743 +1967 +1765 +1402 +1729 +1749 +1671 +1196 +1650 +1089 +1814 +1783 +1225 +1823 +1746 +2009 +1886 +1748 +1481 +1739 +1912 +1663 +1668 +1314 +1594 +705 +1449 +1731 +1487 +1648 +1466 +1317 +1979 +1799 +1926 +1703 +1656 +1978 +2005 +1865 +1982 +1951 +1892 +1713 +1744 +1598 +1606 +1583 +1895 +1804 +1430 +1816 +1364 +1575 +1918 +1431 +1812 +1471 +1797 +928 +1934 +1156 +94 +1563 +1909 +1453 +1392 +1427 +1819 +1524 +1695 +1866 +2008 +1413 +1698 +1051 +1707 +1904 +1681 +1541 +1621 +1421 +1809 +1576 diff --git a/2020/types.cpp b/2020/types.cpp new file mode 100644 index 0000000..cc4d3da --- /dev/null +++ b/2020/types.cpp @@ -0,0 +1,47 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include "types.hpp" + +constexpr auto operator "" _u8 (unsigned long long int num) noexcept -> u8 { return u8(num); } +constexpr auto operator "" _i8 (unsigned long long int num) noexcept -> i8 { return u8(num); } +constexpr auto operator "" _u16 (unsigned long long int num) noexcept -> u16 { return u16(num); } +constexpr auto operator "" _i16 (unsigned long long int num) noexcept -> i16 { return i16(num); } +constexpr auto operator "" _u32 (unsigned long long int num) noexcept -> u32 { return u32(num); } +constexpr auto operator "" _i32 (unsigned long long int num) noexcept -> i32 { return i32(num); } +constexpr auto operator "" _u64 (unsigned long long int num) noexcept -> u64 { return u64(num); } +constexpr auto operator "" _i64 (unsigned long long int num) noexcept -> i64 { return i64(num); } +constexpr auto operator "" _usize(unsigned long long int num) noexcept -> usize { return usize(num); } + +constexpr auto operator "" _c8 (char c) noexcept -> c8 { return c8(c); } +constexpr auto operator "" _c16(char c) noexcept -> c16 { return c16(c); } +constexpr auto operator "" _c32(char c) noexcept -> c32 { return c32(c); } +constexpr auto operator "" _c8 (unsigned long long int c) noexcept -> c8 { return c8(c); } +constexpr auto operator "" _c16(unsigned long long int c) noexcept -> c16 { return c16(c); } +constexpr auto operator "" _c32(unsigned long long int c) noexcept -> c32 { return c32(c); } + +constexpr auto operator "" _f32(long double num) noexcept -> f32 { return (f32) num; } +constexpr auto operator "" _f64(long double num) noexcept -> f64 { return (f64) num; } diff --git a/2020/types.hpp b/2020/types.hpp new file mode 100644 index 0000000..bc94dab --- /dev/null +++ b/2020/types.hpp @@ -0,0 +1,70 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#ifndef GNARWHAL_REDWOOD_TYPES +#define GNARWHAL_REDWOOD_TYPES + +#include +#include + +using u8 = std::uint8_t; +using i8 = std::int8_t; +using u16 = std::uint16_t; +using i16 = std::int16_t; +using u32 = std::uint32_t; +using i32 = std::int32_t; +using u64 = std::uint64_t; +using i64 = std::int64_t; +using usize = std::size_t; + +constexpr auto operator "" _u8 (unsigned long long int num) noexcept -> u8; +constexpr auto operator "" _i8 (unsigned long long int num) noexcept -> i8; +constexpr auto operator "" _u16 (unsigned long long int num) noexcept -> u16; +constexpr auto operator "" _i16 (unsigned long long int num) noexcept -> i16; +constexpr auto operator "" _u32 (unsigned long long int num) noexcept -> u32; +constexpr auto operator "" _i32 (unsigned long long int num) noexcept -> i32; +constexpr auto operator "" _u64 (unsigned long long int num) noexcept -> u64; +constexpr auto operator "" _i64 (unsigned long long int num) noexcept -> i64; +constexpr auto operator "" _usize(unsigned long long int num) noexcept -> usize; + +using c8 = u8; +using c16 = u16; +using c32 = u32; + +constexpr auto operator "" _c8 (char c) noexcept -> c8; +constexpr auto operator "" _c16(char c) noexcept -> c16; +constexpr auto operator "" _c32(char c) noexcept -> c32; +constexpr auto operator "" _c8 (unsigned long long int c) noexcept -> c8; +constexpr auto operator "" _c16(unsigned long long int c) noexcept -> c16; +constexpr auto operator "" _c32(unsigned long long int c) noexcept -> c32; + +using f32 = float; +using f64 = double; + +constexpr auto operator "" _f32(long double num) noexcept -> f32; +constexpr auto operator "" _f64(long double num) noexcept -> f64; + +#endif // GNARWHAL_REDWOOD_TYPES diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4ee42b8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +Mit License + +Copyright (c) 2020 Gnarwhal + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..02a3830 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Advent of Code + +https://adventofcode.com/ From e073153fae4b252cad295e6bca56b51e9b05f43c Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Tue, 1 Dec 2020 07:11:29 -0800 Subject: [PATCH 03/52] In a weary stupor my code grew wrought with linear searching a sorted list and has been dealt with accordingly :vomit: --- 2020/day1 | Bin 0 -> 37264 bytes 2020/day1.cpp | 12 ++++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 2020/day1 diff --git a/2020/day1 b/2020/day1 new file mode 100755 index 0000000000000000000000000000000000000000..4cdc619f1dbbea62b2b8f13313ed046768f7c928 GIT binary patch literal 37264 zcmdsgdtg-6@&C;OMG7G*Dx#JZQNc${LV!e36UgF50;EZ>w2GHJ7FbQPX|mzrR}>qt zZbLLGDq8hNTYul8wTjkOYJG&qk6_grT5F?HjTZfG1Z#Y!Rmt}=bLQN8_wHSa*!GX# zRWf^K=FFKhXU?2CXYby7t-o|;YD$WsuQcNVgGviC6{b)KnLm^d0EI@raRmN;(>TdE z4CQpjDSDv-psH&?L~A%y@M(ZlFF#cw-0(!<(@<+jaEQ>nz{j%`Rzt(^F@oxmuAQY^ z1oZI-4d;_WxYmfa^q04RyV5p&sdZu$K(4Q7-KzvrD10r=cE)bLv9XQ}WKKt3A6e)X=j0?B)4W z&YqH&)f~>s<$jZV;=O3jJXVRsh$)yp3T46({gv-O({sweRXfi8dGD@I7v6f@+}@Ke zC*E=Rr^n4OGWj#%=sITo@EPip_uoe${3s97ZV2?k--!mj@DC*6-e@JNzk$oSjMJ+?j;GJ&FA0B>Hbmg1^lFA4s-B=WN$|48F_ zqp(a#%LE@^n9t3T+L|-Zq&YmrFwMpF;RdrgQq>eOO~WjyoNd+yn}Ul&&5>YJN18$n zi@oYsRFRMwIV__hk{4{Kt@GmZm!s`TN?I7=f>re;m1bqO>93fA-lO?QPM&DGNa$Yb zq9t^VWSJ%5W^-<1u%SL&3mcIo^0XyF4NI%)LbYa9)8dx;U_(T#Q4z_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~aK7N(CN3^x~zW>t6_)KC;drJt-qj+tMGxwMAz59 zo7GVNo?N%D>+Alnmip60p#FWWhJ_-S>eH>1?)oZk-=-MDRBx)$PUn(O0lCI7x zih{F#r_|T5!)0*!c?9l-R@XXLef_&$4Yj_)Zt1V__qggW6u}ynPtY|L)a`2QPhIu( z?}RlxLNf|<_y2yWug6dSj!i?k9o3TJuK$Rue!tw8t06sm)p@z=KjW&ef1j*j=16C4 zd;B%_Syz4iJ7x_p(~JV$?Y{;*4Y^iR|NgYIR8?@>TaTND{{uEsQP & list) -> void { auto find_2020_x3(const std::vector & list) -> void { for (auto n0 = 0; n0 < list.size() - 2; ++n0) { for (auto n1 = 1; n1 < list.size() - 1; ++n1) { - for (auto n2 = 2; n2 < list.size(); ++n2) { - if (list[n0] + list[n1] + list[n2] == 2020) { + auto low = n0 + 1; + auto high = n1; + auto n2 = (low + high) / 2; + while (low < high - 1) { + auto sum = 0; + if ((sum = list[n0] + list[n1] + list[n2]) == 2020) { std::cout << (list[n0] * list[n1] * list[n2]) << std::endl; return; + } else if (sum > 2020) { + low = n2 + 1; + } else { + high = n2; } } } From 7286854d4103c6cbff5ffc552c3e9bd3871a3cc3 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Tue, 1 Dec 2020 07:11:29 -0800 Subject: [PATCH 04/52] In a weary stupor my code grew wrought with linear searching a sorted list and has been dealt with accordingly :vomit: --- 2020/day1 | Bin 0 -> 37264 bytes 2020/day1.cpp | 12 ++++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 2020/day1 diff --git a/2020/day1 b/2020/day1 new file mode 100755 index 0000000000000000000000000000000000000000..4cdc619f1dbbea62b2b8f13313ed046768f7c928 GIT binary patch literal 37264 zcmdsgdtg-6@&C;OMG7G*Dx#JZQNc${LV!e36UgF50;EZ>w2GHJ7FbQPX|mzrR}>qt zZbLLGDq8hNTYul8wTjkOYJG&qk6_grT5F?HjTZfG1Z#Y!Rmt}=bLQN8_wHSa*!GX# zR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lVg8!L5n#W1q{K)puBUHvD5IoX4ahr@l{AJM5B*^GfNQa}R;g`h zNhPfti}9xVU=uc>bT3FHeU(NoVcT2gKb@D*B4%$|XgA`>So7!!a!61pQ0HR1f*UlD z;)NO(mn3~by}ztp`(HAf$N3BIA^BX+so+<)Jnl@$Hp}S+^YnUnd=){!UkCF~4K+l9 zi<>ym;TDvthDb>@e>cseL*K{nmxcAg+E7)483|(wH8uY`vkIM9z&EBY3OCXBKiKKw zJBV`1^rj?y4GX`NuO#C~F>xj)UlQ`HO=CieMwQ~{yOGtrqCQep4H#)saEbmz#%yXd zvhXErFso>K$=Ub@T1vPHC9Aq6R9Aa;sMg4$(vqs?B}P{5iU!D2Fw&$bOM^|#_(mwM zV1m{ZtgE65@~N>dV&LJ0xJxJtAF~#R@gWjij=vn|vYNttH$YZ!iQJa7q!vPS3DRq7 zOu7FA{lGL}Vd{=0B}0Ekn^pCp8fZzk7i1x+HL|cU*5eK+z7gze{-N6-Q}8cUmSy|8Xy z|K3zXU4Mv3(7&J10_WfZe%fK_-zkDL45TSex<8NluItO~aK7N(CN3^x~zW>t6_)KC;drJt-qj+tMGxwMAz59 zo7GVNo?N%D>+Alnmip60p#FWWhJ_-S>eH>1?)oZk-=-MDRBx)$PUn(O0lCI7x zih{F#r_|T5!)0*!c?9l-R@XXLef_&$4Yj_)Zt1V__qggW6u}ynPtY|L)a`2QPhIu( z?}RlxLNf|<_y2yWug6dSj!i?k9o3TJuK$Rue!tw8t06sm)p@z=KjW&ef1j*j=16C4 zd;B%_Syz4iJ7x_p(~JV$?Y{;*4Y^iR|NgYIR8?@>TaTND{{uEsQP & list) -> void { auto find_2020_x3(const std::vector & list) -> void { for (auto n0 = 0; n0 < list.size() - 2; ++n0) { for (auto n1 = 1; n1 < list.size() - 1; ++n1) { - for (auto n2 = 2; n2 < list.size(); ++n2) { - if (list[n0] + list[n1] + list[n2] == 2020) { + auto low = n0 + 1; + auto high = n1; + auto n2 = (low + high) / 2; + while (low < high - 1) { + auto sum = 0; + if ((sum = list[n0] + list[n1] + list[n2]) == 2020) { std::cout << (list[n0] * list[n1] * list[n2]) << std::endl; return; + } else if (sum > 2020) { + low = n2 + 1; + } else { + high = n2; } } } From 10219c3264b2e1d85b819817d1226759a5dafc17 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Tue, 1 Dec 2020 22:24:15 -0800 Subject: [PATCH 05/52] Completed day 2 --- 2020/Makefile | 3 + 2020/day1 | Bin 37264 -> 0 bytes 2020/day1.cpp | 2 +- 2020/day2.cpp | 95 +++++ 2020/day2.input | 1000 +++++++++++++++++++++++++++++++++++++++++++++ 2020/day2.output | 1001 ++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 2100 insertions(+), 1 deletion(-) delete mode 100755 2020/day1 create mode 100644 2020/day2.cpp create mode 100644 2020/day2.input create mode 100644 2020/day2.output diff --git a/2020/Makefile b/2020/Makefile index fe418f1..89345cb 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -1,6 +1,9 @@ day1.out: out/types.o day1.cpp day1.input g++ $(flags) day1.cpp out/types.o -o $@ +day2.out: out/types.o day2.cpp day2.input + g++ $(flags) day2.cpp out/types.o -o $@ + out/types.o: types.hpp types.cpp mkdir -p out/ g++ $(flags) -c types.cpp -o $@ diff --git a/2020/day1 b/2020/day1 deleted file mode 100755 index 4cdc619f1dbbea62b2b8f13313ed046768f7c928..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37264 zcmdsgdtg-6@&C;OMG7G*Dx#JZQNc${LV!e36UgF50;EZ>w2GHJ7FbQPX|mzrR}>qt zZbLLGDq8hNTYul8wTjkOYJG&qk6_grT5F?HjTZfG1Z#Y!Rmt}=bLQN8_wHSa*!GX# zRWf^K=FFKhXU?2CXYby7t-o|;YD$WsuQcNVgGviC6{b)KnLm^d0EI@raRmN;(>TdE z4CQpjDSDv-psH&?L~A%y@M(ZlFF#cw-0(!<(@<+jaEQ>nz{j%`Rzt(^F@oxmuAQY^ z1oZ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$N3BIA^BX+so+<)Jnl@$Hp}S+^YnUnd=){!UkCF~4K+l9 zi<>ym;TDvthDb>@e>cseL*K{nmxcAg+E7)483|(wH8uY`vkIM9z&EBY3OCXBKiKKw zJBV`1^rj?y4GX`NuO#C~F>xj)UlQ`HO=CieMwQ~{yOGtrqCQep4H#)saEbmz#%yXd zvhXErFso>K$=Ub@T1vPHC9Aq6R9Aa;sMg4$(vqs?B}P{5iU!D2Fw&$bOM^|#_(mwM zV1m{ZtgE65@~N>dV&LJ0xJxJtAF~#R@gWjij=vn|vYNttH$YZ!iQJa7q!vPS3DRq7 zOu7FA{lGL}Vd{=0B}0Ekn^pCp8fZzk7i1x+HL|cU*5eK+z7gze{-N6-Q}8cUmSy|8Xy z|K3zXU4Mv3(7&J10_WfZe%fK_-zkDL45TSex<8NluItO~aK7N(CN3^x~zW>t6_)KC;drJt-qj+tMGxwMAz59 zo7GVNo?N%D>+Alnmip60p#FWWhJ_-S>eH>1?)oZk-=-MDRBx)$PUn(O0lCI7x zih{F#r_|T5!)0*!c?9l-R@XXLef_&$4Yj_)Zt1V__qggW6u}ynPtY|L)a`2QPhIu( z?}RlxLNf|<_y2yWug6dSj!i?k9o3TJuK$Rue!tw8t06sm)p@z=KjW&ef1j*j=16C4 zd;B%_Syz4iJ7x_p(~JV$?Y{;*4Y^iR|NgYIR8?@>TaTND{{uEsQP & list) -> void { } } -i32 main(i32 argc, char * argv[]) { +auto main(i32 argc, char * argv[]) -> i32 { auto list = std::vector(); { auto line = std::string(); diff --git a/2020/day2.cpp b/2020/day2.cpp new file mode 100644 index 0000000..cec8af6 --- /dev/null +++ b/2020/day2.cpp @@ -0,0 +1,95 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +struct Password { + u32 min; + u32 max; + char c; + std::string password; +}; + +auto extract_num(usize & index, const std::string & string) -> u32 { + auto num = u32(0); + --index; + while ('0' <= string[++index] && '9' >= string[index]) { + num = (num * 10) + (string[index] - '0'); + } + return num; +} + +auto count_valid_sled(const std::vector & passwords) -> u32 { + auto valid = u32(0); + for (auto password : passwords) { + auto count = u32(0); + for (auto c : password.password) { + if (c == password.c) { + ++count; + } + } + valid += (password.min <= count && count <= password.max); + } + return valid; +} + +auto count_valid_toboggan(const std::vector & passwords) -> u32 { + auto valid = u32(0); + for (auto password : passwords) { + if ((password.password[password.min - 1] == password.c) + ^ (password.password[password.max - 1] == password.c)) { + ++valid; + } + } + return valid; +} + +auto main(i32 argc, char * argv[]) -> i32 { + auto passwords = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("day2.input"); + while (getline(file, line)) { + auto index = usize(0); + auto password = Password{}; + password.min = extract_num( index, line); + password.max = extract_num(++index, line); + password.c = line[++index]; + password.password = line.substr(index + 3, line.size() - index - 3); + passwords.push_back(password); + } + } + + std::cout << count_valid_sled(passwords) << std::endl; + std::cout << count_valid_toboggan(passwords) << std::endl; + + return 0; +} diff --git a/2020/day2.input b/2020/day2.input new file mode 100644 index 0000000..d1612d4 --- /dev/null +++ b/2020/day2.input @@ -0,0 +1,1000 @@ +9-11 p: pppppppppxblp +2-4 b: bbxbb +3-5 q: dqfqb +5-8 g: ggcgggglg +10-18 l: gllpmlgtrmnllhllrlll +18-19 z: zzzzznszzzzzzzzzzzxz +3-6 r: frrhxsnrmgmw +1-8 n: zkxhnxnzghnm +11-12 z: zzczzzztlzlzzzz +4-7 q: qqqbncqqq +3-4 c: ccvfc +19-20 l: sltlklljdlzglwllllzl +6-16 h: dhhhrhvhnhdchfsnhq +3-7 l: fllllqjlll +8-9 k: xkkjqklkm +1-2 l: llgpl +2-4 x: qkjxvqlv +5-6 c: cwcccjch +3-7 n: bnnhnwnqtdnndnncnd +8-9 n: nnrkmdnkn +6-9 t: ttttrtltptgvcd +3-4 h: hhwhhhdhhhh +7-8 w: wdwvcwwszcwwwwwq +2-4 n: vnng +3-13 v: vvvvvvvvvvvvjv +9-11 c: zcccccccccfcbccc +10-11 w: wkwwwwwwwxw +10-12 z: zzzzzjzzzrnzz +5-6 t: ttttts +13-19 b: bbmfbbbbbrbbgbbbrbbb +8-9 d: bdddvkddjbdgdd +19-20 m: mmmmmmmmmcmmmmmmmmmq +6-18 w: wwwwwwhwjwwwwwwcwjw +4-10 t: tttttttttj +2-7 j: fbdgmfjbjgjn +7-8 w: wwwwwwcww +8-12 c: cbmdccbccckjccch +13-15 f: fpfffffffffffqf +7-11 t: sbtstwdxjpclwd +1-3 s: shkkqcs +7-8 l: bdggzczl +1-6 g: zgggggglggggggw +12-16 h: hhhhhhhhhhhhhhphhhh +8-19 k: htknkhkrkdkhkpwppkk +8-10 k: kkxkkkbrkgk +8-9 h: hvhhhhhfhhv +15-16 x: xxxxxxxxxxxxxxxh +1-12 b: bgwpjbkhbptsbbb +9-10 j: pjtjpjpnbjjlsgbn +8-9 s: sscplbswssssglxs +14-15 j: jjjhjjjjjjxjjjj +1-4 q: qnqj +3-5 d: qpdddqvwbzldf +14-15 b: bbbbbbbbbbbbbbt +1-2 t: tdxt +1-7 g: dlpkvrgjzpnr +3-11 m: lmnwjjxpfmm +3-8 l: llglllllll +2-4 r: gfmrlbmsvqzrmbnd +5-9 s: srsqssssds +8-9 v: vvvvmvvvhw +7-10 d: mddwdvjdcdwdcgddd +4-7 k: fksjkkkk +6-9 t: fnrxmlwtt +11-12 d: dddddddddfmd +4-5 z: zzdzzzz +11-13 z: zzzzzzzzzzpzmzzz +12-14 z: zrgnvcrxkzzzrb +10-13 q: qpqqqqqrqxvqq +6-10 g: gglggggggzgggg +2-8 j: jfqjrdjjjjjj +7-8 z: hzlvrczjp +4-5 k: kggjkl +4-7 m: mpmmmcmm +13-14 x: xxxxxxzxxxxxxw +6-7 n: znnnnnlpjcn +10-16 g: gggzvgggntggfgghggg +2-17 n: hnchrpvzhkdsnhgcnfql +2-8 f: fkfpffff +4-7 s: qwdspspj +6-7 r: rrrrrnx +7-8 p: wpppppsp +8-10 m: mmmwmjmmmvmzpm +6-7 j: jjjjjncd +3-4 k: kxkk +2-4 z: czzmzz +11-12 t: tttttttttttzkp +10-17 t: ttttvtltdttrqtztr +3-6 n: nnnnvvxv +7-8 v: rvvpvvvpsvv +1-2 r: nkfgnr +4-11 c: cccbccclcccc +7-12 q: qpbqtqkqqqqqqq +2-7 m: mfmmmmmmxmnm +10-11 n: bnnnpnnncxrnnnn +10-14 n: nsnnnnnwljnsnnn +5-9 b: vcvcblrxbvjbtzbrmbr +3-9 m: kmmmmxmmkmmk +2-10 l: llbllgzllnlll +5-6 d: ddpdwdddxhpdqd +12-18 j: cjfbjccqgxlczjptqlk +1-3 z: mzzz +5-11 m: mdfmmmmtmgw +2-14 h: nhhnbhghhlhhchsqsr +3-4 t: jvtt +2-8 t: tttkxxtsttht +7-15 w: wwwwfwwwwwwrbww +1-4 j: rbjj +8-12 f: ffkhffffcsfzff +10-12 p: pppcgpqphprh +10-11 l: lllllllllsl +7-8 s: svsssssss +4-5 c: cvjcc +1-5 v: vcdcd +5-14 z: zzwkzztzzzzzbzzvzzz +11-12 s: sssssssssssps +5-7 b: spmtbpn +5-6 c: cccccf +10-12 p: ptpppppppppk +4-13 f: ffkffffkffflb +2-5 t: nttqftpnwbjbxmqdqv +17-18 w: wwwwtwwwwwwwwwwwkwww +7-9 f: lmrffdbffvfmf +2-5 h: hhhvzrhh +10-11 q: qmdrdfqgzql +3-11 g: ggggggggggm +4-5 z: zzzrzzp +5-7 w: wwwwkwwww +10-11 f: ffffffffffp +6-9 v: vvvvvvvmv +4-5 x: wjxxxxxtd +12-13 p: vppppppppppzbp +2-7 b: bqntbls +15-16 p: ppppppppppppzpfxn +2-3 b: bbcnbq +10-11 k: kkkklkmkkhk +4-6 w: wwwdjb +4-6 b: sczlwbnffbnxbvjbmj +3-17 m: jmmlmmmgmmmjmmmmmlmm +6-18 z: zmkwvzkpqzmzdfgdvt +5-6 q: sqwqqq +1-3 g: gjgt +5-8 x: bxcxxzxxws +4-5 c: rnscvcngbcmpddkcvctk +7-11 g: ggggglvgggngg +2-11 l: lsqlzlllllklgfl +2-9 m: cmqkbmdxp +6-7 w: wwwwwww +8-13 q: qbqzqqqqqlqqw +3-4 n: sfqnnnwvzn +1-2 w: nwww +2-4 v: hvvbqgnfl +14-15 m: gjgdmmmmkmqqcxmrsm +2-3 z: zzzx +5-13 q: qqqqdqqqqqtqjqq +4-5 z: zzzzk +5-6 t: tttttf +3-6 z: ztwzczkz +3-5 l: llpljllllllll +2-3 s: ssscp +8-10 d: dddddddwdddddwddg +2-6 s: sbssps +1-5 f: ffbfvfxbkmbhvbcfmxpf +1-6 j: gqfrmjgsgjjhcjhn +2-5 l: lwvllll +2-5 z: zkzhzb +10-11 s: wsblfxvmvsslbhfjtsws +11-17 f: fffffffxfffffffftfff +4-5 r: rrrkbrr +7-10 w: qwqwwwgzrdxww +6-8 s: ssssssscs +4-6 q: qbqwqzfqcfgkmzqxb +6-10 t: ttncfqqtttttp +2-4 m: bbzcjjqmfvln +4-7 n: cnqhntshdnnrnrnz +7-12 d: vmdndkzpmcbd +6-7 p: tpqpppzpjp +3-10 r: rgrrrpzrbrrr +2-15 h: ghbfhbgrtxrshphhl +2-6 j: pjjjjlj +6-9 j: rjrjjjwfjn +10-13 s: sssssssssjsssssss +1-6 c: crnjccgnw +6-7 l: qrllgql +12-13 z: wzzzzzzzzzzfz +1-2 c: ccclc +2-6 f: qdlflfr +4-10 r: drrrrrwrfrr +5-6 f: ffzffnf +4-6 p: hkppkbppp +8-9 r: rrrrrrrrx +4-12 f: fffffffffffwqp +4-6 q: qtqtjq +4-5 w: wwwcw +2-3 r: qrrr +7-10 k: nkpgzskkrb +6-9 h: hmsshhhwhhhhh +2-18 d: kxqddddqddsmddcdddwd +6-7 s: sssssssss +4-8 h: hhhbthhhhh +1-8 d: dtsbqtrpwdgfdzrtf +6-7 b: bbbbbwp +5-6 p: ppnpqjp +4-13 l: rtqpmllslrlxcblldqtc +3-4 m: wmmkcm +4-16 b: qkbvbvgxtlqbgmwc +4-5 h: hhhlghh +10-11 f: fjfffffffgjff +9-12 w: gwnfvwwrwswnqrvg +4-8 k: pjkkfkbqqzkmfk +2-8 x: xwxxxxxcxxx +11-19 w: wwwwwdjwwwrrwwlvwwww +4-14 w: rwqhwqwwlhpwfwwpww +7-9 j: vjjjjqdjjjjjj +15-17 x: kxrmxjvxxxvxxxzxxxf +3-10 p: pwpxppzgdrrx +1-5 p: ppppp +10-19 n: vfnwnjstnnjnqnngnzs +2-5 m: phsmq +5-6 m: mmmmxmm +2-12 f: tftgcmcblzcljsdlbvf +6-11 b: hbbbbbbbzhwbtbbhmrb +7-11 j: jjjjjjvjjjq +3-4 d: dddgddnmd +11-14 f: fxfffffftqfflffffpf +14-16 x: xxxxxcxxxxjgxxvt +6-7 h: hhhhhht +7-8 h: hhhhhhzphhhh +5-12 w: wfwwwjzwmpxwmw +2-7 h: chcjhhqhdlfshxvhz +7-15 h: hjhhjvhhhhqmhdhjh +1-2 f: bvhf +4-6 k: rkctkkm +5-6 n: nnnnnn +10-11 j: jjjjjjjcjjs +4-7 b: bbgbnkp +2-5 d: dddddjvddxdk +11-19 z: svzzgzzmzznzzzkcdzzz +8-9 z: zzzzzgzmz +4-10 v: vsvvvvnvsr +5-15 v: mvqvvkjfvwdvvdl +13-14 s: ssssssqzszssmk +3-4 w: wbwg +10-11 d: kdbdcddqddxdddd +8-9 t: tttttttntt +2-10 m: mqmmmmmmmm +3-8 c: bcswcncchpxcxcrccrx +4-10 q: qqqplwsfxgq +15-16 h: hhqhhhhhhvhhhhhthhhh +11-13 s: sssxssswsswsr +6-7 z: zzzzhvzz +3-4 j: ktjdxsjjxjtnq +5-7 w: wwxwlwwr +2-5 l: llltll +2-6 m: qmgvtmtp +11-16 v: vvvgvvlvhvvvvvvvvvgv +2-4 j: jsnjf +11-12 g: gdlcvdgzgqpg +10-12 x: rxxcxxxxxrrxx +9-12 n: nnnnnnnncdnn +6-10 j: vjjjpjhjjs +5-6 d: dcdddt +3-13 c: cccccvctcbvcvpcccc +1-7 d: ndddzzdx +9-10 w: wwwcwwwwfr +9-18 q: xjhsjqqrqpgprjmqqq +8-11 b: bprbbbwkbbbb +4-14 w: wxcwzsswmsqvfjvjzj +5-6 b: wbbmzbbm +8-13 f: lpjfsfswfffgfkff +1-3 x: vxxx +6-7 x: btxxxxcx +6-8 r: mwqrrqrrxr +7-14 h: hhhhjllhrsxtrhmbbpwh +7-10 f: phqzgfwfrpffpzq +6-17 d: ddddddddddddxdbdgdd +5-11 f: fhfnfflfhjvwvfff +11-12 h: hhgbtnkhhhhh +2-4 f: fdfgffr +5-6 w: wwwwxw +4-9 z: zbzzzczzv +2-4 k: jfpkc +3-4 r: kwgr +4-5 k: kkkks +5-6 r: rrrdrsr +5-6 t: tpwnmttclcrtt +18-19 t: ttbwxtxgfsphgtzzplbt +1-5 w: tthwwvw +10-13 z: mzzzzzwzzzzztz +7-10 r: rzrjrfpdrrrcmmrr +2-4 w: wwww +5-9 m: vksmmzdpsm +1-2 q: qqqqqqq +1-6 c: pccccn +3-8 r: pbchhhrr +3-8 v: bfdvkvdvglvn +3-6 h: hhhxhshhl +4-7 m: mkwpkwmtmm +10-11 g: ggggmggggcg +1-6 j: jjjjjw +4-10 z: zvzzxzzgzzz +7-9 k: kkkkkkkkjkkkk +4-18 f: vlnfpdzvbqhvsfmhqtf +8-11 s: sssssksshsssmhs +2-6 b: bbbbbm +2-3 h: hhvrlcf +10-19 c: mccwczqbjdlgfccnrqc +8-12 x: rxxxnxtfxcxxxpx +13-14 r: rrrnrrrrrrrrmrr +4-11 h: mhzstqhhghhhbhhh +10-11 f: fffffffffpf +7-8 j: jjjjjjmv +5-6 f: fhfffv +3-4 z: zzxtzq +5-6 v: jvszvzvvg +9-13 v: wvvgvdvvvsrjcg +10-11 t: pcttrntttttdthtxst +1-5 v: vvvvpv +6-9 q: qfqqqlqqqqq +4-8 f: ffffffmfkkfzpffffvff +3-5 n: lnmnnnnnnnn +1-5 k: kkwmdkflxtqktmcxdl +1-3 z: tnqp +15-16 h: hhhnhhhhfhhhhhjhhh +2-6 m: mmmxmb +7-12 q: qqjqhqfqwqcqqkqmql +6-10 s: ssjvrvsgsshsss +11-15 n: nnnnnnnnnnrnnnj +14-15 x: xxxxvxxxxxkxxxzx +9-14 b: bbbbbbpbbqbblbbbb +4-12 h: knthjdhlrxtpjwhnhn +8-9 v: vvvvvvvjjvvvv +2-3 d: dktdvd +6-8 z: zzzzzzzx +10-13 t: jrjfklzstpxwt +4-16 n: mngnnqnbnnwnqrdgk +3-5 v: vhqvvn +1-4 t: jhtq +8-11 f: qfffffqfffff +14-15 x: xxxxxxxxxxxxxxx +2-12 s: scsstsssmcssswgsw +8-13 t: tttttttqttttt +8-10 d: ddddddvdfbq +9-15 d: sdqpqddddjrdjnj +17-19 c: cccccdldcccpbccxgcc +6-14 v: lvvvvsvvvvvvvp +16-18 p: ppppppppppvpppppppt +1-3 v: vkvtzlvrdcvzplznltqs +8-10 s: sssssssssns +1-3 w: wcwfwxnwwp +8-10 v: kvvvvvvvvvkvvv +7-11 s: shsssssssns +9-10 w: wwwwtwwgkwww +1-2 x: vxxn +4-9 g: lkgggrcgpg +1-5 n: fjrnn +4-6 x: xtxzxxx +18-19 z: zzzzhvzhzzzzzzzzzsz +15-18 p: ppppppppppppppsppppp +11-14 h: rdhhhhhhhghhhrh +3-9 v: vvvvvvvvqvv +4-8 p: bbpmjpplp +1-15 n: qndxnnsmnrnsnnnnn +7-9 c: cccccctccc +2-6 m: xwfnmmn +4-16 t: nbttltzvhqjtcgbtttkt +7-8 r: rrlrrrrsrbr +3-5 h: hhghh +3-4 m: mmmxm +15-16 k: fckzkjskrkkkdkkl +5-6 c: cbsxmh +1-6 x: fxxxxxx +5-12 d: wdddqrdkwkmdfwd +3-10 s: smsqncrsjjdmjdlsls +6-7 k: vkkskkjkwkrkkk +9-17 z: qwzhqgrnvzzbzlhjz +5-6 w: dwwwwp +5-8 n: ncvgqnvn +5-6 v: vvnvvwvv +3-4 x: dxxxsbsxx +8-12 t: ttgtshxfmzlc +10-17 x: xthkjfxlktkbhdxzx +5-8 q: qqtqqqkqq +4-10 d: ndddgxvzswlsgdpnrc +8-11 h: bgcfhhrkhhb +16-19 g: qgdmbghrjhgcvgwpggg +3-5 s: fbsqqszkdkqzw +9-10 h: hhhhhhhhdhhh +15-17 b: bbbbbbbbbtbbbbzbbb +11-14 q: qqqhqqqqqqqqqsq +4-18 r: rhhrrpghwbqfznflrrr +14-15 l: lllllllllllllrl +8-14 s: nsfpsrsssnffssjss +17-18 k: kkkkkkkkkkklkkkkck +1-12 c: cmnccccccccktcc +7-14 p: pppppphppppppp +1-2 j: jtjq +2-6 w: wwpxxrwwwdwwh +5-12 p: zspwppnppdghqplnj +3-5 h: zhqphfth +1-3 q: xqqq +4-9 r: qrzrfgpnbj +7-8 q: qqqjqqqcqw +4-6 m: mmmmmwdmm +4-6 s: sqcssgnsrrddgshvbcs +2-6 m: mmsgtr +3-9 v: wvwvvvmvv +3-5 j: jcjvtgjjjxvjjgjbhj +4-6 f: qsffzgff +8-9 x: nxxbxwfrxx +1-7 m: mvmmmbmmljmg +5-8 d: pdcdqdddwdl +1-3 m: mmgns +19-20 r: rrrrrrrrrrrrrrrrrrxr +1-4 h: hpghbhkhhr +5-9 x: xxxxtxxxxxxxxxxx +19-20 p: qvwdwnssfckjczggpghp +8-12 k: kkkkkkkfkkkkkkkk +10-12 b: cbbbbdbbbqbkbb +2-8 n: nkkpnprnfcnnwsmndqnn +11-12 d: ddddddvddddvd +4-8 j: jjjjjjjqjjl +1-3 l: lvdlslllhllsg +12-15 j: jzjjjjjkjpjjjjqf +6-9 s: sssssssssssss +1-2 z: xzzcnjrzzzzzzz +5-6 h: hhhhhh +7-13 x: xxzxvsmxlbxpxz +2-4 d: dpnddbdfdm +9-16 n: nnnnnnnnknnnnnnr +4-5 n: nnnvnn +13-16 p: vppppppppppppppz +3-6 w: wwtwww +7-9 n: nnxnwntnnn +4-12 q: mqcnsrvqqzgqkwz +3-4 t: dwtj +9-12 r: rrrrwrrrrdrcr +8-9 w: wwtcwwjhwwww +6-8 w: wwwwwwbgw +5-15 f: pgflfgfbbvvffkfkmw +10-17 s: ssssssssshsssfsssss +19-20 m: mmbmxfmmbzqhmxmxmmmw +11-12 d: ddddddddddsd +13-14 f: fffffffffffffdf +1-6 n: nnnnnnnn +11-19 x: wmxxbxxkxxxpxxxxxxc +2-3 z: szgkqvmzwztdcxtvn +16-20 z: zpzhwdtdzhvgcpdpzzzz +15-19 p: ppmpcxppppprsgnpppg +4-5 x: rrxfxxxqx +1-2 q: rqdwn +4-6 x: pkfxqxxfxbk +13-17 c: ccccccccccccncclc +5-7 z: zzzzvhz +5-6 r: rrrnrl +2-5 g: mfgkgxhckg +3-6 c: cnmcjcccdccccv +7-11 t: dttttttrttxtt +6-9 p: ptlfppppcvsp +3-5 g: ggxkwtj +5-16 x: phzxlbhqxgxzwjwkkxp +7-8 s: wsssssmsn +1-7 m: pmgrmkmmnnm +15-16 n: nnnnnnnnnvnnnnnln +6-8 t: ttzttftst +5-7 g: ggggggggggg +13-16 d: ddddddddddddpddbdfdd +13-14 f: jclffflwlffbfvffffbn +3-4 j: xjzjjjr +8-14 n: nnnwknndnlnlnn +6-7 s: sxsssnzs +6-7 r: rrsprrjrcrb +10-11 w: qwwcwqzwrbq +7-10 b: bbbbbbzbbbb +5-6 d: ddddkd +16-17 d: ldldddddpdldldddd +5-14 w: zdtwxnxwhwwpww +6-9 q: mqqxqsqqq +2-11 g: gpggzvgggkgmcmt +6-14 k: kfkkkxkkkkkkkjkk +2-3 m: zfmm +13-17 k: kkbkkkkmkktkkkrkk +4-6 z: tzprqwzzcpj +3-4 w: gblwcxwllzpv +3-5 d: ddcddd +9-13 r: rrfjmrcsrrwvrrk +11-17 m: dgwrmqjmclmczrlwf +1-4 v: vvhvvv +10-13 c: clhccbcvbvcfcccqccc +11-13 s: sssssssssssss +6-7 k: skkckkk +2-5 m: mfffq +3-5 x: jxbxx +1-2 c: ctcc +5-8 q: qqqqgqqqq +11-13 q: hqqbqqqqqqbqqqqqbk +9-11 q: qqqqqqqqqql +15-20 q: qqqqqqqqnqqqqqqqqqqq +5-7 g: gzngbvggmlzzrgx +2-10 n: zjknggzlvnxtbwnhmf +2-13 c: cccccccccccct +4-8 c: cccccccbcccc +3-5 k: kdkkz +8-10 h: nchthhghhjhjh +10-11 l: wllllllllplxllnjj +14-17 q: qqhqqqqqqtqvqcqqqrq +5-9 d: dddddddrz +13-14 z: zzzzzzzzzzzzzm +7-9 t: tttttctwlttt +6-13 w: dwcwdtwrwccwwl +10-11 h: hhhhhwhhmmhhhh +7-9 t: tttttjtttt +12-17 n: nnnnknnfpnnwncnnjn +5-6 c: zccccc +11-13 s: ssssksxssssss +9-17 q: qqqqcfbqrqqcqzqqlqqq +3-4 m: dmml +4-6 v: slvvvln +4-5 n: nnbmnn +2-7 h: whhhhhjvfhhh +2-5 s: slhss +4-5 q: zbhqhqgqdq +2-6 p: pjtxqp +7-9 h: hhhhhhkhh +7-8 w: fgvwcwws +10-13 d: ddddxhdddddvhdddd +7-16 m: mmnznmmwmwrmqzrqbmpr +12-13 v: vvvvvvvvvzvvjv +18-19 g: mztkzhgmndnffztwqfg +7-8 j: jjjcjjvjjjjpjjjjjjj +7-10 s: sssssssssz +18-20 s: sssssssssssssssssssg +1-4 r: trrrr +2-16 r: mrrrrrrhrcrrfcpqrh +5-13 n: nnbljfchnnnnnj +1-6 v: vvvvvmvv +7-15 q: szqhbkqxppcbkxmc +9-10 l: gllllvllsvll +1-4 m: mxldw +5-9 x: xxxxxxxxj +11-16 t: ttttttttwttttttfl +7-12 j: sjjzpjjjjljhj +1-5 x: wmplxj +2-6 z: zzxzzrzqplrh +4-6 w: cqbwwbww +14-15 l: llllltllllllllw +3-4 m: mhmvvz +3-4 w: wwmw +1-4 c: ccchpccc +6-10 p: pppppppppqprbppppp +9-15 h: hhhjcrhhhhhhchhjht +8-11 g: gggggggkggggggggg +4-9 h: hhkqxhhhlh +7-8 f: mlfdfrmfbfttmffqfff +7-9 t: nttttttvsn +6-9 h: hhhhbhvhph +4-5 f: hhcdf +3-4 k: kfxkcr +1-4 z: zzml +3-5 f: cjjffbzffqfsbm +4-5 f: ffdfh +6-17 h: hhhhhhhhhhhhhhhhrh +8-10 d: qdddzddddzdd +7-8 j: nfxxthqj +2-4 n: nnnc +3-5 v: vlvzx +6-10 n: nnnnnnnnns +11-13 q: bzhwhbvwqffzs +3-6 c: gccmcc +2-5 m: xmbgm +2-11 g: tgztmzzbgjzc +2-5 j: jsjbj +3-4 v: vvljvvv +3-6 p: pxwcnwmp +2-7 j: ndjnzmjklxqwpkpnwb +1-20 s: slssswsnssscgbssxsdg +3-4 r: rrrfjc +5-16 t: ttntptttsqtttpwtgbt +3-4 g: fxgg +13-17 l: llltllllllllvllllvrl +5-8 q: vxfpqhqd +4-8 c: cvqcwkccp +5-11 x: kxqkghvxxdqfwxxkxx +4-5 t: tttht +8-11 n: mnnpnnpsnqdknnvsh +1-4 g: gggngpdggv +5-6 s: ssssss +4-7 d: mddfddk +7-8 f: fffffffb +4-11 x: cbmcvvvvxgn +14-16 d: vdddkddpddddllrddddd +8-9 h: qhhhsnxhjmzhlhdjxhf +5-13 f: fxfhlqsffxfgwpcz +14-16 g: jggggnngggngggggjggg +1-5 z: rzgzt +3-6 f: fffgrv +3-4 w: zwwtwdw +9-12 g: dkmhhvhjgsvqglbrr +4-5 g: gbrtx +1-5 r: xrrrr +2-5 d: ddddddddddddddd +4-5 j: jjvjz +2-4 b: blbbbt +16-17 b: bbbbbbbbbbblbbbzbc +8-13 l: lljlqlkslqllllll +6-15 g: wgfgzggggggbtch +4-13 w: cwvbtpnjdkvww +8-10 x: xtdxxxxxxhxxx +3-6 p: pprpppp +15-17 p: ppppppppppppppkpppp +1-3 w: wnwpwwbllb +3-5 m: mxqdq +13-16 s: hsrsssqssssscgssss +1-2 c: zccccm +5-8 r: rrrrkrrm +5-6 j: njjkjjsj +5-10 r: rrrrhrrrrr +5-12 x: xmxwxnmxsldlrpgxxxc +4-6 z: ztzwfzj +11-15 w: wwcwwwwwwwzwwww +5-7 c: cpccccnd +1-16 q: qqvhqhnpqscqqldqbzh +8-9 s: kfpdswzssssqssscms +2-16 l: hppbqldllnlljvflltl +4-12 c: cccccccccccpccc +5-6 r: rrrrqb +11-12 f: ffffdffffmfdkff +5-6 k: lhkkkf +12-15 z: bzzzzzzzzstzzzz +5-13 c: kgsscwsfzcbwchwk +11-18 m: wmmjbmfpvmmmthfwpsxf +7-14 m: mmmfmmtqmmmmmmmmrc +14-15 g: wbqfggngtbqvpqp +10-11 k: kkkvxktjtkbjkkkk +2-4 b: wbtkp +4-10 v: vvvvbffvmtvvz +6-8 m: vtvgmmbc +1-7 d: hddsnzd +2-3 d: rndxchftldndc +2-11 z: zzcwbxkzzqzzp +5-6 q: wqqqjq +9-10 d: ddddddpdcdd +1-12 g: ggfggggggggbn +4-5 v: vvvrvv +12-14 r: rrrrrrrrrrrqrr +6-10 s: sssshvssss +7-10 g: gqgzgggksggggdqghs +8-9 c: ccccccccf +13-18 j: gfjjjjjjjjgjhwjjch +11-15 m: mmmmmmmmmmmmmmm +2-4 s: ssqsr +7-8 v: vxxvbfdgvvgvtw +2-7 x: xwxxxxx +3-5 p: pzppfp +1-2 z: zfzwpzpxzc +6-7 r: vrrxrrnrb +3-4 f: nvftvrjsgxszkfsffg +1-5 w: kndqwltttskcwtzqt +1-9 z: zzzzzzzzzz +10-11 v: vvvvvvvvvvv +1-5 m: gmjhm +7-11 j: sdjjpjjjdgnccjjjsq +1-6 m: rrmcmmmmmbm +1-6 n: nlclfggwnm +3-7 s: clfnmssns +3-7 m: tqjmmmx +13-14 n: nfnvkntnlnnnxfwlnnnn +3-4 p: xphp +8-9 n: nnnlnnnzn +11-12 h: hhhhhhhdhhhhh +1-4 p: pjgsphp +3-9 f: pvfnfmfrcffffjf +15-16 d: dddddddddzddldgdd +2-4 b: bvztgnzbpr +3-7 w: wgwhmpwwwlwzzhwnv +5-9 n: nmznnvnnsznnw +4-6 f: zqffsnffdlbkt +6-7 s: sssssss +2-5 q: kqlqqmv +11-14 q: pjqrzjfdgmqzpd +17-18 s: sssssssssssssssssj +8-12 x: zxxxpxxxxxxt +2-4 h: hqhhhwfshp +1-9 b: qzwgfbzjvt +8-10 c: cccccccccn +3-5 n: nnnkwn +4-6 m: zmmhdzmmx +7-13 v: vvvvvnvvvvvvsvv +1-12 z: zzvzxzfzzrzm +6-11 p: ppppplppppvppppfp +1-5 s: sjsss +2-19 w: wwwwwwwwwwwwwwwwwwcw +5-6 k: zxlkrkbcrcwkdqtkkw +1-4 w: hjjbzqwnpjrbglkr +8-9 n: sznnljnqn +7-13 k: dwkpnjkdkglnm +14-20 x: xzxrxxsxxxxxxxxxxxjx +4-7 w: rtrwdvww +14-18 m: mmmpmmmmmmmmmlmnmq +3-4 z: zzxz +8-10 z: zzzzzzzzzjz +11-14 v: vcvwvxvcslbvvhv +4-8 j: jgjjbrjhp +5-6 d: dddddm +4-5 n: nnnzn +15-16 t: ttttttttttttttnc +5-8 b: bbtbspvbbgllcrgxd +8-9 w: wwwwwwwqw +3-5 j: vbjmxwjgjfrzttznwc +12-14 l: llllllllllnglzlwbl +2-4 f: ntffj +2-4 c: gvccrcc +19-20 w: wwwwwwwwwwwwwwwwwwpw +1-3 k: klwgkc +3-9 s: qsmlssskpsbsscs +8-9 j: jjjjjjjdj +5-9 s: bszlpsssss +13-14 l: llxllhlllllllllll +1-6 s: ssssscs +7-8 v: pbvptdvv +10-15 v: vvvvvvgvvvvvvvcv +4-5 k: kkcskfldskdc +13-14 v: vvvvvvvvvvvvvgv +3-7 n: hnjnnnnnsnfp +3-8 m: mtmjhrzzllqml +9-11 w: wwwwwwwwwwxw +10-20 g: pkvgkfvmxgkpjjhtqvcg +8-11 w: wwwwwwzwwwdw +5-7 r: rrrrrrb +2-7 b: sbldlwvcb +10-17 v: vvvvvvqgcvvkdvsvvjv +4-5 d: tkddnddzqpdfdddd +10-12 p: npppppppppfm +1-12 t: wttttttttttttt +4-5 f: qfffz +11-14 p: ppppppppppppgvpcp +6-8 w: qswwwrwwmww +9-15 g: txgchzlpgggdhgggbg +2-10 h: hthhzhhhshhh +5-8 l: lllllzkk +17-18 l: nlllllllllllllllvll +3-6 c: zdwcjcccdqct +8-17 m: mmmmmmmmmmmmmmmmjm +10-12 c: ccccncrccccb +4-12 j: jjjbjjjjjjnwjj +2-6 h: chbhhfc +5-6 c: cccpncc +6-7 m: dmwmkmphmmdmm +6-7 k: rxwkmkv +1-5 f: fzgfl +4-7 x: dxkmxhb +1-5 f: hhfzfpfffffsff +1-7 s: sssslsvv +3-7 w: wgwwwsh +12-15 d: mdsdbkltdvthvfjdddn +16-18 x: xxxxxxxxxxxxxxxxtl +5-19 x: xwxxxxxxxxxxxxxxbpn +3-5 h: hhrfh +8-10 g: ggggggggggkgg +3-8 c: cccccccmc +5-7 r: wrrrxrrr +7-8 p: phpprdslbpxprpg +17-19 z: zzzzvzzzzzdzzzzzzzg +2-4 x: kxxxxxm +2-11 w: gwwzpwwwwwplrqfh +6-9 t: qtcttttgf +9-12 g: gggggggggggsg +3-6 n: fzmnxb +5-9 x: pqxxxwdtn +5-6 j: jjjjjkq +10-12 h: hhhhhdhhhzhh +1-4 g: gskgk +3-5 c: ccccj +1-10 m: wmxsgmzmrzmrmmmjmmct +5-10 p: lmpppvptdgpjpwfwpp +2-4 z: bzgm +6-7 d: ddzdddj +3-7 r: gchrfwr +4-7 k: kkcvkkkkkk +8-12 t: tpwtttctvtttftpt +11-12 c: ccccccxcdncbwcc +2-10 p: jwwxlppppppnpn +9-16 w: chmwwwwwjwrwjwzjww +1-6 j: jkqjjbj +5-8 k: kkkkkklhkk +3-5 q: qqqqc +16-17 x: xxxxxxxxxxxxxxxtg +4-9 f: fmfkcfffffkcfmfhnzf +5-6 z: zhzzlz +4-17 k: kbwmwvkkvvhxkkkckqvk +3-5 d: dddmmdt +4-10 m: mmmmmmmmms +5-6 g: ghgggpj +1-5 c: cccck +3-7 z: zzjzzzzz +2-7 v: xrprnvvtsrgsk +1-5 s: sqqsn +3-5 j: xwpnj +5-7 v: vvvvvvqmv +4-5 j: jjjjzjjjjljjc +2-4 h: hghh +3-5 n: fnnpc +16-20 d: dddddddzdddddddpdddd +3-4 t: tnpt +2-7 f: fxffffkff +6-9 b: bbbhbbwhbbrblmtb +7-10 m: msmxmrnmrmmmm +3-4 r: rrzrr +7-8 m: mgmmmmjmm +2-3 l: lmll +2-6 h: cngphhhbfpvvsgrqhhzq +6-8 d: dddddddg +12-15 p: vfjxwpcpdvpnjwp +12-17 m: mzfmmsvfxmqsmcfjmwjb +15-19 b: bbbbbfbbbbbsbbmbbbbb +7-8 n: qdnjnnnpvmfnn +6-8 l: llllllll +3-4 n: nnbdh +11-12 w: hprdhfrpvcwbgwjcw +2-7 r: jrfrbjrhrw +1-6 v: fvzknvvv +10-11 t: tttstdhttqrttt +5-14 f: fxffnffffnfffff +10-13 q: qqqqqqqqqjqqqqq +1-5 v: tnvfvxvjvbvjk +4-5 c: ccccpc +4-6 t: tttttktttt +1-2 r: rwrsq +11-12 c: cccggjcccccr +11-16 g: gwggggggggqggbgggfg +12-14 b: bbggzhxsjjsbsf +5-7 r: kjdwpfbmcptrslrrr +1-2 l: lvbl +6-11 c: hsksgzhccbccbdfnzqcv +6-7 m: gmmmmmc +1-2 h: hhhh +1-3 g: rggg +4-8 z: rzzzzfbwzxkzzz +3-6 w: wwwwww +3-4 g: ggwtg +9-11 v: wxfltmvjvjm +2-4 l: llck +2-3 m: mmkgpdwzdm +2-5 d: bdjhdhjldzh +10-12 j: jnjlmjjjjpcdkjjjx +3-9 q: qqzqqqqqqqqqq +4-8 d: ddzwdpddd +3-7 m: mzmbsmcjgmpmmdkmr +8-13 q: xrxvgqdvvmjhhgdfz +3-12 z: zzjzzzzzzzzzzz +5-10 k: jkkkmkkkmkk +6-7 m: mmllmmtm +17-19 c: ccccccccccccccnckccc +6-9 w: wwwtbrwwwxww +7-9 d: wfdkwddsdsmdbswv +11-12 g: ggggggggggbgg +13-14 j: prjjdjjjjjjjcjjj +3-5 j: jjlljv +3-4 h: hrlh +6-7 l: hplnxlsjnwxzllllljcj +4-5 g: gfgml +4-5 z: zwkznzn +4-11 n: stnzhznnfnqcnn +2-5 h: hmzhh +4-6 w: wwbwwc +4-11 w: vmwwrxpkwcp +4-8 t: thxttstmtbstcvjtlflh +6-8 v: hvvkvvhfm +16-18 b: tbbbbbbbbbbbbbbbbr +8-10 f: fffffffcfl +13-15 r: rrrdrrrrrrrrrbr +8-14 t: ztstxttttttttwz +8-12 j: jgjjjjgjjjjx +5-6 m: nmqjdmgfqqmcmmvndztl +2-6 v: vwvvvvtv +15-16 l: llllllllllllllll +3-10 q: qqqqqqqqqxqq +8-9 j: rggxhvjjjk +1-3 p: pqhp +4-11 z: nkjddzczjrzktvnckmg +5-12 r: tfrdrswgwnbc +8-13 r: rrrrrrrrrrrrrr +13-18 x: xxmxvxxxxxxxhrxxxc +7-8 z: zzkzzzzw +4-8 m: mmmqmmskqlmmgm +1-3 w: bmwg +1-4 z: vzzzzzwz +3-4 d: dqdw +2-9 z: hzhqpndtllsw +10-13 t: tttttttttttbjb +12-14 r: rrrxrrsrrrgfrrr +12-19 g: hdxnlgglxwrgzkggcwp +3-4 x: qxjx +1-2 r: rrpdlqhcnwwr +5-11 c: vdbzvccdccldsjcq +4-6 k: kxkwkk +16-18 k: kkkknkkkkkkkfkkkkx +1-2 q: tqtghddbk +7-8 g: ggcgggvgg +13-19 d: ddddddfjdddddfddddd +9-15 z: pzhzzzzzqpzzzzzz +4-5 l: lclld +2-15 r: jrrmtzrxlczbttrcvkn +3-5 z: zzzzc +15-16 k: kkkckkdjnkkkkkkkkk +11-13 m: mmmmmmmmwmmmzm +8-13 p: ppdpptppdppxkppppppp +1-3 g: gszcmgjg +5-11 h: skbchhdbnphpbfl +4-7 d: prdjctk +15-18 f: ffcffffffffffzdffc +7-11 g: npggtwgzgtgzhx +12-14 m: mmmmmmmmmmmpmkm +10-11 b: bbbbbbbbbbb +3-16 k: kgxtvmlgpkptpghkb +4-6 m: zcwmzmvqvgmmsxj +6-15 m: mzmmccmmlmmrmlnl +12-13 x: xxxxxxxxwxxxz +4-5 d: mhvdtxfklzdpgdqdpqhd +5-10 g: nghgggggggqg +7-9 k: kkkkfkkkwk +6-7 c: cvcvczncn +10-11 t: tttqttttttv +18-20 h: hfsqhkwfhttgfhmbghhx +6-7 v: vgvvvwz +3-4 z: zzzj +3-5 d: dhqjnhgldtdzx +3-4 b: jbrbbbbbbbblwb +12-15 g: gsgfdfksrggqvgggjgt +6-11 p: pmppnpqpdppdpppphpf +13-14 z: zzzzgzbzzzzzgzz +4-12 c: ccjcrvcnwccwctcczcp +10-11 c: szcccfccfpcchqs +10-14 l: lllllltgjlnlbprlll +12-17 z: zhzzzxzpzzzfzzzqznz +12-15 l: llllllllmvlvllfll +7-12 c: ccccccncccccc +1-5 m: mhmmzmm +11-17 r: rrzrrwrrsrcrsmdrvrr +4-5 w: fwwpwfw +7-8 n: nnnnnnnk +3-18 n: rxhzsscgbnmzpvbqmzf +4-11 k: kkkkkkkkkkkxkkskkkdz +10-11 c: cccccccccckcccccc +8-15 r: zrrtfrjrrrrrjrrrrrr +15-16 h: ghgvlhwgqslhhhhxmp +3-5 f: ffffqf +3-8 s: bssmfsgspxssgjhsjdv +3-5 q: bfdhq +4-7 k: qknkkkd +6-9 b: bbbtbnfbbb +12-14 x: xxxxxxxqxkxvxxwxxcw +3-6 c: chfckc +3-8 h: kzkhgrffz +10-16 f: fffgjfffsvffdzfhfzff +1-3 r: rgcr +16-17 x: xxxxxdxxxxxxxxxxl +6-11 j: rsjcjjcbpchkvfjpml +9-10 s: sssqvsssjsss +17-18 v: vvvvvvvvvvvvvvvvvv +3-5 t: jtmtgtxxhzskzk +1-6 t: ttqkvdgs +13-16 q: qqqqqqhqqqqqzqqjqq +10-11 b: bbbbbvbbbbw +6-7 w: sgwmqwgwtbrllf +10-11 f: ffffffftffff +12-13 w: wwwwwwwwwwwzt +18-19 t: ttttttttttttttttttt +1-5 h: zghhr +1-2 v: dvjnctwvlp +1-2 j: jhzkzjh +3-6 h: rhhbhhh +2-4 d: dddrd +17-18 s: ssssssssssssssssns +1-8 m: smmmmmmmm +2-4 s: dcfsbzwqq +11-12 d: vnldqthkptgkkfdmtw +8-12 p: vpppzpprppppp +6-8 q: jqqqsphqjwrqj +8-10 k: ktkkkkdkkkk +4-12 v: nvvwvvvjzvvvv +5-6 z: zzzzzt +1-5 w: xwwwwwwww +11-14 p: pppfbpppkpftdpkpgpp +2-3 v: zrlv +2-4 f: fbwff +5-6 s: ssssmn +11-12 z: zzwztpzpjzhz +5-6 c: cccjcc +4-6 v: vvvgpvcpwv +5-6 j: jnzcpjnzjjcpsjfps +12-14 m: tpzwjjgpbbdmgxgphd +13-15 n: nznnnncnnnnnnnf +8-11 w: qsxwnlhwwxw +6-9 t: ltbdttnst +10-12 t: hnjdfgrhtgkl +2-4 d: dbddddc +13-14 g: gggggggbgggmgmgm +4-12 r: rrrzrgkrrrrkr +14-17 n: nnhnnnnnnnnnnnnnhnn diff --git a/2020/day2.output b/2020/day2.output new file mode 100644 index 0000000..d11a364 --- /dev/null +++ b/2020/day2.output @@ -0,0 +1,1001 @@ +min: 9, max: 11, c: p, password: pppppppppxblp, count: 10 +min: 2, max: 4, c: b, password: bbxbb, count: 4 +min: 3, max: 5, c: q, password: dqfqb, count: 2 +min: 5, max: 8, c: g, password: ggcgggglg, count: 7 +min: 10, max: 18, c: l, password: gllpmlgtrmnllhllrlll, count: 10 +min: 18, max: 19, c: z, password: zzzzznszzzzzzzzzzzxz, count: 17 +min: 3, max: 6, c: r, password: frrhxsnrmgmw, count: 3 +min: 1, max: 8, c: n, password: zkxhnxnzghnm, count: 3 +min: 11, max: 12, c: z, password: zzczzzztlzlzzzz, count: 11 +min: 4, max: 7, c: q, password: qqqbncqqq, count: 6 +min: 3, max: 4, c: c, password: ccvfc, count: 3 +min: 19, max: 20, c: l, password: sltlklljdlzglwllllzl, count: 11 +min: 6, max: 16, c: h, password: dhhhrhvhnhdchfsnhq, count: 8 +min: 3, max: 7, c: l, password: fllllqjlll, count: 7 +min: 8, max: 9, c: k, password: xkkjqklkm, count: 4 +min: 1, max: 2, c: l, password: llgpl, count: 3 +min: 2, max: 4, c: x, password: qkjxvqlv, count: 1 +min: 5, max: 6, c: c, password: cwcccjch, count: 5 +min: 3, max: 7, c: n, password: bnnhnwnqtdnndnncnd, count: 9 +min: 8, max: 9, c: n, password: nnrkmdnkn, count: 4 +min: 6, max: 9, c: t, password: ttttrtltptgvcd, count: 7 +min: 3, max: 4, c: h, password: hhwhhhdhhhh, count: 9 +min: 7, max: 8, c: w, password: wdwvcwwszcwwwwwq, count: 9 +min: 2, max: 4, c: n, password: vnng, count: 2 +min: 3, max: 13, c: v, password: vvvvvvvvvvvvjv, count: 13 +min: 9, max: 11, c: c, password: zcccccccccfcbccc, count: 13 +min: 10, max: 11, c: w, password: wkwwwwwwwxw, count: 9 +min: 10, max: 12, c: z, password: zzzzzjzzzrnzz, count: 10 +min: 5, max: 6, c: t, password: ttttts, count: 5 +min: 13, max: 19, c: b, password: bbmfbbbbbrbbgbbbrbbb, count: 15 +min: 8, max: 9, c: d, password: bdddvkddjbdgdd, count: 8 +min: 19, max: 20, c: m, password: mmmmmmmmmcmmmmmmmmmq, count: 18 +min: 6, max: 18, c: w, password: wwwwwwhwjwwwwwwcwjw, count: 15 +min: 4, max: 10, c: t, password: tttttttttj, count: 9 +min: 2, max: 7, c: j, password: fbdgmfjbjgjn, count: 3 +min: 7, max: 8, c: w, password: wwwwwwcww, count: 8 +min: 8, max: 12, c: c, password: cbmdccbccckjccch, count: 9 +min: 13, max: 15, c: f, password: fpfffffffffffqf, count: 13 +min: 7, max: 11, c: t, password: sbtstwdxjpclwd, count: 2 +min: 1, max: 3, c: s, password: shkkqcs, count: 2 +min: 7, max: 8, c: l, password: bdggzczl, count: 1 +min: 1, max: 6, c: g, password: zgggggglggggggw, count: 12 +min: 12, max: 16, c: h, password: hhhhhhhhhhhhhhphhhh, count: 18 +min: 8, max: 19, c: k, password: htknkhkrkdkhkpwppkk, count: 8 +min: 8, max: 10, c: k, password: kkxkkkbrkgk, count: 7 +min: 8, max: 9, c: h, password: hvhhhhhfhhv, count: 8 +min: 15, max: 16, c: x, password: xxxxxxxxxxxxxxxh, count: 15 +min: 1, max: 12, c: b, password: bgwpjbkhbptsbbb, count: 6 +min: 9, max: 10, c: j, password: pjtjpjpnbjjlsgbn, count: 5 +min: 8, max: 9, c: s, password: sscplbswssssglxs, count: 8 +min: 14, max: 15, c: j, password: jjjhjjjjjjxjjjj, count: 13 +min: 1, max: 4, c: q, password: qnqj, count: 2 +min: 3, max: 5, c: d, password: qpdddqvwbzldf, count: 4 +min: 14, max: 15, c: b, password: bbbbbbbbbbbbbbt, count: 14 +min: 1, max: 2, c: t, password: tdxt, count: 2 +min: 1, max: 7, c: g, password: dlpkvrgjzpnr, count: 1 +min: 3, max: 11, c: m, password: lmnwjjxpfmm, count: 3 +min: 3, max: 8, c: l, password: llglllllll, count: 9 +min: 2, max: 4, c: r, password: gfmrlbmsvqzrmbnd, count: 2 +min: 5, max: 9, c: s, password: srsqssssds, count: 7 +min: 8, max: 9, c: v, password: vvvvmvvvhw, count: 7 +min: 7, max: 10, c: d, password: mddwdvjdcdwdcgddd, count: 9 +min: 4, max: 7, c: k, password: fksjkkkk, count: 5 +min: 6, max: 9, c: t, password: fnrxmlwtt, count: 2 +min: 11, max: 12, c: d, password: dddddddddfmd, count: 10 +min: 4, max: 5, c: z, password: zzdzzzz, count: 6 +min: 11, max: 13, c: z, password: zzzzzzzzzzpzmzzz, count: 14 +min: 12, max: 14, c: z, password: zrgnvcrxkzzzrb, count: 4 +min: 10, max: 13, c: q, password: qpqqqqqrqxvqq, count: 9 +min: 6, max: 10, c: g, password: gglggggggzgggg, count: 12 +min: 2, max: 8, c: j, password: jfqjrdjjjjjj, count: 8 +min: 7, max: 8, c: z, password: hzlvrczjp, count: 2 +min: 4, max: 5, c: k, password: kggjkl, count: 2 +min: 4, max: 7, c: m, password: mpmmmcmm, count: 6 +min: 13, max: 14, c: x, password: xxxxxxzxxxxxxw, count: 12 +min: 6, max: 7, c: n, password: znnnnnlpjcn, count: 6 +min: 10, max: 16, c: g, password: gggzvgggntggfgghggg, count: 13 +min: 2, max: 17, c: n, password: hnchrpvzhkdsnhgcnfql, count: 3 +min: 2, max: 8, c: f, password: fkfpffff, count: 6 +min: 4, max: 7, c: s, password: qwdspspj, count: 2 +min: 6, max: 7, c: r, password: rrrrrnx, count: 5 +min: 7, max: 8, c: p, password: wpppppsp, count: 6 +min: 8, max: 10, c: m, password: mmmwmjmmmvmzpm, count: 9 +min: 6, max: 7, c: j, password: jjjjjncd, count: 5 +min: 3, max: 4, c: k, password: kxkk, count: 3 +min: 2, max: 4, c: z, password: czzmzz, count: 4 +min: 11, max: 12, c: t, password: tttttttttttzkp, count: 11 +min: 10, max: 17, c: t, password: ttttvtltdttrqtztr, count: 10 +min: 3, max: 6, c: n, password: nnnnvvxv, count: 4 +min: 7, max: 8, c: v, password: rvvpvvvpsvv, count: 7 +min: 1, max: 2, c: r, password: nkfgnr, count: 1 +min: 4, max: 11, c: c, password: cccbccclcccc, count: 10 +min: 7, max: 12, c: q, password: qpbqtqkqqqqqqq, count: 10 +min: 2, max: 7, c: m, password: mfmmmmmmxmnm, count: 9 +min: 10, max: 11, c: n, password: bnnnpnnncxrnnnn, count: 10 +min: 10, max: 14, c: n, password: nsnnnnnwljnsnnn, count: 10 +min: 5, max: 9, c: b, password: vcvcblrxbvjbtzbrmbr, count: 5 +min: 3, max: 9, c: m, password: kmmmmxmmkmmk, count: 8 +min: 2, max: 10, c: l, password: llbllgzllnlll, count: 9 +min: 5, max: 6, c: d, password: ddpdwdddxhpdqd, count: 8 +min: 12, max: 18, c: j, password: cjfbjccqgxlczjptqlk, count: 3 +min: 1, max: 3, c: z, password: mzzz, count: 3 +min: 5, max: 11, c: m, password: mdfmmmmtmgw, count: 6 +min: 2, max: 14, c: h, password: nhhnbhghhlhhchsqsr, count: 8 +min: 3, max: 4, c: t, password: jvtt, count: 2 +min: 2, max: 8, c: t, password: tttkxxtsttht, count: 7 +min: 7, max: 15, c: w, password: wwwwfwwwwwwrbww, count: 12 +min: 1, max: 4, c: j, password: rbjj, count: 2 +min: 8, max: 12, c: f, password: ffkhffffcsfzff, count: 9 +min: 10, max: 12, c: p, password: pppcgpqphprh, count: 6 +min: 10, max: 11, c: l, password: lllllllllsl, count: 10 +min: 7, max: 8, c: s, password: svsssssss, count: 8 +min: 4, max: 5, c: c, password: cvjcc, count: 3 +min: 1, max: 5, c: v, password: vcdcd, count: 1 +min: 5, max: 14, c: z, password: zzwkzztzzzzzbzzvzzz, count: 14 +min: 11, max: 12, c: s, password: sssssssssssps, count: 12 +min: 5, max: 7, c: b, password: spmtbpn, count: 1 +min: 5, max: 6, c: c, password: cccccf, count: 5 +min: 10, max: 12, c: p, password: ptpppppppppk, count: 10 +min: 4, max: 13, c: f, password: ffkffffkffflb, count: 9 +min: 2, max: 5, c: t, password: nttqftpnwbjbxmqdqv, count: 3 +min: 17, max: 18, c: w, password: wwwwtwwwwwwwwwwwkwww, count: 18 +min: 7, max: 9, c: f, password: lmrffdbffvfmf, count: 6 +min: 2, max: 5, c: h, password: hhhvzrhh, count: 5 +min: 10, max: 11, c: q, password: qmdrdfqgzql, count: 3 +min: 3, max: 11, c: g, password: ggggggggggm, count: 10 +min: 4, max: 5, c: z, password: zzzrzzp, count: 5 +min: 5, max: 7, c: w, password: wwwwkwwww, count: 8 +min: 10, max: 11, c: f, password: ffffffffffp, count: 10 +min: 6, max: 9, c: v, password: vvvvvvvmv, count: 8 +min: 4, max: 5, c: x, password: wjxxxxxtd, count: 5 +min: 12, max: 13, c: p, password: vppppppppppzbp, count: 11 +min: 2, max: 7, c: b, password: bqntbls, count: 2 +min: 15, max: 16, c: p, password: ppppppppppppzpfxn, count: 13 +min: 2, max: 3, c: b, password: bbcnbq, count: 3 +min: 10, max: 11, c: k, password: kkkklkmkkhk, count: 8 +min: 4, max: 6, c: w, password: wwwdjb, count: 3 +min: 4, max: 6, c: b, password: sczlwbnffbnxbvjbmj, count: 4 +min: 3, max: 17, c: m, password: jmmlmmmgmmmjmmmmmlmm, count: 15 +min: 6, max: 18, c: z, password: zmkwvzkpqzmzdfgdvt, count: 4 +min: 5, max: 6, c: q, password: sqwqqq, count: 4 +min: 1, max: 3, c: g, password: gjgt, count: 2 +min: 5, max: 8, c: x, password: bxcxxzxxws, count: 5 +min: 4, max: 5, c: c, password: rnscvcngbcmpddkcvctk, count: 5 +min: 7, max: 11, c: g, password: ggggglvgggngg, count: 10 +min: 2, max: 11, c: l, password: lsqlzlllllklgfl, count: 9 +min: 2, max: 9, c: m, password: cmqkbmdxp, count: 2 +min: 6, max: 7, c: w, password: wwwwwww, count: 7 +min: 8, max: 13, c: q, password: qbqzqqqqqlqqw, count: 9 +min: 3, max: 4, c: n, password: sfqnnnwvzn, count: 4 +min: 1, max: 2, c: w, password: nwww, count: 3 +min: 2, max: 4, c: v, password: hvvbqgnfl, count: 2 +min: 14, max: 15, c: m, password: gjgdmmmmkmqqcxmrsm, count: 7 +min: 2, max: 3, c: z, password: zzzx, count: 3 +min: 5, max: 13, c: q, password: qqqqdqqqqqtqjqq, count: 12 +min: 4, max: 5, c: z, password: zzzzk, count: 4 +min: 5, max: 6, c: t, password: tttttf, count: 5 +min: 3, max: 6, c: z, password: ztwzczkz, count: 4 +min: 3, max: 5, c: l, password: llpljllllllll, count: 11 +min: 2, max: 3, c: s, password: ssscp, count: 3 +min: 8, max: 10, c: d, password: dddddddwdddddwddg, count: 14 +min: 2, max: 6, c: s, password: sbssps, count: 4 +min: 1, max: 5, c: f, password: ffbfvfxbkmbhvbcfmxpf, count: 6 +min: 1, max: 6, c: j, password: gqfrmjgsgjjhcjhn, count: 4 +min: 2, max: 5, c: l, password: lwvllll, count: 5 +min: 2, max: 5, c: z, password: zkzhzb, count: 3 +min: 10, max: 11, c: s, password: wsblfxvmvsslbhfjtsws, count: 5 +min: 11, max: 17, c: f, password: fffffffxfffffffftfff, count: 18 +min: 4, max: 5, c: r, password: rrrkbrr, count: 5 +min: 7, max: 10, c: w, password: qwqwwwgzrdxww, count: 6 +min: 6, max: 8, c: s, password: ssssssscs, count: 8 +min: 4, max: 6, c: q, password: qbqwqzfqcfgkmzqxb, count: 5 +min: 6, max: 10, c: t, password: ttncfqqtttttp, count: 7 +min: 2, max: 4, c: m, password: bbzcjjqmfvln, count: 1 +min: 4, max: 7, c: n, password: cnqhntshdnnrnrnz, count: 6 +min: 7, max: 12, c: d, password: vmdndkzpmcbd, count: 3 +min: 6, max: 7, c: p, password: tpqpppzpjp, count: 6 +min: 3, max: 10, c: r, password: rgrrrpzrbrrr, count: 8 +min: 2, max: 15, c: h, password: ghbfhbgrtxrshphhl, count: 5 +min: 2, max: 6, c: j, password: pjjjjlj, count: 5 +min: 6, max: 9, c: j, password: rjrjjjwfjn, count: 5 +min: 10, max: 13, c: s, password: sssssssssjsssssss, count: 16 +min: 1, max: 6, c: c, password: crnjccgnw, count: 3 +min: 6, max: 7, c: l, password: qrllgql, count: 3 +min: 12, max: 13, c: z, password: wzzzzzzzzzzfz, count: 11 +min: 1, max: 2, c: c, password: ccclc, count: 4 +min: 2, max: 6, c: f, password: qdlflfr, count: 2 +min: 4, max: 10, c: r, password: drrrrrwrfrr, count: 8 +min: 5, max: 6, c: f, password: ffzffnf, count: 5 +min: 4, max: 6, c: p, password: hkppkbppp, count: 5 +min: 8, max: 9, c: r, password: rrrrrrrrx, count: 8 +min: 4, max: 12, c: f, password: fffffffffffwqp, count: 11 +min: 4, max: 6, c: q, password: qtqtjq, count: 3 +min: 4, max: 5, c: w, password: wwwcw, count: 4 +min: 2, max: 3, c: r, password: qrrr, count: 3 +min: 7, max: 10, c: k, password: nkpgzskkrb, count: 3 +min: 6, max: 9, c: h, password: hmsshhhwhhhhh, count: 9 +min: 2, max: 18, c: d, password: kxqddddqddsmddcdddwd, count: 12 +min: 6, max: 7, c: s, password: sssssssss, count: 9 +min: 4, max: 8, c: h, password: hhhbthhhhh, count: 8 +min: 1, max: 8, c: d, password: dtsbqtrpwdgfdzrtf, count: 3 +min: 6, max: 7, c: b, password: bbbbbwp, count: 5 +min: 5, max: 6, c: p, password: ppnpqjp, count: 4 +min: 4, max: 13, c: l, password: rtqpmllslrlxcblldqtc, count: 6 +min: 3, max: 4, c: m, password: wmmkcm, count: 3 +min: 4, max: 16, c: b, password: qkbvbvgxtlqbgmwc, count: 3 +min: 4, max: 5, c: h, password: hhhlghh, count: 5 +min: 10, max: 11, c: f, password: fjfffffffgjff, count: 10 +min: 9, max: 12, c: w, password: gwnfvwwrwswnqrvg, count: 5 +min: 4, max: 8, c: k, password: pjkkfkbqqzkmfk, count: 5 +min: 2, max: 8, c: x, password: xwxxxxxcxxx, count: 9 +min: 11, max: 19, c: w, password: wwwwwdjwwwrrwwlvwwww, count: 14 +min: 4, max: 14, c: w, password: rwqhwqwwlhpwfwwpww, count: 9 +min: 7, max: 9, c: j, password: vjjjjqdjjjjjj, count: 10 +min: 15, max: 17, c: x, password: kxrmxjvxxxvxxxzxxxf, count: 11 +min: 3, max: 10, c: p, password: pwpxppzgdrrx, count: 4 +min: 1, max: 5, c: p, password: ppppp, count: 5 +min: 10, max: 19, c: n, password: vfnwnjstnnjnqnngnzs, count: 8 +min: 2, max: 5, c: m, password: phsmq, count: 1 +min: 5, max: 6, c: m, password: mmmmxmm, count: 6 +min: 2, max: 12, c: f, password: tftgcmcblzcljsdlbvf, count: 2 +min: 6, max: 11, c: b, password: hbbbbbbbzhwbtbbhmrb, count: 11 +min: 7, max: 11, c: j, password: jjjjjjvjjjq, count: 9 +min: 3, max: 4, c: d, password: dddgddnmd, count: 6 +min: 11, max: 14, c: f, password: fxfffffftqfflffffpf, count: 14 +min: 14, max: 16, c: x, password: xxxxxcxxxxjgxxvt, count: 11 +min: 6, max: 7, c: h, password: hhhhhht, count: 6 +min: 7, max: 8, c: h, password: hhhhhhzphhhh, count: 10 +min: 5, max: 12, c: w, password: wfwwwjzwmpxwmw, count: 7 +min: 2, max: 7, c: h, password: chcjhhqhdlfshxvhz, count: 6 +min: 7, max: 15, c: h, password: hjhhjvhhhhqmhdhjh, count: 10 +min: 1, max: 2, c: f, password: bvhf, count: 1 +min: 4, max: 6, c: k, password: rkctkkm, count: 3 +min: 5, max: 6, c: n, password: nnnnnn, count: 6 +min: 10, max: 11, c: j, password: jjjjjjjcjjs, count: 9 +min: 4, max: 7, c: b, password: bbgbnkp, count: 3 +min: 2, max: 5, c: d, password: dddddjvddxdk, count: 8 +min: 11, max: 19, c: z, password: svzzgzzmzznzzzkcdzzz, count: 12 +min: 8, max: 9, c: z, password: zzzzzgzmz, count: 7 +min: 4, max: 10, c: v, password: vsvvvvnvsr, count: 6 +min: 5, max: 15, c: v, password: mvqvvkjfvwdvvdl, count: 6 +min: 13, max: 14, c: s, password: ssssssqzszssmk, count: 9 +min: 3, max: 4, c: w, password: wbwg, count: 2 +min: 10, max: 11, c: d, password: kdbdcddqddxdddd, count: 10 +min: 8, max: 9, c: t, password: tttttttntt, count: 9 +min: 2, max: 10, c: m, password: mqmmmmmmmm, count: 9 +min: 3, max: 8, c: c, password: bcswcncchpxcxcrccrx, count: 8 +min: 4, max: 10, c: q, password: qqqplwsfxgq, count: 4 +min: 15, max: 16, c: h, password: hhqhhhhhhvhhhhhthhhh, count: 17 +min: 11, max: 13, c: s, password: sssxssswsswsr, count: 9 +min: 6, max: 7, c: z, password: zzzzhvzz, count: 6 +min: 3, max: 4, c: j, password: ktjdxsjjxjtnq, count: 4 +min: 5, max: 7, c: w, password: wwxwlwwr, count: 5 +min: 2, max: 5, c: l, password: llltll, count: 5 +min: 2, max: 6, c: m, password: qmgvtmtp, count: 2 +min: 11, max: 16, c: v, password: vvvgvvlvhvvvvvvvvvgv, count: 16 +min: 2, max: 4, c: j, password: jsnjf, count: 2 +min: 11, max: 12, c: g, password: gdlcvdgzgqpg, count: 4 +min: 10, max: 12, c: x, password: rxxcxxxxxrrxx, count: 9 +min: 9, max: 12, c: n, password: nnnnnnnncdnn, count: 10 +min: 6, max: 10, c: j, password: vjjjpjhjjs, count: 6 +min: 5, max: 6, c: d, password: dcdddt, count: 4 +min: 3, max: 13, c: c, password: cccccvctcbvcvpcccc, count: 12 +min: 1, max: 7, c: d, password: ndddzzdx, count: 4 +min: 9, max: 10, c: w, password: wwwcwwwwfr, count: 7 +min: 9, max: 18, c: q, password: xjhsjqqrqpgprjmqqq, count: 6 +min: 8, max: 11, c: b, password: bprbbbwkbbbb, count: 8 +min: 4, max: 14, c: w, password: wxcwzsswmsqvfjvjzj, count: 3 +min: 5, max: 6, c: b, password: wbbmzbbm, count: 4 +min: 8, max: 13, c: f, password: lpjfsfswfffgfkff, count: 8 +min: 1, max: 3, c: x, password: vxxx, count: 3 +min: 6, max: 7, c: x, password: btxxxxcx, count: 5 +min: 6, max: 8, c: r, password: mwqrrqrrxr, count: 5 +min: 7, max: 14, c: h, password: hhhhjllhrsxtrhmbbpwh, count: 7 +min: 7, max: 10, c: f, password: phqzgfwfrpffpzq, count: 4 +min: 6, max: 17, c: d, password: ddddddddddddxdbdgdd, count: 16 +min: 5, max: 11, c: f, password: fhfnfflfhjvwvfff, count: 8 +min: 11, max: 12, c: h, password: hhgbtnkhhhhh, count: 7 +min: 2, max: 4, c: f, password: fdfgffr, count: 4 +min: 5, max: 6, c: w, password: wwwwxw, count: 5 +min: 4, max: 9, c: z, password: zbzzzczzv, count: 6 +min: 2, max: 4, c: k, password: jfpkc, count: 1 +min: 3, max: 4, c: r, password: kwgr, count: 1 +min: 4, max: 5, c: k, password: kkkks, count: 4 +min: 5, max: 6, c: r, password: rrrdrsr, count: 5 +min: 5, max: 6, c: t, password: tpwnmttclcrtt, count: 5 +min: 18, max: 19, c: t, password: ttbwxtxgfsphgtzzplbt, count: 5 +min: 1, max: 5, c: w, password: tthwwvw, count: 3 +min: 10, max: 13, c: z, password: mzzzzzwzzzzztz, count: 11 +min: 7, max: 10, c: r, password: rzrjrfpdrrrcmmrr, count: 8 +min: 2, max: 4, c: w, password: wwww, count: 4 +min: 5, max: 9, c: m, password: vksmmzdpsm, count: 3 +min: 1, max: 2, c: q, password: qqqqqqq, count: 7 +min: 1, max: 6, c: c, password: pccccn, count: 4 +min: 3, max: 8, c: r, password: pbchhhrr, count: 2 +min: 3, max: 8, c: v, password: bfdvkvdvglvn, count: 4 +min: 3, max: 6, c: h, password: hhhxhshhl, count: 6 +min: 4, max: 7, c: m, password: mkwpkwmtmm, count: 4 +min: 10, max: 11, c: g, password: ggggmggggcg, count: 9 +min: 1, max: 6, c: j, password: jjjjjw, count: 5 +min: 4, max: 10, c: z, password: zvzzxzzgzzz, count: 8 +min: 7, max: 9, c: k, password: kkkkkkkkjkkkk, count: 12 +min: 4, max: 18, c: f, password: vlnfpdzvbqhvsfmhqtf, count: 3 +min: 8, max: 11, c: s, password: sssssksshsssmhs, count: 11 +min: 2, max: 6, c: b, password: bbbbbm, count: 5 +min: 2, max: 3, c: h, password: hhvrlcf, count: 2 +min: 10, max: 19, c: c, password: mccwczqbjdlgfccnrqc, count: 6 +min: 8, max: 12, c: x, password: rxxxnxtfxcxxxpx, count: 9 +min: 13, max: 14, c: r, password: rrrnrrrrrrrrmrr, count: 13 +min: 4, max: 11, c: h, password: mhzstqhhghhhbhhh, count: 9 +min: 10, max: 11, c: f, password: fffffffffpf, count: 10 +min: 7, max: 8, c: j, password: jjjjjjmv, count: 6 +min: 5, max: 6, c: f, password: fhfffv, count: 4 +min: 3, max: 4, c: z, password: zzxtzq, count: 3 +min: 5, max: 6, c: v, password: jvszvzvvg, count: 4 +min: 9, max: 13, c: v, password: wvvgvdvvvsrjcg, count: 6 +min: 10, max: 11, c: t, password: pcttrntttttdthtxst, count: 10 +min: 1, max: 5, c: v, password: vvvvpv, count: 5 +min: 6, max: 9, c: q, password: qfqqqlqqqqq, count: 9 +min: 4, max: 8, c: f, password: ffffffmfkkfzpffffvff, count: 14 +min: 3, max: 5, c: n, password: lnmnnnnnnnn, count: 9 +min: 1, max: 5, c: k, password: kkwmdkflxtqktmcxdl, count: 4 +min: 1, max: 3, c: z, password: tnqp, count: 0 +min: 15, max: 16, c: h, password: hhhnhhhhfhhhhhjhhh, count: 15 +min: 2, max: 6, c: m, password: mmmxmb, count: 4 +min: 7, max: 12, c: q, password: qqjqhqfqwqcqqkqmql, count: 10 +min: 6, max: 10, c: s, password: ssjvrvsgsshsss, count: 8 +min: 11, max: 15, c: n, password: nnnnnnnnnnrnnnj, count: 13 +min: 14, max: 15, c: x, password: xxxxvxxxxxkxxxzx, count: 13 +min: 9, max: 14, c: b, password: bbbbbbpbbqbblbbbb, count: 14 +min: 4, max: 12, c: h, password: knthjdhlrxtpjwhnhn, count: 4 +min: 8, max: 9, c: v, password: vvvvvvvjjvvvv, count: 11 +min: 2, max: 3, c: d, password: dktdvd, count: 3 +min: 6, max: 8, c: z, password: zzzzzzzx, count: 7 +min: 10, max: 13, c: t, password: jrjfklzstpxwt, count: 2 +min: 4, max: 16, c: n, password: mngnnqnbnnwnqrdgk, count: 7 +min: 3, max: 5, c: v, password: vhqvvn, count: 3 +min: 1, max: 4, c: t, password: jhtq, count: 1 +min: 8, max: 11, c: f, password: qfffffqfffff, count: 10 +min: 14, max: 15, c: x, password: xxxxxxxxxxxxxxx, count: 15 +min: 2, max: 12, c: s, password: scsstsssmcssswgsw, count: 10 +min: 8, max: 13, c: t, password: tttttttqttttt, count: 12 +min: 8, max: 10, c: d, password: ddddddvdfbq, count: 7 +min: 9, max: 15, c: d, password: sdqpqddddjrdjnj, count: 6 +min: 17, max: 19, c: c, password: cccccdldcccpbccxgcc, count: 12 +min: 6, max: 14, c: v, password: lvvvvsvvvvvvvp, count: 11 +min: 16, max: 18, c: p, password: ppppppppppvpppppppt, count: 17 +min: 1, max: 3, c: v, password: vkvtzlvrdcvzplznltqs, count: 4 +min: 8, max: 10, c: s, password: sssssssssns, count: 10 +min: 1, max: 3, c: w, password: wcwfwxnwwp, count: 5 +min: 8, max: 10, c: v, password: kvvvvvvvvvkvvv, count: 12 +min: 7, max: 11, c: s, password: shsssssssns, count: 9 +min: 9, max: 10, c: w, password: wwwwtwwgkwww, count: 9 +min: 1, max: 2, c: x, password: vxxn, count: 2 +min: 4, max: 9, c: g, password: lkgggrcgpg, count: 5 +min: 1, max: 5, c: n, password: fjrnn, count: 2 +min: 4, max: 6, c: x, password: xtxzxxx, count: 5 +min: 18, max: 19, c: z, password: zzzzhvzhzzzzzzzzzsz, count: 15 +min: 15, max: 18, c: p, password: ppppppppppppppsppppp, count: 19 +min: 11, max: 14, c: h, password: rdhhhhhhhghhhrh, count: 11 +min: 3, max: 9, c: v, password: vvvvvvvvqvv, count: 10 +min: 4, max: 8, c: p, password: bbpmjpplp, count: 4 +min: 1, max: 15, c: n, password: qndxnnsmnrnsnnnnn, count: 10 +min: 7, max: 9, c: c, password: cccccctccc, count: 9 +min: 2, max: 6, c: m, password: xwfnmmn, count: 2 +min: 4, max: 16, c: t, password: nbttltzvhqjtcgbtttkt, count: 8 +min: 7, max: 8, c: r, password: rrlrrrrsrbr, count: 8 +min: 3, max: 5, c: h, password: hhghh, count: 4 +min: 3, max: 4, c: m, password: mmmxm, count: 4 +min: 15, max: 16, c: k, password: fckzkjskrkkkdkkl, count: 8 +min: 5, max: 6, c: c, password: cbsxmh, count: 1 +min: 1, max: 6, c: x, password: fxxxxxx, count: 6 +min: 5, max: 12, c: d, password: wdddqrdkwkmdfwd, count: 6 +min: 3, max: 10, c: s, password: smsqncrsjjdmjdlsls, count: 5 +min: 6, max: 7, c: k, password: vkkskkjkwkrkkk, count: 9 +min: 9, max: 17, c: z, password: qwzhqgrnvzzbzlhjz, count: 5 +min: 5, max: 6, c: w, password: dwwwwp, count: 4 +min: 5, max: 8, c: n, password: ncvgqnvn, count: 3 +min: 5, max: 6, c: v, password: vvnvvwvv, count: 6 +min: 3, max: 4, c: x, password: dxxxsbsxx, count: 5 +min: 8, max: 12, c: t, password: ttgtshxfmzlc, count: 3 +min: 10, max: 17, c: x, password: xthkjfxlktkbhdxzx, count: 4 +min: 5, max: 8, c: q, password: qqtqqqkqq, count: 7 +min: 4, max: 10, c: d, password: ndddgxvzswlsgdpnrc, count: 4 +min: 8, max: 11, c: h, password: bgcfhhrkhhb, count: 4 +min: 16, max: 19, c: g, password: qgdmbghrjhgcvgwpggg, count: 7 +min: 3, max: 5, c: s, password: fbsqqszkdkqzw, count: 2 +min: 9, max: 10, c: h, password: hhhhhhhhdhhh, count: 11 +min: 15, max: 17, c: b, password: bbbbbbbbbtbbbbzbbb, count: 16 +min: 11, max: 14, c: q, password: qqqhqqqqqqqqqsq, count: 13 +min: 4, max: 18, c: r, password: rhhrrpghwbqfznflrrr, count: 6 +min: 14, max: 15, c: l, password: lllllllllllllrl, count: 14 +min: 8, max: 14, c: s, password: nsfpsrsssnffssjss, count: 9 +min: 17, max: 18, c: k, password: kkkkkkkkkkklkkkkck, count: 16 +min: 1, max: 12, c: c, password: cmnccccccccktcc, count: 11 +min: 7, max: 14, c: p, password: pppppphppppppp, count: 13 +min: 1, max: 2, c: j, password: jtjq, count: 2 +min: 2, max: 6, c: w, password: wwpxxrwwwdwwh, count: 7 +min: 5, max: 12, c: p, password: zspwppnppdghqplnj, count: 6 +min: 3, max: 5, c: h, password: zhqphfth, count: 3 +min: 1, max: 3, c: q, password: xqqq, count: 3 +min: 4, max: 9, c: r, password: qrzrfgpnbj, count: 2 +min: 7, max: 8, c: q, password: qqqjqqqcqw, count: 7 +min: 4, max: 6, c: m, password: mmmmmwdmm, count: 7 +min: 4, max: 6, c: s, password: sqcssgnsrrddgshvbcs, count: 6 +min: 2, max: 6, c: m, password: mmsgtr, count: 2 +min: 3, max: 9, c: v, password: wvwvvvmvv, count: 6 +min: 3, max: 5, c: j, password: jcjvtgjjjxvjjgjbhj, count: 9 +min: 4, max: 6, c: f, password: qsffzgff, count: 4 +min: 8, max: 9, c: x, password: nxxbxwfrxx, count: 5 +min: 1, max: 7, c: m, password: mvmmmbmmljmg, count: 7 +min: 5, max: 8, c: d, password: pdcdqdddwdl, count: 6 +min: 1, max: 3, c: m, password: mmgns, count: 2 +min: 19, max: 20, c: r, password: rrrrrrrrrrrrrrrrrrxr, count: 19 +min: 1, max: 4, c: h, password: hpghbhkhhr, count: 5 +min: 5, max: 9, c: x, password: xxxxtxxxxxxxxxxx, count: 15 +min: 19, max: 20, c: p, password: qvwdwnssfckjczggpghp, count: 2 +min: 8, max: 12, c: k, password: kkkkkkkfkkkkkkkk, count: 15 +min: 10, max: 12, c: b, password: cbbbbdbbbqbkbb, count: 10 +min: 2, max: 8, c: n, password: nkkpnprnfcnnwsmndqnn, count: 8 +min: 11, max: 12, c: d, password: ddddddvddddvd, count: 11 +min: 4, max: 8, c: j, password: jjjjjjjqjjl, count: 9 +min: 1, max: 3, c: l, password: lvdlslllhllsg, count: 7 +min: 12, max: 15, c: j, password: jzjjjjjkjpjjjjqf, count: 11 +min: 6, max: 9, c: s, password: sssssssssssss, count: 13 +min: 1, max: 2, c: z, password: xzzcnjrzzzzzzz, count: 9 +min: 5, max: 6, c: h, password: hhhhhh, count: 6 +min: 7, max: 13, c: x, password: xxzxvsmxlbxpxz, count: 6 +min: 2, max: 4, c: d, password: dpnddbdfdm, count: 5 +min: 9, max: 16, c: n, password: nnnnnnnnknnnnnnr, count: 14 +min: 4, max: 5, c: n, password: nnnvnn, count: 5 +min: 13, max: 16, c: p, password: vppppppppppppppz, count: 14 +min: 3, max: 6, c: w, password: wwtwww, count: 5 +min: 7, max: 9, c: n, password: nnxnwntnnn, count: 7 +min: 4, max: 12, c: q, password: mqcnsrvqqzgqkwz, count: 4 +min: 3, max: 4, c: t, password: dwtj, count: 1 +min: 9, max: 12, c: r, password: rrrrwrrrrdrcr, count: 10 +min: 8, max: 9, c: w, password: wwtcwwjhwwww, count: 8 +min: 6, max: 8, c: w, password: wwwwwwbgw, count: 7 +min: 5, max: 15, c: f, password: pgflfgfbbvvffkfkmw, count: 6 +min: 10, max: 17, c: s, password: ssssssssshsssfsssss, count: 17 +min: 19, max: 20, c: m, password: mmbmxfmmbzqhmxmxmmmw, count: 10 +min: 11, max: 12, c: d, password: ddddddddddsd, count: 11 +min: 13, max: 14, c: f, password: fffffffffffffdf, count: 14 +min: 1, max: 6, c: n, password: nnnnnnnn, count: 8 +min: 11, max: 19, c: x, password: wmxxbxxkxxxpxxxxxxc, count: 13 +min: 2, max: 3, c: z, password: szgkqvmzwztdcxtvn, count: 3 +min: 16, max: 20, c: z, password: zpzhwdtdzhvgcpdpzzzz, count: 7 +min: 15, max: 19, c: p, password: ppmpcxppppprsgnpppg, count: 11 +min: 4, max: 5, c: x, password: rrxfxxxqx, count: 5 +min: 1, max: 2, c: q, password: rqdwn, count: 1 +min: 4, max: 6, c: x, password: pkfxqxxfxbk, count: 4 +min: 13, max: 17, c: c, password: ccccccccccccncclc, count: 15 +min: 5, max: 7, c: z, password: zzzzvhz, count: 5 +min: 5, max: 6, c: r, password: rrrnrl, count: 4 +min: 2, max: 5, c: g, password: mfgkgxhckg, count: 3 +min: 3, max: 6, c: c, password: cnmcjcccdccccv, count: 9 +min: 7, max: 11, c: t, password: dttttttrttxtt, count: 10 +min: 6, max: 9, c: p, password: ptlfppppcvsp, count: 6 +min: 3, max: 5, c: g, password: ggxkwtj, count: 2 +min: 5, max: 16, c: x, password: phzxlbhqxgxzwjwkkxp, count: 4 +min: 7, max: 8, c: s, password: wsssssmsn, count: 6 +min: 1, max: 7, c: m, password: pmgrmkmmnnm, count: 5 +min: 15, max: 16, c: n, password: nnnnnnnnnvnnnnnln, count: 15 +min: 6, max: 8, c: t, password: ttzttftst, count: 6 +min: 5, max: 7, c: g, password: ggggggggggg, count: 11 +min: 13, max: 16, c: d, password: ddddddddddddpddbdfdd, count: 17 +min: 13, max: 14, c: f, password: jclffflwlffbfvffffbn, count: 10 +min: 3, max: 4, c: j, password: xjzjjjr, count: 4 +min: 8, max: 14, c: n, password: nnnwknndnlnlnn, count: 9 +min: 6, max: 7, c: s, password: sxsssnzs, count: 5 +min: 6, max: 7, c: r, password: rrsprrjrcrb, count: 6 +min: 10, max: 11, c: w, password: qwwcwqzwrbq, count: 4 +min: 7, max: 10, c: b, password: bbbbbbzbbbb, count: 10 +min: 5, max: 6, c: d, password: ddddkd, count: 5 +min: 16, max: 17, c: d, password: ldldddddpdldldddd, count: 12 +min: 5, max: 14, c: w, password: zdtwxnxwhwwpww, count: 6 +min: 6, max: 9, c: q, password: mqqxqsqqq, count: 6 +min: 2, max: 11, c: g, password: gpggzvgggkgmcmt, count: 7 +min: 6, max: 14, c: k, password: kfkkkxkkkkkkkjkk, count: 13 +min: 2, max: 3, c: m, password: zfmm, count: 2 +min: 13, max: 17, c: k, password: kkbkkkkmkktkkkrkk, count: 13 +min: 4, max: 6, c: z, password: tzprqwzzcpj, count: 3 +min: 3, max: 4, c: w, password: gblwcxwllzpv, count: 2 +min: 3, max: 5, c: d, password: ddcddd, count: 5 +min: 9, max: 13, c: r, password: rrfjmrcsrrwvrrk, count: 7 +min: 11, max: 17, c: m, password: dgwrmqjmclmczrlwf, count: 3 +min: 1, max: 4, c: v, password: vvhvvv, count: 5 +min: 10, max: 13, c: c, password: clhccbcvbvcfcccqccc, count: 11 +min: 11, max: 13, c: s, password: sssssssssssss, count: 13 +min: 6, max: 7, c: k, password: skkckkk, count: 5 +min: 2, max: 5, c: m, password: mfffq, count: 1 +min: 3, max: 5, c: x, password: jxbxx, count: 3 +min: 1, max: 2, c: c, password: ctcc, count: 3 +min: 5, max: 8, c: q, password: qqqqgqqqq, count: 8 +min: 11, max: 13, c: q, password: hqqbqqqqqqbqqqqqbk, count: 13 +min: 9, max: 11, c: q, password: qqqqqqqqqql, count: 10 +min: 15, max: 20, c: q, password: qqqqqqqqnqqqqqqqqqqq, count: 19 +min: 5, max: 7, c: g, password: gzngbvggmlzzrgx, count: 5 +min: 2, max: 10, c: n, password: zjknggzlvnxtbwnhmf, count: 3 +min: 2, max: 13, c: c, password: cccccccccccct, count: 12 +min: 4, max: 8, c: c, password: cccccccbcccc, count: 11 +min: 3, max: 5, c: k, password: kdkkz, count: 3 +min: 8, max: 10, c: h, password: nchthhghhjhjh, count: 7 +min: 10, max: 11, c: l, password: wllllllllplxllnjj, count: 11 +min: 14, max: 17, c: q, password: qqhqqqqqqtqvqcqqqrq, count: 14 +min: 5, max: 9, c: d, password: dddddddrz, count: 7 +min: 13, max: 14, c: z, password: zzzzzzzzzzzzzm, count: 13 +min: 7, max: 9, c: t, password: tttttctwlttt, count: 9 +min: 6, max: 13, c: w, password: dwcwdtwrwccwwl, count: 6 +min: 10, max: 11, c: h, password: hhhhhwhhmmhhhh, count: 11 +min: 7, max: 9, c: t, password: tttttjtttt, count: 9 +min: 12, max: 17, c: n, password: nnnnknnfpnnwncnnjn, count: 12 +min: 5, max: 6, c: c, password: zccccc, count: 5 +min: 11, max: 13, c: s, password: ssssksxssssss, count: 11 +min: 9, max: 17, c: q, password: qqqqcfbqrqqcqzqqlqqq, count: 13 +min: 3, max: 4, c: m, password: dmml, count: 2 +min: 4, max: 6, c: v, password: slvvvln, count: 3 +min: 4, max: 5, c: n, password: nnbmnn, count: 4 +min: 2, max: 7, c: h, password: whhhhhjvfhhh, count: 8 +min: 2, max: 5, c: s, password: slhss, count: 3 +min: 4, max: 5, c: q, password: zbhqhqgqdq, count: 4 +min: 2, max: 6, c: p, password: pjtxqp, count: 2 +min: 7, max: 9, c: h, password: hhhhhhkhh, count: 8 +min: 7, max: 8, c: w, password: fgvwcwws, count: 3 +min: 10, max: 13, c: d, password: ddddxhdddddvhdddd, count: 13 +min: 7, max: 16, c: m, password: mmnznmmwmwrmqzrqbmpr, count: 7 +min: 12, max: 13, c: v, password: vvvvvvvvvzvvjv, count: 12 +min: 18, max: 19, c: g, password: mztkzhgmndnffztwqfg, count: 2 +min: 7, max: 8, c: j, password: jjjcjjvjjjjpjjjjjjj, count: 16 +min: 7, max: 10, c: s, password: sssssssssz, count: 9 +min: 18, max: 20, c: s, password: sssssssssssssssssssg, count: 19 +min: 1, max: 4, c: r, password: trrrr, count: 4 +min: 2, max: 16, c: r, password: mrrrrrrhrcrrfcpqrh, count: 10 +min: 5, max: 13, c: n, password: nnbljfchnnnnnj, count: 7 +min: 1, max: 6, c: v, password: vvvvvmvv, count: 7 +min: 7, max: 15, c: q, password: szqhbkqxppcbkxmc, count: 2 +min: 9, max: 10, c: l, password: gllllvllsvll, count: 8 +min: 1, max: 4, c: m, password: mxldw, count: 1 +min: 5, max: 9, c: x, password: xxxxxxxxj, count: 8 +min: 11, max: 16, c: t, password: ttttttttwttttttfl, count: 14 +min: 7, max: 12, c: j, password: sjjzpjjjjljhj, count: 8 +min: 1, max: 5, c: x, password: wmplxj, count: 1 +min: 2, max: 6, c: z, password: zzxzzrzqplrh, count: 5 +min: 4, max: 6, c: w, password: cqbwwbww, count: 4 +min: 14, max: 15, c: l, password: llllltllllllllw, count: 13 +min: 3, max: 4, c: m, password: mhmvvz, count: 2 +min: 3, max: 4, c: w, password: wwmw, count: 3 +min: 1, max: 4, c: c, password: ccchpccc, count: 6 +min: 6, max: 10, c: p, password: pppppppppqprbppppp, count: 15 +min: 9, max: 15, c: h, password: hhhjcrhhhhhhchhjht, count: 12 +min: 8, max: 11, c: g, password: gggggggkggggggggg, count: 16 +min: 4, max: 9, c: h, password: hhkqxhhhlh, count: 6 +min: 7, max: 8, c: f, password: mlfdfrmfbfttmffqfff, count: 9 +min: 7, max: 9, c: t, password: nttttttvsn, count: 6 +min: 6, max: 9, c: h, password: hhhhbhvhph, count: 7 +min: 4, max: 5, c: f, password: hhcdf, count: 1 +min: 3, max: 4, c: k, password: kfxkcr, count: 2 +min: 1, max: 4, c: z, password: zzml, count: 2 +min: 3, max: 5, c: f, password: cjjffbzffqfsbm, count: 5 +min: 4, max: 5, c: f, password: ffdfh, count: 3 +min: 6, max: 17, c: h, password: hhhhhhhhhhhhhhhhrh, count: 17 +min: 8, max: 10, c: d, password: qdddzddddzdd, count: 9 +min: 7, max: 8, c: j, password: nfxxthqj, count: 1 +min: 2, max: 4, c: n, password: nnnc, count: 3 +min: 3, max: 5, c: v, password: vlvzx, count: 2 +min: 6, max: 10, c: n, password: nnnnnnnnns, count: 9 +min: 11, max: 13, c: q, password: bzhwhbvwqffzs, count: 1 +min: 3, max: 6, c: c, password: gccmcc, count: 4 +min: 2, max: 5, c: m, password: xmbgm, count: 2 +min: 2, max: 11, c: g, password: tgztmzzbgjzc, count: 2 +min: 2, max: 5, c: j, password: jsjbj, count: 3 +min: 3, max: 4, c: v, password: vvljvvv, count: 5 +min: 3, max: 6, c: p, password: pxwcnwmp, count: 2 +min: 2, max: 7, c: j, password: ndjnzmjklxqwpkpnwb, count: 2 +min: 1, max: 20, c: s, password: slssswsnssscgbssxsdg, count: 11 +min: 3, max: 4, c: r, password: rrrfjc, count: 3 +min: 5, max: 16, c: t, password: ttntptttsqtttpwtgbt, count: 11 +min: 3, max: 4, c: g, password: fxgg, count: 2 +min: 13, max: 17, c: l, password: llltllllllllvllllvrl, count: 16 +min: 5, max: 8, c: q, password: vxfpqhqd, count: 2 +min: 4, max: 8, c: c, password: cvqcwkccp, count: 4 +min: 5, max: 11, c: x, password: kxqkghvxxdqfwxxkxx, count: 7 +min: 4, max: 5, c: t, password: tttht, count: 4 +min: 8, max: 11, c: n, password: mnnpnnpsnqdknnvsh, count: 7 +min: 1, max: 4, c: g, password: gggngpdggv, count: 6 +min: 5, max: 6, c: s, password: ssssss, count: 6 +min: 4, max: 7, c: d, password: mddfddk, count: 4 +min: 7, max: 8, c: f, password: fffffffb, count: 7 +min: 4, max: 11, c: x, password: cbmcvvvvxgn, count: 1 +min: 14, max: 16, c: d, password: vdddkddpddddllrddddd, count: 14 +min: 8, max: 9, c: h, password: qhhhsnxhjmzhlhdjxhf, count: 7 +min: 5, max: 13, c: f, password: fxfhlqsffxfgwpcz, count: 5 +min: 14, max: 16, c: g, password: jggggnngggngggggjggg, count: 15 +min: 1, max: 5, c: z, password: rzgzt, count: 2 +min: 3, max: 6, c: f, password: fffgrv, count: 3 +min: 3, max: 4, c: w, password: zwwtwdw, count: 4 +min: 9, max: 12, c: g, password: dkmhhvhjgsvqglbrr, count: 2 +min: 4, max: 5, c: g, password: gbrtx, count: 1 +min: 1, max: 5, c: r, password: xrrrr, count: 4 +min: 2, max: 5, c: d, password: ddddddddddddddd, count: 15 +min: 4, max: 5, c: j, password: jjvjz, count: 3 +min: 2, max: 4, c: b, password: blbbbt, count: 4 +min: 16, max: 17, c: b, password: bbbbbbbbbbblbbbzbc, count: 15 +min: 8, max: 13, c: l, password: lljlqlkslqllllll, count: 11 +min: 6, max: 15, c: g, password: wgfgzggggggbtch, count: 8 +min: 4, max: 13, c: w, password: cwvbtpnjdkvww, count: 3 +min: 8, max: 10, c: x, password: xtdxxxxxxhxxx, count: 10 +min: 3, max: 6, c: p, password: pprpppp, count: 6 +min: 15, max: 17, c: p, password: ppppppppppppppkpppp, count: 18 +min: 1, max: 3, c: w, password: wnwpwwbllb, count: 4 +min: 3, max: 5, c: m, password: mxqdq, count: 1 +min: 13, max: 16, c: s, password: hsrsssqssssscgssss, count: 13 +min: 1, max: 2, c: c, password: zccccm, count: 4 +min: 5, max: 8, c: r, password: rrrrkrrm, count: 6 +min: 5, max: 6, c: j, password: njjkjjsj, count: 5 +min: 5, max: 10, c: r, password: rrrrhrrrrr, count: 9 +min: 5, max: 12, c: x, password: xmxwxnmxsldlrpgxxxc, count: 7 +min: 4, max: 6, c: z, password: ztzwfzj, count: 3 +min: 11, max: 15, c: w, password: wwcwwwwwwwzwwww, count: 13 +min: 5, max: 7, c: c, password: cpccccnd, count: 5 +min: 1, max: 16, c: q, password: qqvhqhnpqscqqldqbzh, count: 7 +min: 8, max: 9, c: s, password: kfpdswzssssqssscms, count: 9 +min: 2, max: 16, c: l, password: hppbqldllnlljvflltl, count: 8 +min: 4, max: 12, c: c, password: cccccccccccpccc, count: 14 +min: 5, max: 6, c: r, password: rrrrqb, count: 4 +min: 11, max: 12, c: f, password: ffffdffffmfdkff, count: 11 +min: 5, max: 6, c: k, password: lhkkkf, count: 3 +min: 12, max: 15, c: z, password: bzzzzzzzzstzzzz, count: 12 +min: 5, max: 13, c: c, password: kgsscwsfzcbwchwk, count: 3 +min: 11, max: 18, c: m, password: wmmjbmfpvmmmthfwpsxf, count: 6 +min: 7, max: 14, c: m, password: mmmfmmtqmmmmmmmmrc, count: 13 +min: 14, max: 15, c: g, password: wbqfggngtbqvpqp, count: 3 +min: 10, max: 11, c: k, password: kkkvxktjtkbjkkkk, count: 9 +min: 2, max: 4, c: b, password: wbtkp, count: 1 +min: 4, max: 10, c: v, password: vvvvbffvmtvvz, count: 7 +min: 6, max: 8, c: m, password: vtvgmmbc, count: 2 +min: 1, max: 7, c: d, password: hddsnzd, count: 3 +min: 2, max: 3, c: d, password: rndxchftldndc, count: 3 +min: 2, max: 11, c: z, password: zzcwbxkzzqzzp, count: 6 +min: 5, max: 6, c: q, password: wqqqjq, count: 4 +min: 9, max: 10, c: d, password: ddddddpdcdd, count: 9 +min: 1, max: 12, c: g, password: ggfggggggggbn, count: 10 +min: 4, max: 5, c: v, password: vvvrvv, count: 5 +min: 12, max: 14, c: r, password: rrrrrrrrrrrqrr, count: 13 +min: 6, max: 10, c: s, password: sssshvssss, count: 8 +min: 7, max: 10, c: g, password: gqgzgggksggggdqghs, count: 10 +min: 8, max: 9, c: c, password: ccccccccf, count: 8 +min: 13, max: 18, c: j, password: gfjjjjjjjjgjhwjjch, count: 11 +min: 11, max: 15, c: m, password: mmmmmmmmmmmmmmm, count: 15 +min: 2, max: 4, c: s, password: ssqsr, count: 3 +min: 7, max: 8, c: v, password: vxxvbfdgvvgvtw, count: 5 +min: 2, max: 7, c: x, password: xwxxxxx, count: 6 +min: 3, max: 5, c: p, password: pzppfp, count: 4 +min: 1, max: 2, c: z, password: zfzwpzpxzc, count: 4 +min: 6, max: 7, c: r, password: vrrxrrnrb, count: 5 +min: 3, max: 4, c: f, password: nvftvrjsgxszkfsffg, count: 4 +min: 1, max: 5, c: w, password: kndqwltttskcwtzqt, count: 2 +min: 1, max: 9, c: z, password: zzzzzzzzzz, count: 10 +min: 10, max: 11, c: v, password: vvvvvvvvvvv, count: 11 +min: 1, max: 5, c: m, password: gmjhm, count: 2 +min: 7, max: 11, c: j, password: sdjjpjjjdgnccjjjsq, count: 8 +min: 1, max: 6, c: m, password: rrmcmmmmmbm, count: 7 +min: 1, max: 6, c: n, password: nlclfggwnm, count: 2 +min: 3, max: 7, c: s, password: clfnmssns, count: 3 +min: 3, max: 7, c: m, password: tqjmmmx, count: 3 +min: 13, max: 14, c: n, password: nfnvkntnlnnnxfwlnnnn, count: 11 +min: 3, max: 4, c: p, password: xphp, count: 2 +min: 8, max: 9, c: n, password: nnnlnnnzn, count: 7 +min: 11, max: 12, c: h, password: hhhhhhhdhhhhh, count: 12 +min: 1, max: 4, c: p, password: pjgsphp, count: 3 +min: 3, max: 9, c: f, password: pvfnfmfrcffffjf, count: 8 +min: 15, max: 16, c: d, password: dddddddddzddldgdd, count: 14 +min: 2, max: 4, c: b, password: bvztgnzbpr, count: 2 +min: 3, max: 7, c: w, password: wgwhmpwwwlwzzhwnv, count: 7 +min: 5, max: 9, c: n, password: nmznnvnnsznnw, count: 7 +min: 4, max: 6, c: f, password: zqffsnffdlbkt, count: 4 +min: 6, max: 7, c: s, password: sssssss, count: 7 +min: 2, max: 5, c: q, password: kqlqqmv, count: 3 +min: 11, max: 14, c: q, password: pjqrzjfdgmqzpd, count: 2 +min: 17, max: 18, c: s, password: sssssssssssssssssj, count: 17 +min: 8, max: 12, c: x, password: zxxxpxxxxxxt, count: 9 +min: 2, max: 4, c: h, password: hqhhhwfshp, count: 5 +min: 1, max: 9, c: b, password: qzwgfbzjvt, count: 1 +min: 8, max: 10, c: c, password: cccccccccn, count: 9 +min: 3, max: 5, c: n, password: nnnkwn, count: 4 +min: 4, max: 6, c: m, password: zmmhdzmmx, count: 4 +min: 7, max: 13, c: v, password: vvvvvnvvvvvvsvv, count: 13 +min: 1, max: 12, c: z, password: zzvzxzfzzrzm, count: 7 +min: 6, max: 11, c: p, password: ppppplppppvppppfp, count: 14 +min: 1, max: 5, c: s, password: sjsss, count: 4 +min: 2, max: 19, c: w, password: wwwwwwwwwwwwwwwwwwcw, count: 19 +min: 5, max: 6, c: k, password: zxlkrkbcrcwkdqtkkw, count: 5 +min: 1, max: 4, c: w, password: hjjbzqwnpjrbglkr, count: 1 +min: 8, max: 9, c: n, password: sznnljnqn, count: 4 +min: 7, max: 13, c: k, password: dwkpnjkdkglnm, count: 3 +min: 14, max: 20, c: x, password: xzxrxxsxxxxxxxxxxxjx, count: 16 +min: 4, max: 7, c: w, password: rtrwdvww, count: 3 +min: 14, max: 18, c: m, password: mmmpmmmmmmmmmlmnmq, count: 14 +min: 3, max: 4, c: z, password: zzxz, count: 3 +min: 8, max: 10, c: z, password: zzzzzzzzzjz, count: 10 +min: 11, max: 14, c: v, password: vcvwvxvcslbvvhv, count: 7 +min: 4, max: 8, c: j, password: jgjjbrjhp, count: 4 +min: 5, max: 6, c: d, password: dddddm, count: 5 +min: 4, max: 5, c: n, password: nnnzn, count: 4 +min: 15, max: 16, c: t, password: ttttttttttttttnc, count: 14 +min: 5, max: 8, c: b, password: bbtbspvbbgllcrgxd, count: 5 +min: 8, max: 9, c: w, password: wwwwwwwqw, count: 8 +min: 3, max: 5, c: j, password: vbjmxwjgjfrzttznwc, count: 3 +min: 12, max: 14, c: l, password: llllllllllnglzlwbl, count: 13 +min: 2, max: 4, c: f, password: ntffj, count: 2 +min: 2, max: 4, c: c, password: gvccrcc, count: 4 +min: 19, max: 20, c: w, password: wwwwwwwwwwwwwwwwwwpw, count: 19 +min: 1, max: 3, c: k, password: klwgkc, count: 2 +min: 3, max: 9, c: s, password: qsmlssskpsbsscs, count: 8 +min: 8, max: 9, c: j, password: jjjjjjjdj, count: 8 +min: 5, max: 9, c: s, password: bszlpsssss, count: 6 +min: 13, max: 14, c: l, password: llxllhlllllllllll, count: 15 +min: 1, max: 6, c: s, password: ssssscs, count: 6 +min: 7, max: 8, c: v, password: pbvptdvv, count: 3 +min: 10, max: 15, c: v, password: vvvvvvgvvvvvvvcv, count: 14 +min: 4, max: 5, c: k, password: kkcskfldskdc, count: 4 +min: 13, max: 14, c: v, password: vvvvvvvvvvvvvgv, count: 14 +min: 3, max: 7, c: n, password: hnjnnnnnsnfp, count: 7 +min: 3, max: 8, c: m, password: mtmjhrzzllqml, count: 3 +min: 9, max: 11, c: w, password: wwwwwwwwwwxw, count: 11 +min: 10, max: 20, c: g, password: pkvgkfvmxgkpjjhtqvcg, count: 3 +min: 8, max: 11, c: w, password: wwwwwwzwwwdw, count: 10 +min: 5, max: 7, c: r, password: rrrrrrb, count: 6 +min: 2, max: 7, c: b, password: sbldlwvcb, count: 2 +min: 10, max: 17, c: v, password: vvvvvvqgcvvkdvsvvjv, count: 12 +min: 4, max: 5, c: d, password: tkddnddzqpdfdddd, count: 9 +min: 10, max: 12, c: p, password: npppppppppfm, count: 9 +min: 1, max: 12, c: t, password: wttttttttttttt, count: 13 +min: 4, max: 5, c: f, password: qfffz, count: 3 +min: 11, max: 14, c: p, password: ppppppppppppgvpcp, count: 14 +min: 6, max: 8, c: w, password: qswwwrwwmww, count: 7 +min: 9, max: 15, c: g, password: txgchzlpgggdhgggbg, count: 8 +min: 2, max: 10, c: h, password: hthhzhhhshhh, count: 9 +min: 5, max: 8, c: l, password: lllllzkk, count: 5 +min: 17, max: 18, c: l, password: nlllllllllllllllvll, count: 17 +min: 3, max: 6, c: c, password: zdwcjcccdqct, count: 5 +min: 8, max: 17, c: m, password: mmmmmmmmmmmmmmmmjm, count: 17 +min: 10, max: 12, c: c, password: ccccncrccccb, count: 9 +min: 4, max: 12, c: j, password: jjjbjjjjjjnwjj, count: 11 +min: 2, max: 6, c: h, password: chbhhfc, count: 3 +min: 5, max: 6, c: c, password: cccpncc, count: 5 +min: 6, max: 7, c: m, password: dmwmkmphmmdmm, count: 7 +min: 6, max: 7, c: k, password: rxwkmkv, count: 2 +min: 1, max: 5, c: f, password: fzgfl, count: 2 +min: 4, max: 7, c: x, password: dxkmxhb, count: 2 +min: 1, max: 5, c: f, password: hhfzfpfffffsff, count: 9 +min: 1, max: 7, c: s, password: sssslsvv, count: 5 +min: 3, max: 7, c: w, password: wgwwwsh, count: 4 +min: 12, max: 15, c: d, password: mdsdbkltdvthvfjdddn, count: 6 +min: 16, max: 18, c: x, password: xxxxxxxxxxxxxxxxtl, count: 16 +min: 5, max: 19, c: x, password: xwxxxxxxxxxxxxxxbpn, count: 15 +min: 3, max: 5, c: h, password: hhrfh, count: 3 +min: 8, max: 10, c: g, password: ggggggggggkgg, count: 12 +min: 3, max: 8, c: c, password: cccccccmc, count: 8 +min: 5, max: 7, c: r, password: wrrrxrrr, count: 6 +min: 7, max: 8, c: p, password: phpprdslbpxprpg, count: 6 +min: 17, max: 19, c: z, password: zzzzvzzzzzdzzzzzzzg, count: 16 +min: 2, max: 4, c: x, password: kxxxxxm, count: 5 +min: 2, max: 11, c: w, password: gwwzpwwwwwplrqfh, count: 7 +min: 6, max: 9, c: t, password: qtcttttgf, count: 5 +min: 9, max: 12, c: g, password: gggggggggggsg, count: 12 +min: 3, max: 6, c: n, password: fzmnxb, count: 1 +min: 5, max: 9, c: x, password: pqxxxwdtn, count: 3 +min: 5, max: 6, c: j, password: jjjjjkq, count: 5 +min: 10, max: 12, c: h, password: hhhhhdhhhzhh, count: 10 +min: 1, max: 4, c: g, password: gskgk, count: 2 +min: 3, max: 5, c: c, password: ccccj, count: 4 +min: 1, max: 10, c: m, password: wmxsgmzmrzmrmmmjmmct, count: 9 +min: 5, max: 10, c: p, password: lmpppvptdgpjpwfwpp, count: 8 +min: 2, max: 4, c: z, password: bzgm, count: 1 +min: 6, max: 7, c: d, password: ddzdddj, count: 5 +min: 3, max: 7, c: r, password: gchrfwr, count: 2 +min: 4, max: 7, c: k, password: kkcvkkkkkk, count: 8 +min: 8, max: 12, c: t, password: tpwtttctvtttftpt, count: 10 +min: 11, max: 12, c: c, password: ccccccxcdncbwcc, count: 10 +min: 2, max: 10, c: p, password: jwwxlppppppnpn, count: 7 +min: 9, max: 16, c: w, password: chmwwwwwjwrwjwzjww, count: 10 +min: 1, max: 6, c: j, password: jkqjjbj, count: 4 +min: 5, max: 8, c: k, password: kkkkkklhkk, count: 8 +min: 3, max: 5, c: q, password: qqqqc, count: 4 +min: 16, max: 17, c: x, password: xxxxxxxxxxxxxxxtg, count: 15 +min: 4, max: 9, c: f, password: fmfkcfffffkcfmfhnzf, count: 10 +min: 5, max: 6, c: z, password: zhzzlz, count: 4 +min: 4, max: 17, c: k, password: kbwmwvkkvvhxkkkckqvk, count: 8 +min: 3, max: 5, c: d, password: dddmmdt, count: 4 +min: 4, max: 10, c: m, password: mmmmmmmmms, count: 9 +min: 5, max: 6, c: g, password: ghgggpj, count: 4 +min: 1, max: 5, c: c, password: cccck, count: 4 +min: 3, max: 7, c: z, password: zzjzzzzz, count: 7 +min: 2, max: 7, c: v, password: xrprnvvtsrgsk, count: 2 +min: 1, max: 5, c: s, password: sqqsn, count: 2 +min: 3, max: 5, c: j, password: xwpnj, count: 1 +min: 5, max: 7, c: v, password: vvvvvvqmv, count: 7 +min: 4, max: 5, c: j, password: jjjjzjjjjljjc, count: 10 +min: 2, max: 4, c: h, password: hghh, count: 3 +min: 3, max: 5, c: n, password: fnnpc, count: 2 +min: 16, max: 20, c: d, password: dddddddzdddddddpdddd, count: 18 +min: 3, max: 4, c: t, password: tnpt, count: 2 +min: 2, max: 7, c: f, password: fxffffkff, count: 7 +min: 6, max: 9, c: b, password: bbbhbbwhbbrblmtb, count: 9 +min: 7, max: 10, c: m, password: msmxmrnmrmmmm, count: 8 +min: 3, max: 4, c: r, password: rrzrr, count: 4 +min: 7, max: 8, c: m, password: mgmmmmjmm, count: 7 +min: 2, max: 3, c: l, password: lmll, count: 3 +min: 2, max: 6, c: h, password: cngphhhbfpvvsgrqhhzq, count: 5 +min: 6, max: 8, c: d, password: dddddddg, count: 7 +min: 12, max: 15, c: p, password: vfjxwpcpdvpnjwp, count: 4 +min: 12, max: 17, c: m, password: mzfmmsvfxmqsmcfjmwjb, count: 6 +min: 15, max: 19, c: b, password: bbbbbfbbbbbsbbmbbbbb, count: 17 +min: 7, max: 8, c: n, password: qdnjnnnpvmfnn, count: 6 +min: 6, max: 8, c: l, password: llllllll, count: 8 +min: 3, max: 4, c: n, password: nnbdh, count: 2 +min: 11, max: 12, c: w, password: hprdhfrpvcwbgwjcw, count: 3 +min: 2, max: 7, c: r, password: jrfrbjrhrw, count: 4 +min: 1, max: 6, c: v, password: fvzknvvv, count: 4 +min: 10, max: 11, c: t, password: tttstdhttqrttt, count: 9 +min: 5, max: 14, c: f, password: fxffnffffnfffff, count: 12 +min: 10, max: 13, c: q, password: qqqqqqqqqjqqqqq, count: 14 +min: 1, max: 5, c: v, password: tnvfvxvjvbvjk, count: 5 +min: 4, max: 5, c: c, password: ccccpc, count: 5 +min: 4, max: 6, c: t, password: tttttktttt, count: 9 +min: 1, max: 2, c: r, password: rwrsq, count: 2 +min: 11, max: 12, c: c, password: cccggjcccccr, count: 8 +min: 11, max: 16, c: g, password: gwggggggggqggbgggfg, count: 15 +min: 12, max: 14, c: b, password: bbggzhxsjjsbsf, count: 3 +min: 5, max: 7, c: r, password: kjdwpfbmcptrslrrr, count: 4 +min: 1, max: 2, c: l, password: lvbl, count: 2 +min: 6, max: 11, c: c, password: hsksgzhccbccbdfnzqcv, count: 5 +min: 6, max: 7, c: m, password: gmmmmmc, count: 5 +min: 1, max: 2, c: h, password: hhhh, count: 4 +min: 1, max: 3, c: g, password: rggg, count: 3 +min: 4, max: 8, c: z, password: rzzzzfbwzxkzzz, count: 8 +min: 3, max: 6, c: w, password: wwwwww, count: 6 +min: 3, max: 4, c: g, password: ggwtg, count: 3 +min: 9, max: 11, c: v, password: wxfltmvjvjm, count: 2 +min: 2, max: 4, c: l, password: llck, count: 2 +min: 2, max: 3, c: m, password: mmkgpdwzdm, count: 3 +min: 2, max: 5, c: d, password: bdjhdhjldzh, count: 3 +min: 10, max: 12, c: j, password: jnjlmjjjjpcdkjjjx, count: 9 +min: 3, max: 9, c: q, password: qqzqqqqqqqqqq, count: 12 +min: 4, max: 8, c: d, password: ddzwdpddd, count: 6 +min: 3, max: 7, c: m, password: mzmbsmcjgmpmmdkmr, count: 7 +min: 8, max: 13, c: q, password: xrxvgqdvvmjhhgdfz, count: 1 +min: 3, max: 12, c: z, password: zzjzzzzzzzzzzz, count: 13 +min: 5, max: 10, c: k, password: jkkkmkkkmkk, count: 8 +min: 6, max: 7, c: m, password: mmllmmtm, count: 5 +min: 17, max: 19, c: c, password: ccccccccccccccnckccc, count: 18 +min: 6, max: 9, c: w, password: wwwtbrwwwxww, count: 8 +min: 7, max: 9, c: d, password: wfdkwddsdsmdbswv, count: 5 +min: 11, max: 12, c: g, password: ggggggggggbgg, count: 12 +min: 13, max: 14, c: j, password: prjjdjjjjjjjcjjj, count: 12 +min: 3, max: 5, c: j, password: jjlljv, count: 3 +min: 3, max: 4, c: h, password: hrlh, count: 2 +min: 6, max: 7, c: l, password: hplnxlsjnwxzllllljcj, count: 7 +min: 4, max: 5, c: g, password: gfgml, count: 2 +min: 4, max: 5, c: z, password: zwkznzn, count: 3 +min: 4, max: 11, c: n, password: stnzhznnfnqcnn, count: 6 +min: 2, max: 5, c: h, password: hmzhh, count: 3 +min: 4, max: 6, c: w, password: wwbwwc, count: 4 +min: 4, max: 11, c: w, password: vmwwrxpkwcp, count: 3 +min: 4, max: 8, c: t, password: thxttstmtbstcvjtlflh, count: 7 +min: 6, max: 8, c: v, password: hvvkvvhfm, count: 4 +min: 16, max: 18, c: b, password: tbbbbbbbbbbbbbbbbr, count: 16 +min: 8, max: 10, c: f, password: fffffffcfl, count: 8 +min: 13, max: 15, c: r, password: rrrdrrrrrrrrrbr, count: 13 +min: 8, max: 14, c: t, password: ztstxttttttttwz, count: 10 +min: 8, max: 12, c: j, password: jgjjjjgjjjjx, count: 9 +min: 5, max: 6, c: m, password: nmqjdmgfqqmcmmvndztl, count: 5 +min: 2, max: 6, c: v, password: vwvvvvtv, count: 6 +min: 15, max: 16, c: l, password: llllllllllllllll, count: 16 +min: 3, max: 10, c: q, password: qqqqqqqqqxqq, count: 11 +min: 8, max: 9, c: j, password: rggxhvjjjk, count: 3 +min: 1, max: 3, c: p, password: pqhp, count: 2 +min: 4, max: 11, c: z, password: nkjddzczjrzktvnckmg, count: 3 +min: 5, max: 12, c: r, password: tfrdrswgwnbc, count: 2 +min: 8, max: 13, c: r, password: rrrrrrrrrrrrrr, count: 14 +min: 13, max: 18, c: x, password: xxmxvxxxxxxxhrxxxc, count: 13 +min: 7, max: 8, c: z, password: zzkzzzzw, count: 6 +min: 4, max: 8, c: m, password: mmmqmmskqlmmgm, count: 8 +min: 1, max: 3, c: w, password: bmwg, count: 1 +min: 1, max: 4, c: z, password: vzzzzzwz, count: 6 +min: 3, max: 4, c: d, password: dqdw, count: 2 +min: 2, max: 9, c: z, password: hzhqpndtllsw, count: 1 +min: 10, max: 13, c: t, password: tttttttttttbjb, count: 11 +min: 12, max: 14, c: r, password: rrrxrrsrrrgfrrr, count: 11 +min: 12, max: 19, c: g, password: hdxnlgglxwrgzkggcwp, count: 5 +min: 3, max: 4, c: x, password: qxjx, count: 2 +min: 1, max: 2, c: r, password: rrpdlqhcnwwr, count: 3 +min: 5, max: 11, c: c, password: vdbzvccdccldsjcq, count: 5 +min: 4, max: 6, c: k, password: kxkwkk, count: 4 +min: 16, max: 18, c: k, password: kkkknkkkkkkkfkkkkx, count: 15 +min: 1, max: 2, c: q, password: tqtghddbk, count: 1 +min: 7, max: 8, c: g, password: ggcgggvgg, count: 7 +min: 13, max: 19, c: d, password: ddddddfjdddddfddddd, count: 16 +min: 9, max: 15, c: z, password: pzhzzzzzqpzzzzzz, count: 12 +min: 4, max: 5, c: l, password: lclld, count: 3 +min: 2, max: 15, c: r, password: jrrmtzrxlczbttrcvkn, count: 4 +min: 3, max: 5, c: z, password: zzzzc, count: 4 +min: 15, max: 16, c: k, password: kkkckkdjnkkkkkkkkk, count: 14 +min: 11, max: 13, c: m, password: mmmmmmmmwmmmzm, count: 12 +min: 8, max: 13, c: p, password: ppdpptppdppxkppppppp, count: 15 +min: 1, max: 3, c: g, password: gszcmgjg, count: 3 +min: 5, max: 11, c: h, password: skbchhdbnphpbfl, count: 3 +min: 4, max: 7, c: d, password: prdjctk, count: 1 +min: 15, max: 18, c: f, password: ffcffffffffffzdffc, count: 14 +min: 7, max: 11, c: g, password: npggtwgzgtgzhx, count: 5 +min: 12, max: 14, c: m, password: mmmmmmmmmmmpmkm, count: 13 +min: 10, max: 11, c: b, password: bbbbbbbbbbb, count: 11 +min: 3, max: 16, c: k, password: kgxtvmlgpkptpghkb, count: 3 +min: 4, max: 6, c: m, password: zcwmzmvqvgmmsxj, count: 4 +min: 6, max: 15, c: m, password: mzmmccmmlmmrmlnl, count: 8 +min: 12, max: 13, c: x, password: xxxxxxxxwxxxz, count: 11 +min: 4, max: 5, c: d, password: mhvdtxfklzdpgdqdpqhd, count: 5 +min: 5, max: 10, c: g, password: nghgggggggqg, count: 9 +min: 7, max: 9, c: k, password: kkkkfkkkwk, count: 8 +min: 6, max: 7, c: c, password: cvcvczncn, count: 4 +min: 10, max: 11, c: t, password: tttqttttttv, count: 9 +min: 18, max: 20, c: h, password: hfsqhkwfhttgfhmbghhx, count: 6 +min: 6, max: 7, c: v, password: vgvvvwz, count: 4 +min: 3, max: 4, c: z, password: zzzj, count: 3 +min: 3, max: 5, c: d, password: dhqjnhgldtdzx, count: 3 +min: 3, max: 4, c: b, password: jbrbbbbbbbblwb, count: 10 +min: 12, max: 15, c: g, password: gsgfdfksrggqvgggjgt, count: 8 +min: 6, max: 11, c: p, password: pmppnpqpdppdpppphpf, count: 12 +min: 13, max: 14, c: z, password: zzzzgzbzzzzzgzz, count: 12 +min: 4, max: 12, c: c, password: ccjcrvcnwccwctcczcp, count: 10 +min: 10, max: 11, c: c, password: szcccfccfpcchqs, count: 7 +min: 10, max: 14, c: l, password: lllllltgjlnlbprlll, count: 11 +min: 12, max: 17, c: z, password: zhzzzxzpzzzfzzzqznz, count: 13 +min: 12, max: 15, c: l, password: llllllllmvlvllfll, count: 13 +min: 7, max: 12, c: c, password: ccccccncccccc, count: 12 +min: 1, max: 5, c: m, password: mhmmzmm, count: 5 +min: 11, max: 17, c: r, password: rrzrrwrrsrcrsmdrvrr, count: 11 +min: 4, max: 5, c: w, password: fwwpwfw, count: 4 +min: 7, max: 8, c: n, password: nnnnnnnk, count: 7 +min: 3, max: 18, c: n, password: rxhzsscgbnmzpvbqmzf, count: 1 +min: 4, max: 11, c: k, password: kkkkkkkkkkkxkkskkkdz, count: 16 +min: 10, max: 11, c: c, password: cccccccccckcccccc, count: 16 +min: 8, max: 15, c: r, password: zrrtfrjrrrrrjrrrrrr, count: 14 +min: 15, max: 16, c: h, password: ghgvlhwgqslhhhhxmp, count: 6 +min: 3, max: 5, c: f, password: ffffqf, count: 5 +min: 3, max: 8, c: s, password: bssmfsgspxssgjhsjdv, count: 7 +min: 3, max: 5, c: q, password: bfdhq, count: 1 +min: 4, max: 7, c: k, password: qknkkkd, count: 4 +min: 6, max: 9, c: b, password: bbbtbnfbbb, count: 7 +min: 12, max: 14, c: x, password: xxxxxxxqxkxvxxwxxcw, count: 13 +min: 3, max: 6, c: c, password: chfckc, count: 3 +min: 3, max: 8, c: h, password: kzkhgrffz, count: 1 +min: 10, max: 16, c: f, password: fffgjfffsvffdzfhfzff, count: 12 +min: 1, max: 3, c: r, password: rgcr, count: 2 +min: 16, max: 17, c: x, password: xxxxxdxxxxxxxxxxl, count: 15 +min: 6, max: 11, c: j, password: rsjcjjcbpchkvfjpml, count: 4 +min: 9, max: 10, c: s, password: sssqvsssjsss, count: 9 +min: 17, max: 18, c: v, password: vvvvvvvvvvvvvvvvvv, count: 18 +min: 3, max: 5, c: t, password: jtmtgtxxhzskzk, count: 3 +min: 1, max: 6, c: t, password: ttqkvdgs, count: 2 +min: 13, max: 16, c: q, password: qqqqqqhqqqqqzqqjqq, count: 15 +min: 10, max: 11, c: b, password: bbbbbvbbbbw, count: 9 +min: 6, max: 7, c: w, password: sgwmqwgwtbrllf, count: 3 +min: 10, max: 11, c: f, password: ffffffftffff, count: 11 +min: 12, max: 13, c: w, password: wwwwwwwwwwwzt, count: 11 +min: 18, max: 19, c: t, password: ttttttttttttttttttt, count: 19 +min: 1, max: 5, c: h, password: zghhr, count: 2 +min: 1, max: 2, c: v, password: dvjnctwvlp, count: 2 +min: 1, max: 2, c: j, password: jhzkzjh, count: 2 +min: 3, max: 6, c: h, password: rhhbhhh, count: 5 +min: 2, max: 4, c: d, password: dddrd, count: 4 +min: 17, max: 18, c: s, password: ssssssssssssssssns, count: 17 +min: 1, max: 8, c: m, password: smmmmmmmm, count: 8 +min: 2, max: 4, c: s, password: dcfsbzwqq, count: 1 +min: 11, max: 12, c: d, password: vnldqthkptgkkfdmtw, count: 2 +min: 8, max: 12, c: p, password: vpppzpprppppp, count: 10 +min: 6, max: 8, c: q, password: jqqqsphqjwrqj, count: 5 +min: 8, max: 10, c: k, password: ktkkkkdkkkk, count: 9 +min: 4, max: 12, c: v, password: nvvwvvvjzvvvv, count: 9 +min: 5, max: 6, c: z, password: zzzzzt, count: 5 +min: 1, max: 5, c: w, password: xwwwwwwww, count: 8 +min: 11, max: 14, c: p, password: pppfbpppkpftdpkpgpp, count: 11 +min: 2, max: 3, c: v, password: zrlv, count: 1 +min: 2, max: 4, c: f, password: fbwff, count: 3 +min: 5, max: 6, c: s, password: ssssmn, count: 4 +min: 11, max: 12, c: z, password: zzwztpzpjzhz, count: 6 +min: 5, max: 6, c: c, password: cccjcc, count: 5 +min: 4, max: 6, c: v, password: vvvgpvcpwv, count: 5 +min: 5, max: 6, c: j, password: jnzcpjnzjjcpsjfps, count: 5 +min: 12, max: 14, c: m, password: tpzwjjgpbbdmgxgphd, count: 1 +min: 13, max: 15, c: n, password: nznnnncnnnnnnnf, count: 12 +min: 8, max: 11, c: w, password: qsxwnlhwwxw, count: 4 +min: 6, max: 9, c: t, password: ltbdttnst, count: 4 +min: 10, max: 12, c: t, password: hnjdfgrhtgkl, count: 1 +min: 2, max: 4, c: d, password: dbddddc, count: 5 +min: 13, max: 14, c: g, password: gggggggbgggmgmgm, count: 12 +min: 4, max: 12, c: r, password: rrrzrgkrrrrkr, count: 9 +min: 14, max: 17, c: n, password: nnhnnnnnnnnnnnnnhnn, count: 17 +628 From b17189526cdd8bb793d7137c8b388a18f6be71e6 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Tue, 1 Dec 2020 22:24:15 -0800 Subject: [PATCH 06/52] Completed day 2 --- 2020/Makefile | 3 + 2020/day1 | Bin 37264 -> 0 bytes 2020/day1.cpp | 2 +- 2020/day2.cpp | 95 +++++ 2020/day2.input | 1000 +++++++++++++++++++++++++++++++++++++++++++++ 2020/day2.output | 1001 ++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 2100 insertions(+), 1 deletion(-) delete mode 100755 2020/day1 create mode 100644 2020/day2.cpp create mode 100644 2020/day2.input create mode 100644 2020/day2.output diff --git a/2020/Makefile b/2020/Makefile index fe418f1..89345cb 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -1,6 +1,9 @@ day1.out: out/types.o day1.cpp day1.input g++ $(flags) day1.cpp out/types.o -o $@ +day2.out: out/types.o day2.cpp day2.input + g++ $(flags) day2.cpp out/types.o -o $@ + out/types.o: types.hpp types.cpp mkdir -p out/ g++ $(flags) -c types.cpp -o $@ diff --git a/2020/day1 b/2020/day1 deleted file mode 100755 index 4cdc619f1dbbea62b2b8f13313ed046768f7c928..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37264 zcmdsgdtg-6@&C;OMG7G*Dx#JZQNc${LV!e36UgF50;EZ>w2GHJ7FbQPX|mzrR}>qt zZbLLGDq8hNTYul8wTjkOYJG&qk6_grT5F?HjTZfG1Z#Y!Rmt}=bLQN8_wHSa*!GX# zRWf^K=FFKhXU?2CXYby7t-o|;YD$WsuQcNVgGviC6{b)KnLm^d0EI@raRmN;(>TdE z4CQpjDSDv-psH&?L~A%y@M(ZlFF#cw-0(!<(@<+jaEQ>nz{j%`Rzt(^F@oxmuAQY^ z1oZI-4d;_WxYmfa^q04RyV5p&sdZu$K(4Q7-KzvrD10r=cE)bLv9XQ}WKKt3A6e)X=j0?B)4W z&YqH&)f~>s<$jZV;=O3jJXVRsh$)yp3T46({gv-O({sweRXfi8dGD@I7v6f@+}@Ke zC*E=Rr^n4OGWj#%=sITo@EPip_uoe${3s97ZV2?k--!mj@DC*6-e@JNzk$oSjMJ+?j;GJ&FA0B>Hbmg1^lFA4s-B=WN$|48F_ zqp(a#%LE@^n9t3T+L|-Zq&YmrFwMpF;RdrgQq>eOO~WjyoNd+yn}Ul&&5>YJN18$n zi@oYsRFRMwIV__hk{4{Kt@GmZm!s`TN?I7=f>re;m1bqO>93fA-lO?QPM&DGNa$Yb zq9t^VWSJ%5W^-<1u%SL&3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4Mv3(7&J10_WfZe%fK_-zkDL45TSex<8NluItO~aK7N(CN3^x~zW>t6_)KC;drJt-qj+tMGxwMAz59 zo7GVNo?N%D>+Alnmip60p#FWWhJ_-S>eH>1?)oZk-=-MDRBx)$PUn(O0lCI7x zih{F#r_|T5!)0*!c?9l-R@XXLef_&$4Yj_)Zt1V__qggW6u}ynPtY|L)a`2QPhIu( z?}RlxLNf|<_y2yWug6dSj!i?k9o3TJuK$Rue!tw8t06sm)p@z=KjW&ef1j*j=16C4 zd;B%_Syz4iJ7x_p(~JV$?Y{;*4Y^iR|NgYIR8?@>TaTND{{uEsQP & list) -> void { } } -i32 main(i32 argc, char * argv[]) { +auto main(i32 argc, char * argv[]) -> i32 { auto list = std::vector(); { auto line = std::string(); diff --git a/2020/day2.cpp b/2020/day2.cpp new file mode 100644 index 0000000..cec8af6 --- /dev/null +++ b/2020/day2.cpp @@ -0,0 +1,95 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +struct Password { + u32 min; + u32 max; + char c; + std::string password; +}; + +auto extract_num(usize & index, const std::string & string) -> u32 { + auto num = u32(0); + --index; + while ('0' <= string[++index] && '9' >= string[index]) { + num = (num * 10) + (string[index] - '0'); + } + return num; +} + +auto count_valid_sled(const std::vector & passwords) -> u32 { + auto valid = u32(0); + for (auto password : passwords) { + auto count = u32(0); + for (auto c : password.password) { + if (c == password.c) { + ++count; + } + } + valid += (password.min <= count && count <= password.max); + } + return valid; +} + +auto count_valid_toboggan(const std::vector & passwords) -> u32 { + auto valid = u32(0); + for (auto password : passwords) { + if ((password.password[password.min - 1] == password.c) + ^ (password.password[password.max - 1] == password.c)) { + ++valid; + } + } + return valid; +} + +auto main(i32 argc, char * argv[]) -> i32 { + auto passwords = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("day2.input"); + while (getline(file, line)) { + auto index = usize(0); + auto password = Password{}; + password.min = extract_num( index, line); + password.max = extract_num(++index, line); + password.c = line[++index]; + password.password = line.substr(index + 3, line.size() - index - 3); + passwords.push_back(password); + } + } + + std::cout << count_valid_sled(passwords) << std::endl; + std::cout << count_valid_toboggan(passwords) << std::endl; + + return 0; +} diff --git a/2020/day2.input b/2020/day2.input new file mode 100644 index 0000000..d1612d4 --- /dev/null +++ b/2020/day2.input @@ -0,0 +1,1000 @@ +9-11 p: pppppppppxblp +2-4 b: bbxbb +3-5 q: dqfqb +5-8 g: ggcgggglg +10-18 l: gllpmlgtrmnllhllrlll +18-19 z: zzzzznszzzzzzzzzzzxz +3-6 r: frrhxsnrmgmw +1-8 n: zkxhnxnzghnm +11-12 z: zzczzzztlzlzzzz +4-7 q: qqqbncqqq +3-4 c: ccvfc +19-20 l: sltlklljdlzglwllllzl +6-16 h: dhhhrhvhnhdchfsnhq +3-7 l: fllllqjlll +8-9 k: xkkjqklkm +1-2 l: llgpl +2-4 x: qkjxvqlv +5-6 c: cwcccjch +3-7 n: bnnhnwnqtdnndnncnd +8-9 n: nnrkmdnkn +6-9 t: ttttrtltptgvcd +3-4 h: hhwhhhdhhhh +7-8 w: wdwvcwwszcwwwwwq +2-4 n: vnng +3-13 v: vvvvvvvvvvvvjv +9-11 c: zcccccccccfcbccc +10-11 w: wkwwwwwwwxw +10-12 z: zzzzzjzzzrnzz +5-6 t: ttttts +13-19 b: bbmfbbbbbrbbgbbbrbbb +8-9 d: bdddvkddjbdgdd +19-20 m: mmmmmmmmmcmmmmmmmmmq +6-18 w: wwwwwwhwjwwwwwwcwjw +4-10 t: tttttttttj +2-7 j: fbdgmfjbjgjn +7-8 w: wwwwwwcww +8-12 c: cbmdccbccckjccch +13-15 f: fpfffffffffffqf +7-11 t: sbtstwdxjpclwd +1-3 s: shkkqcs +7-8 l: bdggzczl +1-6 g: zgggggglggggggw +12-16 h: hhhhhhhhhhhhhhphhhh +8-19 k: htknkhkrkdkhkpwppkk +8-10 k: kkxkkkbrkgk +8-9 h: hvhhhhhfhhv +15-16 x: xxxxxxxxxxxxxxxh +1-12 b: bgwpjbkhbptsbbb +9-10 j: pjtjpjpnbjjlsgbn +8-9 s: sscplbswssssglxs +14-15 j: jjjhjjjjjjxjjjj +1-4 q: qnqj +3-5 d: qpdddqvwbzldf +14-15 b: bbbbbbbbbbbbbbt +1-2 t: tdxt +1-7 g: dlpkvrgjzpnr +3-11 m: lmnwjjxpfmm +3-8 l: llglllllll +2-4 r: gfmrlbmsvqzrmbnd +5-9 s: srsqssssds +8-9 v: vvvvmvvvhw +7-10 d: mddwdvjdcdwdcgddd +4-7 k: fksjkkkk +6-9 t: fnrxmlwtt +11-12 d: dddddddddfmd +4-5 z: zzdzzzz +11-13 z: zzzzzzzzzzpzmzzz +12-14 z: zrgnvcrxkzzzrb +10-13 q: qpqqqqqrqxvqq +6-10 g: gglggggggzgggg +2-8 j: jfqjrdjjjjjj +7-8 z: hzlvrczjp +4-5 k: kggjkl +4-7 m: mpmmmcmm +13-14 x: xxxxxxzxxxxxxw +6-7 n: znnnnnlpjcn +10-16 g: gggzvgggntggfgghggg +2-17 n: hnchrpvzhkdsnhgcnfql +2-8 f: fkfpffff +4-7 s: qwdspspj +6-7 r: rrrrrnx +7-8 p: wpppppsp +8-10 m: mmmwmjmmmvmzpm +6-7 j: jjjjjncd +3-4 k: kxkk +2-4 z: czzmzz +11-12 t: tttttttttttzkp +10-17 t: ttttvtltdttrqtztr +3-6 n: nnnnvvxv +7-8 v: rvvpvvvpsvv +1-2 r: nkfgnr +4-11 c: cccbccclcccc +7-12 q: qpbqtqkqqqqqqq +2-7 m: mfmmmmmmxmnm +10-11 n: bnnnpnnncxrnnnn +10-14 n: nsnnnnnwljnsnnn +5-9 b: vcvcblrxbvjbtzbrmbr +3-9 m: kmmmmxmmkmmk +2-10 l: llbllgzllnlll +5-6 d: ddpdwdddxhpdqd +12-18 j: cjfbjccqgxlczjptqlk +1-3 z: mzzz +5-11 m: mdfmmmmtmgw +2-14 h: nhhnbhghhlhhchsqsr +3-4 t: jvtt +2-8 t: tttkxxtsttht +7-15 w: wwwwfwwwwwwrbww +1-4 j: rbjj +8-12 f: ffkhffffcsfzff +10-12 p: pppcgpqphprh +10-11 l: lllllllllsl +7-8 s: svsssssss +4-5 c: cvjcc +1-5 v: vcdcd +5-14 z: zzwkzztzzzzzbzzvzzz +11-12 s: sssssssssssps +5-7 b: spmtbpn +5-6 c: cccccf +10-12 p: ptpppppppppk +4-13 f: ffkffffkffflb +2-5 t: nttqftpnwbjbxmqdqv +17-18 w: wwwwtwwwwwwwwwwwkwww +7-9 f: lmrffdbffvfmf +2-5 h: hhhvzrhh +10-11 q: qmdrdfqgzql +3-11 g: ggggggggggm +4-5 z: zzzrzzp +5-7 w: wwwwkwwww +10-11 f: ffffffffffp +6-9 v: vvvvvvvmv +4-5 x: wjxxxxxtd +12-13 p: vppppppppppzbp +2-7 b: bqntbls +15-16 p: ppppppppppppzpfxn +2-3 b: bbcnbq +10-11 k: kkkklkmkkhk +4-6 w: wwwdjb +4-6 b: sczlwbnffbnxbvjbmj +3-17 m: jmmlmmmgmmmjmmmmmlmm +6-18 z: zmkwvzkpqzmzdfgdvt +5-6 q: sqwqqq +1-3 g: gjgt +5-8 x: bxcxxzxxws +4-5 c: rnscvcngbcmpddkcvctk +7-11 g: ggggglvgggngg +2-11 l: lsqlzlllllklgfl +2-9 m: cmqkbmdxp +6-7 w: wwwwwww +8-13 q: qbqzqqqqqlqqw +3-4 n: sfqnnnwvzn +1-2 w: nwww +2-4 v: hvvbqgnfl +14-15 m: gjgdmmmmkmqqcxmrsm +2-3 z: zzzx +5-13 q: qqqqdqqqqqtqjqq +4-5 z: zzzzk +5-6 t: tttttf +3-6 z: ztwzczkz +3-5 l: llpljllllllll +2-3 s: ssscp +8-10 d: dddddddwdddddwddg +2-6 s: sbssps +1-5 f: ffbfvfxbkmbhvbcfmxpf +1-6 j: gqfrmjgsgjjhcjhn +2-5 l: lwvllll +2-5 z: zkzhzb +10-11 s: wsblfxvmvsslbhfjtsws +11-17 f: fffffffxfffffffftfff +4-5 r: rrrkbrr +7-10 w: qwqwwwgzrdxww +6-8 s: ssssssscs +4-6 q: qbqwqzfqcfgkmzqxb +6-10 t: ttncfqqtttttp +2-4 m: bbzcjjqmfvln +4-7 n: cnqhntshdnnrnrnz +7-12 d: vmdndkzpmcbd +6-7 p: tpqpppzpjp +3-10 r: rgrrrpzrbrrr +2-15 h: ghbfhbgrtxrshphhl +2-6 j: pjjjjlj +6-9 j: rjrjjjwfjn +10-13 s: sssssssssjsssssss +1-6 c: crnjccgnw +6-7 l: qrllgql +12-13 z: wzzzzzzzzzzfz +1-2 c: ccclc +2-6 f: qdlflfr +4-10 r: drrrrrwrfrr +5-6 f: ffzffnf +4-6 p: hkppkbppp +8-9 r: rrrrrrrrx +4-12 f: fffffffffffwqp +4-6 q: qtqtjq +4-5 w: wwwcw +2-3 r: qrrr +7-10 k: nkpgzskkrb +6-9 h: hmsshhhwhhhhh +2-18 d: kxqddddqddsmddcdddwd +6-7 s: sssssssss +4-8 h: hhhbthhhhh +1-8 d: dtsbqtrpwdgfdzrtf +6-7 b: bbbbbwp +5-6 p: ppnpqjp +4-13 l: rtqpmllslrlxcblldqtc +3-4 m: wmmkcm +4-16 b: qkbvbvgxtlqbgmwc +4-5 h: hhhlghh +10-11 f: fjfffffffgjff +9-12 w: gwnfvwwrwswnqrvg +4-8 k: pjkkfkbqqzkmfk +2-8 x: xwxxxxxcxxx +11-19 w: wwwwwdjwwwrrwwlvwwww +4-14 w: rwqhwqwwlhpwfwwpww +7-9 j: vjjjjqdjjjjjj +15-17 x: kxrmxjvxxxvxxxzxxxf +3-10 p: pwpxppzgdrrx +1-5 p: ppppp +10-19 n: vfnwnjstnnjnqnngnzs +2-5 m: phsmq +5-6 m: mmmmxmm +2-12 f: tftgcmcblzcljsdlbvf +6-11 b: hbbbbbbbzhwbtbbhmrb +7-11 j: jjjjjjvjjjq +3-4 d: dddgddnmd +11-14 f: fxfffffftqfflffffpf +14-16 x: xxxxxcxxxxjgxxvt +6-7 h: hhhhhht +7-8 h: hhhhhhzphhhh +5-12 w: wfwwwjzwmpxwmw +2-7 h: chcjhhqhdlfshxvhz +7-15 h: hjhhjvhhhhqmhdhjh +1-2 f: bvhf +4-6 k: rkctkkm +5-6 n: nnnnnn +10-11 j: jjjjjjjcjjs +4-7 b: bbgbnkp +2-5 d: dddddjvddxdk +11-19 z: svzzgzzmzznzzzkcdzzz +8-9 z: zzzzzgzmz +4-10 v: vsvvvvnvsr +5-15 v: mvqvvkjfvwdvvdl +13-14 s: ssssssqzszssmk +3-4 w: wbwg +10-11 d: kdbdcddqddxdddd +8-9 t: tttttttntt +2-10 m: mqmmmmmmmm +3-8 c: bcswcncchpxcxcrccrx +4-10 q: qqqplwsfxgq +15-16 h: hhqhhhhhhvhhhhhthhhh +11-13 s: sssxssswsswsr +6-7 z: zzzzhvzz +3-4 j: ktjdxsjjxjtnq +5-7 w: wwxwlwwr +2-5 l: llltll +2-6 m: qmgvtmtp +11-16 v: vvvgvvlvhvvvvvvvvvgv +2-4 j: jsnjf +11-12 g: gdlcvdgzgqpg +10-12 x: rxxcxxxxxrrxx +9-12 n: nnnnnnnncdnn +6-10 j: vjjjpjhjjs +5-6 d: dcdddt +3-13 c: cccccvctcbvcvpcccc +1-7 d: ndddzzdx +9-10 w: wwwcwwwwfr +9-18 q: xjhsjqqrqpgprjmqqq +8-11 b: bprbbbwkbbbb +4-14 w: wxcwzsswmsqvfjvjzj +5-6 b: wbbmzbbm +8-13 f: lpjfsfswfffgfkff +1-3 x: vxxx +6-7 x: btxxxxcx +6-8 r: mwqrrqrrxr +7-14 h: hhhhjllhrsxtrhmbbpwh +7-10 f: phqzgfwfrpffpzq +6-17 d: ddddddddddddxdbdgdd +5-11 f: fhfnfflfhjvwvfff +11-12 h: hhgbtnkhhhhh +2-4 f: fdfgffr +5-6 w: wwwwxw +4-9 z: zbzzzczzv +2-4 k: jfpkc +3-4 r: kwgr +4-5 k: kkkks +5-6 r: rrrdrsr +5-6 t: tpwnmttclcrtt +18-19 t: ttbwxtxgfsphgtzzplbt +1-5 w: tthwwvw +10-13 z: mzzzzzwzzzzztz +7-10 r: rzrjrfpdrrrcmmrr +2-4 w: wwww +5-9 m: vksmmzdpsm +1-2 q: qqqqqqq +1-6 c: pccccn +3-8 r: pbchhhrr +3-8 v: bfdvkvdvglvn +3-6 h: hhhxhshhl +4-7 m: mkwpkwmtmm +10-11 g: ggggmggggcg +1-6 j: jjjjjw +4-10 z: zvzzxzzgzzz +7-9 k: kkkkkkkkjkkkk +4-18 f: vlnfpdzvbqhvsfmhqtf +8-11 s: sssssksshsssmhs +2-6 b: bbbbbm +2-3 h: hhvrlcf +10-19 c: mccwczqbjdlgfccnrqc +8-12 x: rxxxnxtfxcxxxpx +13-14 r: rrrnrrrrrrrrmrr +4-11 h: mhzstqhhghhhbhhh +10-11 f: fffffffffpf +7-8 j: jjjjjjmv +5-6 f: fhfffv +3-4 z: zzxtzq +5-6 v: jvszvzvvg +9-13 v: wvvgvdvvvsrjcg +10-11 t: pcttrntttttdthtxst +1-5 v: vvvvpv +6-9 q: qfqqqlqqqqq +4-8 f: ffffffmfkkfzpffffvff +3-5 n: lnmnnnnnnnn +1-5 k: kkwmdkflxtqktmcxdl +1-3 z: tnqp +15-16 h: hhhnhhhhfhhhhhjhhh +2-6 m: mmmxmb +7-12 q: qqjqhqfqwqcqqkqmql +6-10 s: ssjvrvsgsshsss +11-15 n: nnnnnnnnnnrnnnj +14-15 x: xxxxvxxxxxkxxxzx +9-14 b: bbbbbbpbbqbblbbbb +4-12 h: knthjdhlrxtpjwhnhn +8-9 v: vvvvvvvjjvvvv +2-3 d: dktdvd +6-8 z: zzzzzzzx +10-13 t: jrjfklzstpxwt +4-16 n: mngnnqnbnnwnqrdgk +3-5 v: vhqvvn +1-4 t: jhtq +8-11 f: qfffffqfffff +14-15 x: xxxxxxxxxxxxxxx +2-12 s: scsstsssmcssswgsw +8-13 t: tttttttqttttt +8-10 d: ddddddvdfbq +9-15 d: sdqpqddddjrdjnj +17-19 c: cccccdldcccpbccxgcc +6-14 v: lvvvvsvvvvvvvp +16-18 p: ppppppppppvpppppppt +1-3 v: vkvtzlvrdcvzplznltqs +8-10 s: sssssssssns +1-3 w: wcwfwxnwwp +8-10 v: kvvvvvvvvvkvvv +7-11 s: shsssssssns +9-10 w: wwwwtwwgkwww +1-2 x: vxxn +4-9 g: lkgggrcgpg +1-5 n: fjrnn +4-6 x: xtxzxxx +18-19 z: zzzzhvzhzzzzzzzzzsz +15-18 p: ppppppppppppppsppppp +11-14 h: rdhhhhhhhghhhrh +3-9 v: vvvvvvvvqvv +4-8 p: bbpmjpplp +1-15 n: qndxnnsmnrnsnnnnn +7-9 c: cccccctccc +2-6 m: xwfnmmn +4-16 t: nbttltzvhqjtcgbtttkt +7-8 r: rrlrrrrsrbr +3-5 h: hhghh +3-4 m: mmmxm +15-16 k: fckzkjskrkkkdkkl +5-6 c: cbsxmh +1-6 x: fxxxxxx +5-12 d: wdddqrdkwkmdfwd +3-10 s: smsqncrsjjdmjdlsls +6-7 k: vkkskkjkwkrkkk +9-17 z: qwzhqgrnvzzbzlhjz +5-6 w: dwwwwp +5-8 n: ncvgqnvn +5-6 v: vvnvvwvv +3-4 x: dxxxsbsxx +8-12 t: ttgtshxfmzlc +10-17 x: xthkjfxlktkbhdxzx +5-8 q: qqtqqqkqq +4-10 d: ndddgxvzswlsgdpnrc +8-11 h: bgcfhhrkhhb +16-19 g: qgdmbghrjhgcvgwpggg +3-5 s: fbsqqszkdkqzw +9-10 h: hhhhhhhhdhhh +15-17 b: bbbbbbbbbtbbbbzbbb +11-14 q: qqqhqqqqqqqqqsq +4-18 r: rhhrrpghwbqfznflrrr +14-15 l: lllllllllllllrl +8-14 s: nsfpsrsssnffssjss +17-18 k: kkkkkkkkkkklkkkkck +1-12 c: cmnccccccccktcc +7-14 p: pppppphppppppp +1-2 j: jtjq +2-6 w: wwpxxrwwwdwwh +5-12 p: zspwppnppdghqplnj +3-5 h: zhqphfth +1-3 q: xqqq +4-9 r: qrzrfgpnbj +7-8 q: qqqjqqqcqw +4-6 m: mmmmmwdmm +4-6 s: sqcssgnsrrddgshvbcs +2-6 m: mmsgtr +3-9 v: wvwvvvmvv +3-5 j: jcjvtgjjjxvjjgjbhj +4-6 f: qsffzgff +8-9 x: nxxbxwfrxx +1-7 m: mvmmmbmmljmg +5-8 d: pdcdqdddwdl +1-3 m: mmgns +19-20 r: rrrrrrrrrrrrrrrrrrxr +1-4 h: hpghbhkhhr +5-9 x: xxxxtxxxxxxxxxxx +19-20 p: qvwdwnssfckjczggpghp +8-12 k: kkkkkkkfkkkkkkkk +10-12 b: cbbbbdbbbqbkbb +2-8 n: nkkpnprnfcnnwsmndqnn +11-12 d: ddddddvddddvd +4-8 j: jjjjjjjqjjl +1-3 l: lvdlslllhllsg +12-15 j: jzjjjjjkjpjjjjqf +6-9 s: sssssssssssss +1-2 z: xzzcnjrzzzzzzz +5-6 h: hhhhhh +7-13 x: xxzxvsmxlbxpxz +2-4 d: dpnddbdfdm +9-16 n: nnnnnnnnknnnnnnr +4-5 n: nnnvnn +13-16 p: vppppppppppppppz +3-6 w: wwtwww +7-9 n: nnxnwntnnn +4-12 q: mqcnsrvqqzgqkwz +3-4 t: dwtj +9-12 r: rrrrwrrrrdrcr +8-9 w: wwtcwwjhwwww +6-8 w: wwwwwwbgw +5-15 f: pgflfgfbbvvffkfkmw +10-17 s: ssssssssshsssfsssss +19-20 m: mmbmxfmmbzqhmxmxmmmw +11-12 d: ddddddddddsd +13-14 f: fffffffffffffdf +1-6 n: nnnnnnnn +11-19 x: wmxxbxxkxxxpxxxxxxc +2-3 z: szgkqvmzwztdcxtvn +16-20 z: zpzhwdtdzhvgcpdpzzzz +15-19 p: ppmpcxppppprsgnpppg +4-5 x: rrxfxxxqx +1-2 q: rqdwn +4-6 x: pkfxqxxfxbk +13-17 c: ccccccccccccncclc +5-7 z: zzzzvhz +5-6 r: rrrnrl +2-5 g: mfgkgxhckg +3-6 c: cnmcjcccdccccv +7-11 t: dttttttrttxtt +6-9 p: ptlfppppcvsp +3-5 g: ggxkwtj +5-16 x: phzxlbhqxgxzwjwkkxp +7-8 s: wsssssmsn +1-7 m: pmgrmkmmnnm +15-16 n: nnnnnnnnnvnnnnnln +6-8 t: ttzttftst +5-7 g: ggggggggggg +13-16 d: ddddddddddddpddbdfdd +13-14 f: jclffflwlffbfvffffbn +3-4 j: xjzjjjr +8-14 n: nnnwknndnlnlnn +6-7 s: sxsssnzs +6-7 r: rrsprrjrcrb +10-11 w: qwwcwqzwrbq +7-10 b: bbbbbbzbbbb +5-6 d: ddddkd +16-17 d: ldldddddpdldldddd +5-14 w: zdtwxnxwhwwpww +6-9 q: mqqxqsqqq +2-11 g: gpggzvgggkgmcmt +6-14 k: kfkkkxkkkkkkkjkk +2-3 m: zfmm +13-17 k: kkbkkkkmkktkkkrkk +4-6 z: tzprqwzzcpj +3-4 w: gblwcxwllzpv +3-5 d: ddcddd +9-13 r: rrfjmrcsrrwvrrk +11-17 m: dgwrmqjmclmczrlwf +1-4 v: vvhvvv +10-13 c: clhccbcvbvcfcccqccc +11-13 s: sssssssssssss +6-7 k: skkckkk +2-5 m: mfffq +3-5 x: jxbxx +1-2 c: ctcc +5-8 q: qqqqgqqqq +11-13 q: hqqbqqqqqqbqqqqqbk +9-11 q: qqqqqqqqqql +15-20 q: qqqqqqqqnqqqqqqqqqqq +5-7 g: gzngbvggmlzzrgx +2-10 n: zjknggzlvnxtbwnhmf +2-13 c: cccccccccccct +4-8 c: cccccccbcccc +3-5 k: kdkkz +8-10 h: nchthhghhjhjh +10-11 l: wllllllllplxllnjj +14-17 q: qqhqqqqqqtqvqcqqqrq +5-9 d: dddddddrz +13-14 z: zzzzzzzzzzzzzm +7-9 t: tttttctwlttt +6-13 w: dwcwdtwrwccwwl +10-11 h: hhhhhwhhmmhhhh +7-9 t: tttttjtttt +12-17 n: nnnnknnfpnnwncnnjn +5-6 c: zccccc +11-13 s: ssssksxssssss +9-17 q: qqqqcfbqrqqcqzqqlqqq +3-4 m: dmml +4-6 v: slvvvln +4-5 n: nnbmnn +2-7 h: whhhhhjvfhhh +2-5 s: slhss +4-5 q: zbhqhqgqdq +2-6 p: pjtxqp +7-9 h: hhhhhhkhh +7-8 w: fgvwcwws +10-13 d: ddddxhdddddvhdddd +7-16 m: mmnznmmwmwrmqzrqbmpr +12-13 v: vvvvvvvvvzvvjv +18-19 g: mztkzhgmndnffztwqfg +7-8 j: jjjcjjvjjjjpjjjjjjj +7-10 s: sssssssssz +18-20 s: sssssssssssssssssssg +1-4 r: trrrr +2-16 r: mrrrrrrhrcrrfcpqrh +5-13 n: nnbljfchnnnnnj +1-6 v: vvvvvmvv +7-15 q: szqhbkqxppcbkxmc +9-10 l: gllllvllsvll +1-4 m: mxldw +5-9 x: xxxxxxxxj +11-16 t: ttttttttwttttttfl +7-12 j: sjjzpjjjjljhj +1-5 x: wmplxj +2-6 z: zzxzzrzqplrh +4-6 w: cqbwwbww +14-15 l: llllltllllllllw +3-4 m: mhmvvz +3-4 w: wwmw +1-4 c: ccchpccc +6-10 p: pppppppppqprbppppp +9-15 h: hhhjcrhhhhhhchhjht +8-11 g: gggggggkggggggggg +4-9 h: hhkqxhhhlh +7-8 f: mlfdfrmfbfttmffqfff +7-9 t: nttttttvsn +6-9 h: hhhhbhvhph +4-5 f: hhcdf +3-4 k: kfxkcr +1-4 z: zzml +3-5 f: cjjffbzffqfsbm +4-5 f: ffdfh +6-17 h: hhhhhhhhhhhhhhhhrh +8-10 d: qdddzddddzdd +7-8 j: nfxxthqj +2-4 n: nnnc +3-5 v: vlvzx +6-10 n: nnnnnnnnns +11-13 q: bzhwhbvwqffzs +3-6 c: gccmcc +2-5 m: xmbgm +2-11 g: tgztmzzbgjzc +2-5 j: jsjbj +3-4 v: vvljvvv +3-6 p: pxwcnwmp +2-7 j: ndjnzmjklxqwpkpnwb +1-20 s: slssswsnssscgbssxsdg +3-4 r: rrrfjc +5-16 t: ttntptttsqtttpwtgbt +3-4 g: fxgg +13-17 l: llltllllllllvllllvrl +5-8 q: vxfpqhqd +4-8 c: cvqcwkccp +5-11 x: kxqkghvxxdqfwxxkxx +4-5 t: tttht +8-11 n: mnnpnnpsnqdknnvsh +1-4 g: gggngpdggv +5-6 s: ssssss +4-7 d: mddfddk +7-8 f: fffffffb +4-11 x: cbmcvvvvxgn +14-16 d: vdddkddpddddllrddddd +8-9 h: qhhhsnxhjmzhlhdjxhf +5-13 f: fxfhlqsffxfgwpcz +14-16 g: jggggnngggngggggjggg +1-5 z: rzgzt +3-6 f: fffgrv +3-4 w: zwwtwdw +9-12 g: dkmhhvhjgsvqglbrr +4-5 g: gbrtx +1-5 r: xrrrr +2-5 d: ddddddddddddddd +4-5 j: jjvjz +2-4 b: blbbbt +16-17 b: bbbbbbbbbbblbbbzbc +8-13 l: lljlqlkslqllllll +6-15 g: wgfgzggggggbtch +4-13 w: cwvbtpnjdkvww +8-10 x: xtdxxxxxxhxxx +3-6 p: pprpppp +15-17 p: ppppppppppppppkpppp +1-3 w: wnwpwwbllb +3-5 m: mxqdq +13-16 s: hsrsssqssssscgssss +1-2 c: zccccm +5-8 r: rrrrkrrm +5-6 j: njjkjjsj +5-10 r: rrrrhrrrrr +5-12 x: xmxwxnmxsldlrpgxxxc +4-6 z: ztzwfzj +11-15 w: wwcwwwwwwwzwwww +5-7 c: cpccccnd +1-16 q: qqvhqhnpqscqqldqbzh +8-9 s: kfpdswzssssqssscms +2-16 l: hppbqldllnlljvflltl +4-12 c: cccccccccccpccc +5-6 r: rrrrqb +11-12 f: ffffdffffmfdkff +5-6 k: lhkkkf +12-15 z: bzzzzzzzzstzzzz +5-13 c: kgsscwsfzcbwchwk +11-18 m: wmmjbmfpvmmmthfwpsxf +7-14 m: mmmfmmtqmmmmmmmmrc +14-15 g: wbqfggngtbqvpqp +10-11 k: kkkvxktjtkbjkkkk +2-4 b: wbtkp +4-10 v: vvvvbffvmtvvz +6-8 m: vtvgmmbc +1-7 d: hddsnzd +2-3 d: rndxchftldndc +2-11 z: zzcwbxkzzqzzp +5-6 q: wqqqjq +9-10 d: ddddddpdcdd +1-12 g: ggfggggggggbn +4-5 v: vvvrvv +12-14 r: rrrrrrrrrrrqrr +6-10 s: sssshvssss +7-10 g: gqgzgggksggggdqghs +8-9 c: ccccccccf +13-18 j: gfjjjjjjjjgjhwjjch +11-15 m: mmmmmmmmmmmmmmm +2-4 s: ssqsr +7-8 v: vxxvbfdgvvgvtw +2-7 x: xwxxxxx +3-5 p: pzppfp +1-2 z: zfzwpzpxzc +6-7 r: vrrxrrnrb +3-4 f: nvftvrjsgxszkfsffg +1-5 w: kndqwltttskcwtzqt +1-9 z: zzzzzzzzzz +10-11 v: vvvvvvvvvvv +1-5 m: gmjhm +7-11 j: sdjjpjjjdgnccjjjsq +1-6 m: rrmcmmmmmbm +1-6 n: nlclfggwnm +3-7 s: clfnmssns +3-7 m: tqjmmmx +13-14 n: nfnvkntnlnnnxfwlnnnn +3-4 p: xphp +8-9 n: nnnlnnnzn +11-12 h: hhhhhhhdhhhhh +1-4 p: pjgsphp +3-9 f: pvfnfmfrcffffjf +15-16 d: dddddddddzddldgdd +2-4 b: bvztgnzbpr +3-7 w: wgwhmpwwwlwzzhwnv +5-9 n: nmznnvnnsznnw +4-6 f: zqffsnffdlbkt +6-7 s: sssssss +2-5 q: kqlqqmv +11-14 q: pjqrzjfdgmqzpd +17-18 s: sssssssssssssssssj +8-12 x: zxxxpxxxxxxt +2-4 h: hqhhhwfshp +1-9 b: qzwgfbzjvt +8-10 c: cccccccccn +3-5 n: nnnkwn +4-6 m: zmmhdzmmx +7-13 v: vvvvvnvvvvvvsvv +1-12 z: zzvzxzfzzrzm +6-11 p: ppppplppppvppppfp +1-5 s: sjsss +2-19 w: wwwwwwwwwwwwwwwwwwcw +5-6 k: zxlkrkbcrcwkdqtkkw +1-4 w: hjjbzqwnpjrbglkr +8-9 n: sznnljnqn +7-13 k: dwkpnjkdkglnm +14-20 x: xzxrxxsxxxxxxxxxxxjx +4-7 w: rtrwdvww +14-18 m: mmmpmmmmmmmmmlmnmq +3-4 z: zzxz +8-10 z: zzzzzzzzzjz +11-14 v: vcvwvxvcslbvvhv +4-8 j: jgjjbrjhp +5-6 d: dddddm +4-5 n: nnnzn +15-16 t: ttttttttttttttnc +5-8 b: bbtbspvbbgllcrgxd +8-9 w: wwwwwwwqw +3-5 j: vbjmxwjgjfrzttznwc +12-14 l: llllllllllnglzlwbl +2-4 f: ntffj +2-4 c: gvccrcc +19-20 w: wwwwwwwwwwwwwwwwwwpw +1-3 k: klwgkc +3-9 s: qsmlssskpsbsscs +8-9 j: jjjjjjjdj +5-9 s: bszlpsssss +13-14 l: llxllhlllllllllll +1-6 s: ssssscs +7-8 v: pbvptdvv +10-15 v: vvvvvvgvvvvvvvcv +4-5 k: kkcskfldskdc +13-14 v: vvvvvvvvvvvvvgv +3-7 n: hnjnnnnnsnfp +3-8 m: mtmjhrzzllqml +9-11 w: wwwwwwwwwwxw +10-20 g: pkvgkfvmxgkpjjhtqvcg +8-11 w: wwwwwwzwwwdw +5-7 r: rrrrrrb +2-7 b: sbldlwvcb +10-17 v: vvvvvvqgcvvkdvsvvjv +4-5 d: tkddnddzqpdfdddd +10-12 p: npppppppppfm +1-12 t: wttttttttttttt +4-5 f: qfffz +11-14 p: ppppppppppppgvpcp +6-8 w: qswwwrwwmww +9-15 g: txgchzlpgggdhgggbg +2-10 h: hthhzhhhshhh +5-8 l: lllllzkk +17-18 l: nlllllllllllllllvll +3-6 c: zdwcjcccdqct +8-17 m: mmmmmmmmmmmmmmmmjm +10-12 c: ccccncrccccb +4-12 j: jjjbjjjjjjnwjj +2-6 h: chbhhfc +5-6 c: cccpncc +6-7 m: dmwmkmphmmdmm +6-7 k: rxwkmkv +1-5 f: fzgfl +4-7 x: dxkmxhb +1-5 f: hhfzfpfffffsff +1-7 s: sssslsvv +3-7 w: wgwwwsh +12-15 d: mdsdbkltdvthvfjdddn +16-18 x: xxxxxxxxxxxxxxxxtl +5-19 x: xwxxxxxxxxxxxxxxbpn +3-5 h: hhrfh +8-10 g: ggggggggggkgg +3-8 c: cccccccmc +5-7 r: wrrrxrrr +7-8 p: phpprdslbpxprpg +17-19 z: zzzzvzzzzzdzzzzzzzg +2-4 x: kxxxxxm +2-11 w: gwwzpwwwwwplrqfh +6-9 t: qtcttttgf +9-12 g: gggggggggggsg +3-6 n: fzmnxb +5-9 x: pqxxxwdtn +5-6 j: jjjjjkq +10-12 h: hhhhhdhhhzhh +1-4 g: gskgk +3-5 c: ccccj +1-10 m: wmxsgmzmrzmrmmmjmmct +5-10 p: lmpppvptdgpjpwfwpp +2-4 z: bzgm +6-7 d: ddzdddj +3-7 r: gchrfwr +4-7 k: kkcvkkkkkk +8-12 t: tpwtttctvtttftpt +11-12 c: ccccccxcdncbwcc +2-10 p: jwwxlppppppnpn +9-16 w: chmwwwwwjwrwjwzjww +1-6 j: jkqjjbj +5-8 k: kkkkkklhkk +3-5 q: qqqqc +16-17 x: xxxxxxxxxxxxxxxtg +4-9 f: fmfkcfffffkcfmfhnzf +5-6 z: zhzzlz +4-17 k: kbwmwvkkvvhxkkkckqvk +3-5 d: dddmmdt +4-10 m: mmmmmmmmms +5-6 g: ghgggpj +1-5 c: cccck +3-7 z: zzjzzzzz +2-7 v: xrprnvvtsrgsk +1-5 s: sqqsn +3-5 j: xwpnj +5-7 v: vvvvvvqmv +4-5 j: jjjjzjjjjljjc +2-4 h: hghh +3-5 n: fnnpc +16-20 d: dddddddzdddddddpdddd +3-4 t: tnpt +2-7 f: fxffffkff +6-9 b: bbbhbbwhbbrblmtb +7-10 m: msmxmrnmrmmmm +3-4 r: rrzrr +7-8 m: mgmmmmjmm +2-3 l: lmll +2-6 h: cngphhhbfpvvsgrqhhzq +6-8 d: dddddddg +12-15 p: vfjxwpcpdvpnjwp +12-17 m: mzfmmsvfxmqsmcfjmwjb +15-19 b: bbbbbfbbbbbsbbmbbbbb +7-8 n: qdnjnnnpvmfnn +6-8 l: llllllll +3-4 n: nnbdh +11-12 w: hprdhfrpvcwbgwjcw +2-7 r: jrfrbjrhrw +1-6 v: fvzknvvv +10-11 t: tttstdhttqrttt +5-14 f: fxffnffffnfffff +10-13 q: qqqqqqqqqjqqqqq +1-5 v: tnvfvxvjvbvjk +4-5 c: ccccpc +4-6 t: tttttktttt +1-2 r: rwrsq +11-12 c: cccggjcccccr +11-16 g: gwggggggggqggbgggfg +12-14 b: bbggzhxsjjsbsf +5-7 r: kjdwpfbmcptrslrrr +1-2 l: lvbl +6-11 c: hsksgzhccbccbdfnzqcv +6-7 m: gmmmmmc +1-2 h: hhhh +1-3 g: rggg +4-8 z: rzzzzfbwzxkzzz +3-6 w: wwwwww +3-4 g: ggwtg +9-11 v: wxfltmvjvjm +2-4 l: llck +2-3 m: mmkgpdwzdm +2-5 d: bdjhdhjldzh +10-12 j: jnjlmjjjjpcdkjjjx +3-9 q: qqzqqqqqqqqqq +4-8 d: ddzwdpddd +3-7 m: mzmbsmcjgmpmmdkmr +8-13 q: xrxvgqdvvmjhhgdfz +3-12 z: zzjzzzzzzzzzzz +5-10 k: jkkkmkkkmkk +6-7 m: mmllmmtm +17-19 c: ccccccccccccccnckccc +6-9 w: wwwtbrwwwxww +7-9 d: wfdkwddsdsmdbswv +11-12 g: ggggggggggbgg +13-14 j: prjjdjjjjjjjcjjj +3-5 j: jjlljv +3-4 h: hrlh +6-7 l: hplnxlsjnwxzllllljcj +4-5 g: gfgml +4-5 z: zwkznzn +4-11 n: stnzhznnfnqcnn +2-5 h: hmzhh +4-6 w: wwbwwc +4-11 w: vmwwrxpkwcp +4-8 t: thxttstmtbstcvjtlflh +6-8 v: hvvkvvhfm +16-18 b: tbbbbbbbbbbbbbbbbr +8-10 f: fffffffcfl +13-15 r: rrrdrrrrrrrrrbr +8-14 t: ztstxttttttttwz +8-12 j: jgjjjjgjjjjx +5-6 m: nmqjdmgfqqmcmmvndztl +2-6 v: vwvvvvtv +15-16 l: llllllllllllllll +3-10 q: qqqqqqqqqxqq +8-9 j: rggxhvjjjk +1-3 p: pqhp +4-11 z: nkjddzczjrzktvnckmg +5-12 r: tfrdrswgwnbc +8-13 r: rrrrrrrrrrrrrr +13-18 x: xxmxvxxxxxxxhrxxxc +7-8 z: zzkzzzzw +4-8 m: mmmqmmskqlmmgm +1-3 w: bmwg +1-4 z: vzzzzzwz +3-4 d: dqdw +2-9 z: hzhqpndtllsw +10-13 t: tttttttttttbjb +12-14 r: rrrxrrsrrrgfrrr +12-19 g: hdxnlgglxwrgzkggcwp +3-4 x: qxjx +1-2 r: rrpdlqhcnwwr +5-11 c: vdbzvccdccldsjcq +4-6 k: kxkwkk +16-18 k: kkkknkkkkkkkfkkkkx +1-2 q: tqtghddbk +7-8 g: ggcgggvgg +13-19 d: ddddddfjdddddfddddd +9-15 z: pzhzzzzzqpzzzzzz +4-5 l: lclld +2-15 r: jrrmtzrxlczbttrcvkn +3-5 z: zzzzc +15-16 k: kkkckkdjnkkkkkkkkk +11-13 m: mmmmmmmmwmmmzm +8-13 p: ppdpptppdppxkppppppp +1-3 g: gszcmgjg +5-11 h: skbchhdbnphpbfl +4-7 d: prdjctk +15-18 f: ffcffffffffffzdffc +7-11 g: npggtwgzgtgzhx +12-14 m: mmmmmmmmmmmpmkm +10-11 b: bbbbbbbbbbb +3-16 k: kgxtvmlgpkptpghkb +4-6 m: zcwmzmvqvgmmsxj +6-15 m: mzmmccmmlmmrmlnl +12-13 x: xxxxxxxxwxxxz +4-5 d: mhvdtxfklzdpgdqdpqhd +5-10 g: nghgggggggqg +7-9 k: kkkkfkkkwk +6-7 c: cvcvczncn +10-11 t: tttqttttttv +18-20 h: hfsqhkwfhttgfhmbghhx +6-7 v: vgvvvwz +3-4 z: zzzj +3-5 d: dhqjnhgldtdzx +3-4 b: jbrbbbbbbbblwb +12-15 g: gsgfdfksrggqvgggjgt +6-11 p: pmppnpqpdppdpppphpf +13-14 z: zzzzgzbzzzzzgzz +4-12 c: ccjcrvcnwccwctcczcp +10-11 c: szcccfccfpcchqs +10-14 l: lllllltgjlnlbprlll +12-17 z: zhzzzxzpzzzfzzzqznz +12-15 l: llllllllmvlvllfll +7-12 c: ccccccncccccc +1-5 m: mhmmzmm +11-17 r: rrzrrwrrsrcrsmdrvrr +4-5 w: fwwpwfw +7-8 n: nnnnnnnk +3-18 n: rxhzsscgbnmzpvbqmzf +4-11 k: kkkkkkkkkkkxkkskkkdz +10-11 c: cccccccccckcccccc +8-15 r: zrrtfrjrrrrrjrrrrrr +15-16 h: ghgvlhwgqslhhhhxmp +3-5 f: ffffqf +3-8 s: bssmfsgspxssgjhsjdv +3-5 q: bfdhq +4-7 k: qknkkkd +6-9 b: bbbtbnfbbb +12-14 x: xxxxxxxqxkxvxxwxxcw +3-6 c: chfckc +3-8 h: kzkhgrffz +10-16 f: fffgjfffsvffdzfhfzff +1-3 r: rgcr +16-17 x: xxxxxdxxxxxxxxxxl +6-11 j: rsjcjjcbpchkvfjpml +9-10 s: sssqvsssjsss +17-18 v: vvvvvvvvvvvvvvvvvv +3-5 t: jtmtgtxxhzskzk +1-6 t: ttqkvdgs +13-16 q: qqqqqqhqqqqqzqqjqq +10-11 b: bbbbbvbbbbw +6-7 w: sgwmqwgwtbrllf +10-11 f: ffffffftffff +12-13 w: wwwwwwwwwwwzt +18-19 t: ttttttttttttttttttt +1-5 h: zghhr +1-2 v: dvjnctwvlp +1-2 j: jhzkzjh +3-6 h: rhhbhhh +2-4 d: dddrd +17-18 s: ssssssssssssssssns +1-8 m: smmmmmmmm +2-4 s: dcfsbzwqq +11-12 d: vnldqthkptgkkfdmtw +8-12 p: vpppzpprppppp +6-8 q: jqqqsphqjwrqj +8-10 k: ktkkkkdkkkk +4-12 v: nvvwvvvjzvvvv +5-6 z: zzzzzt +1-5 w: xwwwwwwww +11-14 p: pppfbpppkpftdpkpgpp +2-3 v: zrlv +2-4 f: fbwff +5-6 s: ssssmn +11-12 z: zzwztpzpjzhz +5-6 c: cccjcc +4-6 v: vvvgpvcpwv +5-6 j: jnzcpjnzjjcpsjfps +12-14 m: tpzwjjgpbbdmgxgphd +13-15 n: nznnnncnnnnnnnf +8-11 w: qsxwnlhwwxw +6-9 t: ltbdttnst +10-12 t: hnjdfgrhtgkl +2-4 d: dbddddc +13-14 g: gggggggbgggmgmgm +4-12 r: rrrzrgkrrrrkr +14-17 n: nnhnnnnnnnnnnnnnhnn diff --git a/2020/day2.output b/2020/day2.output new file mode 100644 index 0000000..d11a364 --- /dev/null +++ b/2020/day2.output @@ -0,0 +1,1001 @@ +min: 9, max: 11, c: p, password: pppppppppxblp, count: 10 +min: 2, max: 4, c: b, password: bbxbb, count: 4 +min: 3, max: 5, c: q, password: dqfqb, count: 2 +min: 5, max: 8, c: g, password: ggcgggglg, count: 7 +min: 10, max: 18, c: l, password: gllpmlgtrmnllhllrlll, count: 10 +min: 18, max: 19, c: z, password: zzzzznszzzzzzzzzzzxz, count: 17 +min: 3, max: 6, c: r, password: frrhxsnrmgmw, count: 3 +min: 1, max: 8, c: n, password: zkxhnxnzghnm, count: 3 +min: 11, max: 12, c: z, password: zzczzzztlzlzzzz, count: 11 +min: 4, max: 7, c: q, password: qqqbncqqq, count: 6 +min: 3, max: 4, c: c, password: ccvfc, count: 3 +min: 19, max: 20, c: l, password: sltlklljdlzglwllllzl, count: 11 +min: 6, max: 16, c: h, password: dhhhrhvhnhdchfsnhq, count: 8 +min: 3, max: 7, c: l, password: fllllqjlll, count: 7 +min: 8, max: 9, c: k, password: xkkjqklkm, count: 4 +min: 1, max: 2, c: l, password: llgpl, count: 3 +min: 2, max: 4, c: x, password: qkjxvqlv, count: 1 +min: 5, max: 6, c: c, password: cwcccjch, count: 5 +min: 3, max: 7, c: n, password: bnnhnwnqtdnndnncnd, count: 9 +min: 8, max: 9, c: n, password: nnrkmdnkn, count: 4 +min: 6, max: 9, c: t, password: ttttrtltptgvcd, count: 7 +min: 3, max: 4, c: h, password: hhwhhhdhhhh, count: 9 +min: 7, max: 8, c: w, password: wdwvcwwszcwwwwwq, count: 9 +min: 2, max: 4, c: n, password: vnng, count: 2 +min: 3, max: 13, c: v, password: vvvvvvvvvvvvjv, count: 13 +min: 9, max: 11, c: c, password: zcccccccccfcbccc, count: 13 +min: 10, max: 11, c: w, password: wkwwwwwwwxw, count: 9 +min: 10, max: 12, c: z, password: zzzzzjzzzrnzz, count: 10 +min: 5, max: 6, c: t, password: ttttts, count: 5 +min: 13, max: 19, c: b, password: bbmfbbbbbrbbgbbbrbbb, count: 15 +min: 8, max: 9, c: d, password: bdddvkddjbdgdd, count: 8 +min: 19, max: 20, c: m, password: mmmmmmmmmcmmmmmmmmmq, count: 18 +min: 6, max: 18, c: w, password: wwwwwwhwjwwwwwwcwjw, count: 15 +min: 4, max: 10, c: t, password: tttttttttj, count: 9 +min: 2, max: 7, c: j, password: fbdgmfjbjgjn, count: 3 +min: 7, max: 8, c: w, password: wwwwwwcww, count: 8 +min: 8, max: 12, c: c, password: cbmdccbccckjccch, count: 9 +min: 13, max: 15, c: f, password: fpfffffffffffqf, count: 13 +min: 7, max: 11, c: t, password: sbtstwdxjpclwd, count: 2 +min: 1, max: 3, c: s, password: shkkqcs, count: 2 +min: 7, max: 8, c: l, password: bdggzczl, count: 1 +min: 1, max: 6, c: g, password: zgggggglggggggw, count: 12 +min: 12, max: 16, c: h, password: hhhhhhhhhhhhhhphhhh, count: 18 +min: 8, max: 19, c: k, password: htknkhkrkdkhkpwppkk, count: 8 +min: 8, max: 10, c: k, password: kkxkkkbrkgk, count: 7 +min: 8, max: 9, c: h, password: hvhhhhhfhhv, count: 8 +min: 15, max: 16, c: x, password: xxxxxxxxxxxxxxxh, count: 15 +min: 1, max: 12, c: b, password: bgwpjbkhbptsbbb, count: 6 +min: 9, max: 10, c: j, password: pjtjpjpnbjjlsgbn, count: 5 +min: 8, max: 9, c: s, password: sscplbswssssglxs, count: 8 +min: 14, max: 15, c: j, password: jjjhjjjjjjxjjjj, count: 13 +min: 1, max: 4, c: q, password: qnqj, count: 2 +min: 3, max: 5, c: d, password: qpdddqvwbzldf, count: 4 +min: 14, max: 15, c: b, password: bbbbbbbbbbbbbbt, count: 14 +min: 1, max: 2, c: t, password: tdxt, count: 2 +min: 1, max: 7, c: g, password: dlpkvrgjzpnr, count: 1 +min: 3, max: 11, c: m, password: lmnwjjxpfmm, count: 3 +min: 3, max: 8, c: l, password: llglllllll, count: 9 +min: 2, max: 4, c: r, password: gfmrlbmsvqzrmbnd, count: 2 +min: 5, max: 9, c: s, password: srsqssssds, count: 7 +min: 8, max: 9, c: v, password: vvvvmvvvhw, count: 7 +min: 7, max: 10, c: d, password: mddwdvjdcdwdcgddd, count: 9 +min: 4, max: 7, c: k, password: fksjkkkk, count: 5 +min: 6, max: 9, c: t, password: fnrxmlwtt, count: 2 +min: 11, max: 12, c: d, password: dddddddddfmd, count: 10 +min: 4, max: 5, c: z, password: zzdzzzz, count: 6 +min: 11, max: 13, c: z, password: zzzzzzzzzzpzmzzz, count: 14 +min: 12, max: 14, c: z, password: zrgnvcrxkzzzrb, count: 4 +min: 10, max: 13, c: q, password: qpqqqqqrqxvqq, count: 9 +min: 6, max: 10, c: g, password: gglggggggzgggg, count: 12 +min: 2, max: 8, c: j, password: jfqjrdjjjjjj, count: 8 +min: 7, max: 8, c: z, password: hzlvrczjp, count: 2 +min: 4, max: 5, c: k, password: kggjkl, count: 2 +min: 4, max: 7, c: m, password: mpmmmcmm, count: 6 +min: 13, max: 14, c: x, password: xxxxxxzxxxxxxw, count: 12 +min: 6, max: 7, c: n, password: znnnnnlpjcn, count: 6 +min: 10, max: 16, c: g, password: gggzvgggntggfgghggg, count: 13 +min: 2, max: 17, c: n, password: hnchrpvzhkdsnhgcnfql, count: 3 +min: 2, max: 8, c: f, password: fkfpffff, count: 6 +min: 4, max: 7, c: s, password: qwdspspj, count: 2 +min: 6, max: 7, c: r, password: rrrrrnx, count: 5 +min: 7, max: 8, c: p, password: wpppppsp, count: 6 +min: 8, max: 10, c: m, password: mmmwmjmmmvmzpm, count: 9 +min: 6, max: 7, c: j, password: jjjjjncd, count: 5 +min: 3, max: 4, c: k, password: kxkk, count: 3 +min: 2, max: 4, c: z, password: czzmzz, count: 4 +min: 11, max: 12, c: t, password: tttttttttttzkp, count: 11 +min: 10, max: 17, c: t, password: ttttvtltdttrqtztr, count: 10 +min: 3, max: 6, c: n, password: nnnnvvxv, count: 4 +min: 7, max: 8, c: v, password: rvvpvvvpsvv, count: 7 +min: 1, max: 2, c: r, password: nkfgnr, count: 1 +min: 4, max: 11, c: c, password: cccbccclcccc, count: 10 +min: 7, max: 12, c: q, password: qpbqtqkqqqqqqq, count: 10 +min: 2, max: 7, c: m, password: mfmmmmmmxmnm, count: 9 +min: 10, max: 11, c: n, password: bnnnpnnncxrnnnn, count: 10 +min: 10, max: 14, c: n, password: nsnnnnnwljnsnnn, count: 10 +min: 5, max: 9, c: b, password: vcvcblrxbvjbtzbrmbr, count: 5 +min: 3, max: 9, c: m, password: kmmmmxmmkmmk, count: 8 +min: 2, max: 10, c: l, password: llbllgzllnlll, count: 9 +min: 5, max: 6, c: d, password: ddpdwdddxhpdqd, count: 8 +min: 12, max: 18, c: j, password: cjfbjccqgxlczjptqlk, count: 3 +min: 1, max: 3, c: z, password: mzzz, count: 3 +min: 5, max: 11, c: m, password: mdfmmmmtmgw, count: 6 +min: 2, max: 14, c: h, password: nhhnbhghhlhhchsqsr, count: 8 +min: 3, max: 4, c: t, password: jvtt, count: 2 +min: 2, max: 8, c: t, password: tttkxxtsttht, count: 7 +min: 7, max: 15, c: w, password: wwwwfwwwwwwrbww, count: 12 +min: 1, max: 4, c: j, password: rbjj, count: 2 +min: 8, max: 12, c: f, password: ffkhffffcsfzff, count: 9 +min: 10, max: 12, c: p, password: pppcgpqphprh, count: 6 +min: 10, max: 11, c: l, password: lllllllllsl, count: 10 +min: 7, max: 8, c: s, password: svsssssss, count: 8 +min: 4, max: 5, c: c, password: cvjcc, count: 3 +min: 1, max: 5, c: v, password: vcdcd, count: 1 +min: 5, max: 14, c: z, password: zzwkzztzzzzzbzzvzzz, count: 14 +min: 11, max: 12, c: s, password: sssssssssssps, count: 12 +min: 5, max: 7, c: b, password: spmtbpn, count: 1 +min: 5, max: 6, c: c, password: cccccf, count: 5 +min: 10, max: 12, c: p, password: ptpppppppppk, count: 10 +min: 4, max: 13, c: f, password: ffkffffkffflb, count: 9 +min: 2, max: 5, c: t, password: nttqftpnwbjbxmqdqv, count: 3 +min: 17, max: 18, c: w, password: wwwwtwwwwwwwwwwwkwww, count: 18 +min: 7, max: 9, c: f, password: lmrffdbffvfmf, count: 6 +min: 2, max: 5, c: h, password: hhhvzrhh, count: 5 +min: 10, max: 11, c: q, password: qmdrdfqgzql, count: 3 +min: 3, max: 11, c: g, password: ggggggggggm, count: 10 +min: 4, max: 5, c: z, password: zzzrzzp, count: 5 +min: 5, max: 7, c: w, password: wwwwkwwww, count: 8 +min: 10, max: 11, c: f, password: ffffffffffp, count: 10 +min: 6, max: 9, c: v, password: vvvvvvvmv, count: 8 +min: 4, max: 5, c: x, password: wjxxxxxtd, count: 5 +min: 12, max: 13, c: p, password: vppppppppppzbp, count: 11 +min: 2, max: 7, c: b, password: bqntbls, count: 2 +min: 15, max: 16, c: p, password: ppppppppppppzpfxn, count: 13 +min: 2, max: 3, c: b, password: bbcnbq, count: 3 +min: 10, max: 11, c: k, password: kkkklkmkkhk, count: 8 +min: 4, max: 6, c: w, password: wwwdjb, count: 3 +min: 4, max: 6, c: b, password: sczlwbnffbnxbvjbmj, count: 4 +min: 3, max: 17, c: m, password: jmmlmmmgmmmjmmmmmlmm, count: 15 +min: 6, max: 18, c: z, password: zmkwvzkpqzmzdfgdvt, count: 4 +min: 5, max: 6, c: q, password: sqwqqq, count: 4 +min: 1, max: 3, c: g, password: gjgt, count: 2 +min: 5, max: 8, c: x, password: bxcxxzxxws, count: 5 +min: 4, max: 5, c: c, password: rnscvcngbcmpddkcvctk, count: 5 +min: 7, max: 11, c: g, password: ggggglvgggngg, count: 10 +min: 2, max: 11, c: l, password: lsqlzlllllklgfl, count: 9 +min: 2, max: 9, c: m, password: cmqkbmdxp, count: 2 +min: 6, max: 7, c: w, password: wwwwwww, count: 7 +min: 8, max: 13, c: q, password: qbqzqqqqqlqqw, count: 9 +min: 3, max: 4, c: n, password: sfqnnnwvzn, count: 4 +min: 1, max: 2, c: w, password: nwww, count: 3 +min: 2, max: 4, c: v, password: hvvbqgnfl, count: 2 +min: 14, max: 15, c: m, password: gjgdmmmmkmqqcxmrsm, count: 7 +min: 2, max: 3, c: z, password: zzzx, count: 3 +min: 5, max: 13, c: q, password: qqqqdqqqqqtqjqq, count: 12 +min: 4, max: 5, c: z, password: zzzzk, count: 4 +min: 5, max: 6, c: t, password: tttttf, count: 5 +min: 3, max: 6, c: z, password: ztwzczkz, count: 4 +min: 3, max: 5, c: l, password: llpljllllllll, count: 11 +min: 2, max: 3, c: s, password: ssscp, count: 3 +min: 8, max: 10, c: d, password: dddddddwdddddwddg, count: 14 +min: 2, max: 6, c: s, password: sbssps, count: 4 +min: 1, max: 5, c: f, password: ffbfvfxbkmbhvbcfmxpf, count: 6 +min: 1, max: 6, c: j, password: gqfrmjgsgjjhcjhn, count: 4 +min: 2, max: 5, c: l, password: lwvllll, count: 5 +min: 2, max: 5, c: z, password: zkzhzb, count: 3 +min: 10, max: 11, c: s, password: wsblfxvmvsslbhfjtsws, count: 5 +min: 11, max: 17, c: f, password: fffffffxfffffffftfff, count: 18 +min: 4, max: 5, c: r, password: rrrkbrr, count: 5 +min: 7, max: 10, c: w, password: qwqwwwgzrdxww, count: 6 +min: 6, max: 8, c: s, password: ssssssscs, count: 8 +min: 4, max: 6, c: q, password: qbqwqzfqcfgkmzqxb, count: 5 +min: 6, max: 10, c: t, password: ttncfqqtttttp, count: 7 +min: 2, max: 4, c: m, password: bbzcjjqmfvln, count: 1 +min: 4, max: 7, c: n, password: cnqhntshdnnrnrnz, count: 6 +min: 7, max: 12, c: d, password: vmdndkzpmcbd, count: 3 +min: 6, max: 7, c: p, password: tpqpppzpjp, count: 6 +min: 3, max: 10, c: r, password: rgrrrpzrbrrr, count: 8 +min: 2, max: 15, c: h, password: ghbfhbgrtxrshphhl, count: 5 +min: 2, max: 6, c: j, password: pjjjjlj, count: 5 +min: 6, max: 9, c: j, password: rjrjjjwfjn, count: 5 +min: 10, max: 13, c: s, password: sssssssssjsssssss, count: 16 +min: 1, max: 6, c: c, password: crnjccgnw, count: 3 +min: 6, max: 7, c: l, password: qrllgql, count: 3 +min: 12, max: 13, c: z, password: wzzzzzzzzzzfz, count: 11 +min: 1, max: 2, c: c, password: ccclc, count: 4 +min: 2, max: 6, c: f, password: qdlflfr, count: 2 +min: 4, max: 10, c: r, password: drrrrrwrfrr, count: 8 +min: 5, max: 6, c: f, password: ffzffnf, count: 5 +min: 4, max: 6, c: p, password: hkppkbppp, count: 5 +min: 8, max: 9, c: r, password: rrrrrrrrx, count: 8 +min: 4, max: 12, c: f, password: fffffffffffwqp, count: 11 +min: 4, max: 6, c: q, password: qtqtjq, count: 3 +min: 4, max: 5, c: w, password: wwwcw, count: 4 +min: 2, max: 3, c: r, password: qrrr, count: 3 +min: 7, max: 10, c: k, password: nkpgzskkrb, count: 3 +min: 6, max: 9, c: h, password: hmsshhhwhhhhh, count: 9 +min: 2, max: 18, c: d, password: kxqddddqddsmddcdddwd, count: 12 +min: 6, max: 7, c: s, password: sssssssss, count: 9 +min: 4, max: 8, c: h, password: hhhbthhhhh, count: 8 +min: 1, max: 8, c: d, password: dtsbqtrpwdgfdzrtf, count: 3 +min: 6, max: 7, c: b, password: bbbbbwp, count: 5 +min: 5, max: 6, c: p, password: ppnpqjp, count: 4 +min: 4, max: 13, c: l, password: rtqpmllslrlxcblldqtc, count: 6 +min: 3, max: 4, c: m, password: wmmkcm, count: 3 +min: 4, max: 16, c: b, password: qkbvbvgxtlqbgmwc, count: 3 +min: 4, max: 5, c: h, password: hhhlghh, count: 5 +min: 10, max: 11, c: f, password: fjfffffffgjff, count: 10 +min: 9, max: 12, c: w, password: gwnfvwwrwswnqrvg, count: 5 +min: 4, max: 8, c: k, password: pjkkfkbqqzkmfk, count: 5 +min: 2, max: 8, c: x, password: xwxxxxxcxxx, count: 9 +min: 11, max: 19, c: w, password: wwwwwdjwwwrrwwlvwwww, count: 14 +min: 4, max: 14, c: w, password: rwqhwqwwlhpwfwwpww, count: 9 +min: 7, max: 9, c: j, password: vjjjjqdjjjjjj, count: 10 +min: 15, max: 17, c: x, password: kxrmxjvxxxvxxxzxxxf, count: 11 +min: 3, max: 10, c: p, password: pwpxppzgdrrx, count: 4 +min: 1, max: 5, c: p, password: ppppp, count: 5 +min: 10, max: 19, c: n, password: vfnwnjstnnjnqnngnzs, count: 8 +min: 2, max: 5, c: m, password: phsmq, count: 1 +min: 5, max: 6, c: m, password: mmmmxmm, count: 6 +min: 2, max: 12, c: f, password: tftgcmcblzcljsdlbvf, count: 2 +min: 6, max: 11, c: b, password: hbbbbbbbzhwbtbbhmrb, count: 11 +min: 7, max: 11, c: j, password: jjjjjjvjjjq, count: 9 +min: 3, max: 4, c: d, password: dddgddnmd, count: 6 +min: 11, max: 14, c: f, password: fxfffffftqfflffffpf, count: 14 +min: 14, max: 16, c: x, password: xxxxxcxxxxjgxxvt, count: 11 +min: 6, max: 7, c: h, password: hhhhhht, count: 6 +min: 7, max: 8, c: h, password: hhhhhhzphhhh, count: 10 +min: 5, max: 12, c: w, password: wfwwwjzwmpxwmw, count: 7 +min: 2, max: 7, c: h, password: chcjhhqhdlfshxvhz, count: 6 +min: 7, max: 15, c: h, password: hjhhjvhhhhqmhdhjh, count: 10 +min: 1, max: 2, c: f, password: bvhf, count: 1 +min: 4, max: 6, c: k, password: rkctkkm, count: 3 +min: 5, max: 6, c: n, password: nnnnnn, count: 6 +min: 10, max: 11, c: j, password: jjjjjjjcjjs, count: 9 +min: 4, max: 7, c: b, password: bbgbnkp, count: 3 +min: 2, max: 5, c: d, password: dddddjvddxdk, count: 8 +min: 11, max: 19, c: z, password: svzzgzzmzznzzzkcdzzz, count: 12 +min: 8, max: 9, c: z, password: zzzzzgzmz, count: 7 +min: 4, max: 10, c: v, password: vsvvvvnvsr, count: 6 +min: 5, max: 15, c: v, password: mvqvvkjfvwdvvdl, count: 6 +min: 13, max: 14, c: s, password: ssssssqzszssmk, count: 9 +min: 3, max: 4, c: w, password: wbwg, count: 2 +min: 10, max: 11, c: d, password: kdbdcddqddxdddd, count: 10 +min: 8, max: 9, c: t, password: tttttttntt, count: 9 +min: 2, max: 10, c: m, password: mqmmmmmmmm, count: 9 +min: 3, max: 8, c: c, password: bcswcncchpxcxcrccrx, count: 8 +min: 4, max: 10, c: q, password: qqqplwsfxgq, count: 4 +min: 15, max: 16, c: h, password: hhqhhhhhhvhhhhhthhhh, count: 17 +min: 11, max: 13, c: s, password: sssxssswsswsr, count: 9 +min: 6, max: 7, c: z, password: zzzzhvzz, count: 6 +min: 3, max: 4, c: j, password: ktjdxsjjxjtnq, count: 4 +min: 5, max: 7, c: w, password: wwxwlwwr, count: 5 +min: 2, max: 5, c: l, password: llltll, count: 5 +min: 2, max: 6, c: m, password: qmgvtmtp, count: 2 +min: 11, max: 16, c: v, password: vvvgvvlvhvvvvvvvvvgv, count: 16 +min: 2, max: 4, c: j, password: jsnjf, count: 2 +min: 11, max: 12, c: g, password: gdlcvdgzgqpg, count: 4 +min: 10, max: 12, c: x, password: rxxcxxxxxrrxx, count: 9 +min: 9, max: 12, c: n, password: nnnnnnnncdnn, count: 10 +min: 6, max: 10, c: j, password: vjjjpjhjjs, count: 6 +min: 5, max: 6, c: d, password: dcdddt, count: 4 +min: 3, max: 13, c: c, password: cccccvctcbvcvpcccc, count: 12 +min: 1, max: 7, c: d, password: ndddzzdx, count: 4 +min: 9, max: 10, c: w, password: wwwcwwwwfr, count: 7 +min: 9, max: 18, c: q, password: xjhsjqqrqpgprjmqqq, count: 6 +min: 8, max: 11, c: b, password: bprbbbwkbbbb, count: 8 +min: 4, max: 14, c: w, password: wxcwzsswmsqvfjvjzj, count: 3 +min: 5, max: 6, c: b, password: wbbmzbbm, count: 4 +min: 8, max: 13, c: f, password: lpjfsfswfffgfkff, count: 8 +min: 1, max: 3, c: x, password: vxxx, count: 3 +min: 6, max: 7, c: x, password: btxxxxcx, count: 5 +min: 6, max: 8, c: r, password: mwqrrqrrxr, count: 5 +min: 7, max: 14, c: h, password: hhhhjllhrsxtrhmbbpwh, count: 7 +min: 7, max: 10, c: f, password: phqzgfwfrpffpzq, count: 4 +min: 6, max: 17, c: d, password: ddddddddddddxdbdgdd, count: 16 +min: 5, max: 11, c: f, password: fhfnfflfhjvwvfff, count: 8 +min: 11, max: 12, c: h, password: hhgbtnkhhhhh, count: 7 +min: 2, max: 4, c: f, password: fdfgffr, count: 4 +min: 5, max: 6, c: w, password: wwwwxw, count: 5 +min: 4, max: 9, c: z, password: zbzzzczzv, count: 6 +min: 2, max: 4, c: k, password: jfpkc, count: 1 +min: 3, max: 4, c: r, password: kwgr, count: 1 +min: 4, max: 5, c: k, password: kkkks, count: 4 +min: 5, max: 6, c: r, password: rrrdrsr, count: 5 +min: 5, max: 6, c: t, password: tpwnmttclcrtt, count: 5 +min: 18, max: 19, c: t, password: ttbwxtxgfsphgtzzplbt, count: 5 +min: 1, max: 5, c: w, password: tthwwvw, count: 3 +min: 10, max: 13, c: z, password: mzzzzzwzzzzztz, count: 11 +min: 7, max: 10, c: r, password: rzrjrfpdrrrcmmrr, count: 8 +min: 2, max: 4, c: w, password: wwww, count: 4 +min: 5, max: 9, c: m, password: vksmmzdpsm, count: 3 +min: 1, max: 2, c: q, password: qqqqqqq, count: 7 +min: 1, max: 6, c: c, password: pccccn, count: 4 +min: 3, max: 8, c: r, password: pbchhhrr, count: 2 +min: 3, max: 8, c: v, password: bfdvkvdvglvn, count: 4 +min: 3, max: 6, c: h, password: hhhxhshhl, count: 6 +min: 4, max: 7, c: m, password: mkwpkwmtmm, count: 4 +min: 10, max: 11, c: g, password: ggggmggggcg, count: 9 +min: 1, max: 6, c: j, password: jjjjjw, count: 5 +min: 4, max: 10, c: z, password: zvzzxzzgzzz, count: 8 +min: 7, max: 9, c: k, password: kkkkkkkkjkkkk, count: 12 +min: 4, max: 18, c: f, password: vlnfpdzvbqhvsfmhqtf, count: 3 +min: 8, max: 11, c: s, password: sssssksshsssmhs, count: 11 +min: 2, max: 6, c: b, password: bbbbbm, count: 5 +min: 2, max: 3, c: h, password: hhvrlcf, count: 2 +min: 10, max: 19, c: c, password: mccwczqbjdlgfccnrqc, count: 6 +min: 8, max: 12, c: x, password: rxxxnxtfxcxxxpx, count: 9 +min: 13, max: 14, c: r, password: rrrnrrrrrrrrmrr, count: 13 +min: 4, max: 11, c: h, password: mhzstqhhghhhbhhh, count: 9 +min: 10, max: 11, c: f, password: fffffffffpf, count: 10 +min: 7, max: 8, c: j, password: jjjjjjmv, count: 6 +min: 5, max: 6, c: f, password: fhfffv, count: 4 +min: 3, max: 4, c: z, password: zzxtzq, count: 3 +min: 5, max: 6, c: v, password: jvszvzvvg, count: 4 +min: 9, max: 13, c: v, password: wvvgvdvvvsrjcg, count: 6 +min: 10, max: 11, c: t, password: pcttrntttttdthtxst, count: 10 +min: 1, max: 5, c: v, password: vvvvpv, count: 5 +min: 6, max: 9, c: q, password: qfqqqlqqqqq, count: 9 +min: 4, max: 8, c: f, password: ffffffmfkkfzpffffvff, count: 14 +min: 3, max: 5, c: n, password: lnmnnnnnnnn, count: 9 +min: 1, max: 5, c: k, password: kkwmdkflxtqktmcxdl, count: 4 +min: 1, max: 3, c: z, password: tnqp, count: 0 +min: 15, max: 16, c: h, password: hhhnhhhhfhhhhhjhhh, count: 15 +min: 2, max: 6, c: m, password: mmmxmb, count: 4 +min: 7, max: 12, c: q, password: qqjqhqfqwqcqqkqmql, count: 10 +min: 6, max: 10, c: s, password: ssjvrvsgsshsss, count: 8 +min: 11, max: 15, c: n, password: nnnnnnnnnnrnnnj, count: 13 +min: 14, max: 15, c: x, password: xxxxvxxxxxkxxxzx, count: 13 +min: 9, max: 14, c: b, password: bbbbbbpbbqbblbbbb, count: 14 +min: 4, max: 12, c: h, password: knthjdhlrxtpjwhnhn, count: 4 +min: 8, max: 9, c: v, password: vvvvvvvjjvvvv, count: 11 +min: 2, max: 3, c: d, password: dktdvd, count: 3 +min: 6, max: 8, c: z, password: zzzzzzzx, count: 7 +min: 10, max: 13, c: t, password: jrjfklzstpxwt, count: 2 +min: 4, max: 16, c: n, password: mngnnqnbnnwnqrdgk, count: 7 +min: 3, max: 5, c: v, password: vhqvvn, count: 3 +min: 1, max: 4, c: t, password: jhtq, count: 1 +min: 8, max: 11, c: f, password: qfffffqfffff, count: 10 +min: 14, max: 15, c: x, password: xxxxxxxxxxxxxxx, count: 15 +min: 2, max: 12, c: s, password: scsstsssmcssswgsw, count: 10 +min: 8, max: 13, c: t, password: tttttttqttttt, count: 12 +min: 8, max: 10, c: d, password: ddddddvdfbq, count: 7 +min: 9, max: 15, c: d, password: sdqpqddddjrdjnj, count: 6 +min: 17, max: 19, c: c, password: cccccdldcccpbccxgcc, count: 12 +min: 6, max: 14, c: v, password: lvvvvsvvvvvvvp, count: 11 +min: 16, max: 18, c: p, password: ppppppppppvpppppppt, count: 17 +min: 1, max: 3, c: v, password: vkvtzlvrdcvzplznltqs, count: 4 +min: 8, max: 10, c: s, password: sssssssssns, count: 10 +min: 1, max: 3, c: w, password: wcwfwxnwwp, count: 5 +min: 8, max: 10, c: v, password: kvvvvvvvvvkvvv, count: 12 +min: 7, max: 11, c: s, password: shsssssssns, count: 9 +min: 9, max: 10, c: w, password: wwwwtwwgkwww, count: 9 +min: 1, max: 2, c: x, password: vxxn, count: 2 +min: 4, max: 9, c: g, password: lkgggrcgpg, count: 5 +min: 1, max: 5, c: n, password: fjrnn, count: 2 +min: 4, max: 6, c: x, password: xtxzxxx, count: 5 +min: 18, max: 19, c: z, password: zzzzhvzhzzzzzzzzzsz, count: 15 +min: 15, max: 18, c: p, password: ppppppppppppppsppppp, count: 19 +min: 11, max: 14, c: h, password: rdhhhhhhhghhhrh, count: 11 +min: 3, max: 9, c: v, password: vvvvvvvvqvv, count: 10 +min: 4, max: 8, c: p, password: bbpmjpplp, count: 4 +min: 1, max: 15, c: n, password: qndxnnsmnrnsnnnnn, count: 10 +min: 7, max: 9, c: c, password: cccccctccc, count: 9 +min: 2, max: 6, c: m, password: xwfnmmn, count: 2 +min: 4, max: 16, c: t, password: nbttltzvhqjtcgbtttkt, count: 8 +min: 7, max: 8, c: r, password: rrlrrrrsrbr, count: 8 +min: 3, max: 5, c: h, password: hhghh, count: 4 +min: 3, max: 4, c: m, password: mmmxm, count: 4 +min: 15, max: 16, c: k, password: fckzkjskrkkkdkkl, count: 8 +min: 5, max: 6, c: c, password: cbsxmh, count: 1 +min: 1, max: 6, c: x, password: fxxxxxx, count: 6 +min: 5, max: 12, c: d, password: wdddqrdkwkmdfwd, count: 6 +min: 3, max: 10, c: s, password: smsqncrsjjdmjdlsls, count: 5 +min: 6, max: 7, c: k, password: vkkskkjkwkrkkk, count: 9 +min: 9, max: 17, c: z, password: qwzhqgrnvzzbzlhjz, count: 5 +min: 5, max: 6, c: w, password: dwwwwp, count: 4 +min: 5, max: 8, c: n, password: ncvgqnvn, count: 3 +min: 5, max: 6, c: v, password: vvnvvwvv, count: 6 +min: 3, max: 4, c: x, password: dxxxsbsxx, count: 5 +min: 8, max: 12, c: t, password: ttgtshxfmzlc, count: 3 +min: 10, max: 17, c: x, password: xthkjfxlktkbhdxzx, count: 4 +min: 5, max: 8, c: q, password: qqtqqqkqq, count: 7 +min: 4, max: 10, c: d, password: ndddgxvzswlsgdpnrc, count: 4 +min: 8, max: 11, c: h, password: bgcfhhrkhhb, count: 4 +min: 16, max: 19, c: g, password: qgdmbghrjhgcvgwpggg, count: 7 +min: 3, max: 5, c: s, password: fbsqqszkdkqzw, count: 2 +min: 9, max: 10, c: h, password: hhhhhhhhdhhh, count: 11 +min: 15, max: 17, c: b, password: bbbbbbbbbtbbbbzbbb, count: 16 +min: 11, max: 14, c: q, password: qqqhqqqqqqqqqsq, count: 13 +min: 4, max: 18, c: r, password: rhhrrpghwbqfznflrrr, count: 6 +min: 14, max: 15, c: l, password: lllllllllllllrl, count: 14 +min: 8, max: 14, c: s, password: nsfpsrsssnffssjss, count: 9 +min: 17, max: 18, c: k, password: kkkkkkkkkkklkkkkck, count: 16 +min: 1, max: 12, c: c, password: cmnccccccccktcc, count: 11 +min: 7, max: 14, c: p, password: pppppphppppppp, count: 13 +min: 1, max: 2, c: j, password: jtjq, count: 2 +min: 2, max: 6, c: w, password: wwpxxrwwwdwwh, count: 7 +min: 5, max: 12, c: p, password: zspwppnppdghqplnj, count: 6 +min: 3, max: 5, c: h, password: zhqphfth, count: 3 +min: 1, max: 3, c: q, password: xqqq, count: 3 +min: 4, max: 9, c: r, password: qrzrfgpnbj, count: 2 +min: 7, max: 8, c: q, password: qqqjqqqcqw, count: 7 +min: 4, max: 6, c: m, password: mmmmmwdmm, count: 7 +min: 4, max: 6, c: s, password: sqcssgnsrrddgshvbcs, count: 6 +min: 2, max: 6, c: m, password: mmsgtr, count: 2 +min: 3, max: 9, c: v, password: wvwvvvmvv, count: 6 +min: 3, max: 5, c: j, password: jcjvtgjjjxvjjgjbhj, count: 9 +min: 4, max: 6, c: f, password: qsffzgff, count: 4 +min: 8, max: 9, c: x, password: nxxbxwfrxx, count: 5 +min: 1, max: 7, c: m, password: mvmmmbmmljmg, count: 7 +min: 5, max: 8, c: d, password: pdcdqdddwdl, count: 6 +min: 1, max: 3, c: m, password: mmgns, count: 2 +min: 19, max: 20, c: r, password: rrrrrrrrrrrrrrrrrrxr, count: 19 +min: 1, max: 4, c: h, password: hpghbhkhhr, count: 5 +min: 5, max: 9, c: x, password: xxxxtxxxxxxxxxxx, count: 15 +min: 19, max: 20, c: p, password: qvwdwnssfckjczggpghp, count: 2 +min: 8, max: 12, c: k, password: kkkkkkkfkkkkkkkk, count: 15 +min: 10, max: 12, c: b, password: cbbbbdbbbqbkbb, count: 10 +min: 2, max: 8, c: n, password: nkkpnprnfcnnwsmndqnn, count: 8 +min: 11, max: 12, c: d, password: ddddddvddddvd, count: 11 +min: 4, max: 8, c: j, password: jjjjjjjqjjl, count: 9 +min: 1, max: 3, c: l, password: lvdlslllhllsg, count: 7 +min: 12, max: 15, c: j, password: jzjjjjjkjpjjjjqf, count: 11 +min: 6, max: 9, c: s, password: sssssssssssss, count: 13 +min: 1, max: 2, c: z, password: xzzcnjrzzzzzzz, count: 9 +min: 5, max: 6, c: h, password: hhhhhh, count: 6 +min: 7, max: 13, c: x, password: xxzxvsmxlbxpxz, count: 6 +min: 2, max: 4, c: d, password: dpnddbdfdm, count: 5 +min: 9, max: 16, c: n, password: nnnnnnnnknnnnnnr, count: 14 +min: 4, max: 5, c: n, password: nnnvnn, count: 5 +min: 13, max: 16, c: p, password: vppppppppppppppz, count: 14 +min: 3, max: 6, c: w, password: wwtwww, count: 5 +min: 7, max: 9, c: n, password: nnxnwntnnn, count: 7 +min: 4, max: 12, c: q, password: mqcnsrvqqzgqkwz, count: 4 +min: 3, max: 4, c: t, password: dwtj, count: 1 +min: 9, max: 12, c: r, password: rrrrwrrrrdrcr, count: 10 +min: 8, max: 9, c: w, password: wwtcwwjhwwww, count: 8 +min: 6, max: 8, c: w, password: wwwwwwbgw, count: 7 +min: 5, max: 15, c: f, password: pgflfgfbbvvffkfkmw, count: 6 +min: 10, max: 17, c: s, password: ssssssssshsssfsssss, count: 17 +min: 19, max: 20, c: m, password: mmbmxfmmbzqhmxmxmmmw, count: 10 +min: 11, max: 12, c: d, password: ddddddddddsd, count: 11 +min: 13, max: 14, c: f, password: fffffffffffffdf, count: 14 +min: 1, max: 6, c: n, password: nnnnnnnn, count: 8 +min: 11, max: 19, c: x, password: wmxxbxxkxxxpxxxxxxc, count: 13 +min: 2, max: 3, c: z, password: szgkqvmzwztdcxtvn, count: 3 +min: 16, max: 20, c: z, password: zpzhwdtdzhvgcpdpzzzz, count: 7 +min: 15, max: 19, c: p, password: ppmpcxppppprsgnpppg, count: 11 +min: 4, max: 5, c: x, password: rrxfxxxqx, count: 5 +min: 1, max: 2, c: q, password: rqdwn, count: 1 +min: 4, max: 6, c: x, password: pkfxqxxfxbk, count: 4 +min: 13, max: 17, c: c, password: ccccccccccccncclc, count: 15 +min: 5, max: 7, c: z, password: zzzzvhz, count: 5 +min: 5, max: 6, c: r, password: rrrnrl, count: 4 +min: 2, max: 5, c: g, password: mfgkgxhckg, count: 3 +min: 3, max: 6, c: c, password: cnmcjcccdccccv, count: 9 +min: 7, max: 11, c: t, password: dttttttrttxtt, count: 10 +min: 6, max: 9, c: p, password: ptlfppppcvsp, count: 6 +min: 3, max: 5, c: g, password: ggxkwtj, count: 2 +min: 5, max: 16, c: x, password: phzxlbhqxgxzwjwkkxp, count: 4 +min: 7, max: 8, c: s, password: wsssssmsn, count: 6 +min: 1, max: 7, c: m, password: pmgrmkmmnnm, count: 5 +min: 15, max: 16, c: n, password: nnnnnnnnnvnnnnnln, count: 15 +min: 6, max: 8, c: t, password: ttzttftst, count: 6 +min: 5, max: 7, c: g, password: ggggggggggg, count: 11 +min: 13, max: 16, c: d, password: ddddddddddddpddbdfdd, count: 17 +min: 13, max: 14, c: f, password: jclffflwlffbfvffffbn, count: 10 +min: 3, max: 4, c: j, password: xjzjjjr, count: 4 +min: 8, max: 14, c: n, password: nnnwknndnlnlnn, count: 9 +min: 6, max: 7, c: s, password: sxsssnzs, count: 5 +min: 6, max: 7, c: r, password: rrsprrjrcrb, count: 6 +min: 10, max: 11, c: w, password: qwwcwqzwrbq, count: 4 +min: 7, max: 10, c: b, password: bbbbbbzbbbb, count: 10 +min: 5, max: 6, c: d, password: ddddkd, count: 5 +min: 16, max: 17, c: d, password: ldldddddpdldldddd, count: 12 +min: 5, max: 14, c: w, password: zdtwxnxwhwwpww, count: 6 +min: 6, max: 9, c: q, password: mqqxqsqqq, count: 6 +min: 2, max: 11, c: g, password: gpggzvgggkgmcmt, count: 7 +min: 6, max: 14, c: k, password: kfkkkxkkkkkkkjkk, count: 13 +min: 2, max: 3, c: m, password: zfmm, count: 2 +min: 13, max: 17, c: k, password: kkbkkkkmkktkkkrkk, count: 13 +min: 4, max: 6, c: z, password: tzprqwzzcpj, count: 3 +min: 3, max: 4, c: w, password: gblwcxwllzpv, count: 2 +min: 3, max: 5, c: d, password: ddcddd, count: 5 +min: 9, max: 13, c: r, password: rrfjmrcsrrwvrrk, count: 7 +min: 11, max: 17, c: m, password: dgwrmqjmclmczrlwf, count: 3 +min: 1, max: 4, c: v, password: vvhvvv, count: 5 +min: 10, max: 13, c: c, password: clhccbcvbvcfcccqccc, count: 11 +min: 11, max: 13, c: s, password: sssssssssssss, count: 13 +min: 6, max: 7, c: k, password: skkckkk, count: 5 +min: 2, max: 5, c: m, password: mfffq, count: 1 +min: 3, max: 5, c: x, password: jxbxx, count: 3 +min: 1, max: 2, c: c, password: ctcc, count: 3 +min: 5, max: 8, c: q, password: qqqqgqqqq, count: 8 +min: 11, max: 13, c: q, password: hqqbqqqqqqbqqqqqbk, count: 13 +min: 9, max: 11, c: q, password: qqqqqqqqqql, count: 10 +min: 15, max: 20, c: q, password: qqqqqqqqnqqqqqqqqqqq, count: 19 +min: 5, max: 7, c: g, password: gzngbvggmlzzrgx, count: 5 +min: 2, max: 10, c: n, password: zjknggzlvnxtbwnhmf, count: 3 +min: 2, max: 13, c: c, password: cccccccccccct, count: 12 +min: 4, max: 8, c: c, password: cccccccbcccc, count: 11 +min: 3, max: 5, c: k, password: kdkkz, count: 3 +min: 8, max: 10, c: h, password: nchthhghhjhjh, count: 7 +min: 10, max: 11, c: l, password: wllllllllplxllnjj, count: 11 +min: 14, max: 17, c: q, password: qqhqqqqqqtqvqcqqqrq, count: 14 +min: 5, max: 9, c: d, password: dddddddrz, count: 7 +min: 13, max: 14, c: z, password: zzzzzzzzzzzzzm, count: 13 +min: 7, max: 9, c: t, password: tttttctwlttt, count: 9 +min: 6, max: 13, c: w, password: dwcwdtwrwccwwl, count: 6 +min: 10, max: 11, c: h, password: hhhhhwhhmmhhhh, count: 11 +min: 7, max: 9, c: t, password: tttttjtttt, count: 9 +min: 12, max: 17, c: n, password: nnnnknnfpnnwncnnjn, count: 12 +min: 5, max: 6, c: c, password: zccccc, count: 5 +min: 11, max: 13, c: s, password: ssssksxssssss, count: 11 +min: 9, max: 17, c: q, password: qqqqcfbqrqqcqzqqlqqq, count: 13 +min: 3, max: 4, c: m, password: dmml, count: 2 +min: 4, max: 6, c: v, password: slvvvln, count: 3 +min: 4, max: 5, c: n, password: nnbmnn, count: 4 +min: 2, max: 7, c: h, password: whhhhhjvfhhh, count: 8 +min: 2, max: 5, c: s, password: slhss, count: 3 +min: 4, max: 5, c: q, password: zbhqhqgqdq, count: 4 +min: 2, max: 6, c: p, password: pjtxqp, count: 2 +min: 7, max: 9, c: h, password: hhhhhhkhh, count: 8 +min: 7, max: 8, c: w, password: fgvwcwws, count: 3 +min: 10, max: 13, c: d, password: ddddxhdddddvhdddd, count: 13 +min: 7, max: 16, c: m, password: mmnznmmwmwrmqzrqbmpr, count: 7 +min: 12, max: 13, c: v, password: vvvvvvvvvzvvjv, count: 12 +min: 18, max: 19, c: g, password: mztkzhgmndnffztwqfg, count: 2 +min: 7, max: 8, c: j, password: jjjcjjvjjjjpjjjjjjj, count: 16 +min: 7, max: 10, c: s, password: sssssssssz, count: 9 +min: 18, max: 20, c: s, password: sssssssssssssssssssg, count: 19 +min: 1, max: 4, c: r, password: trrrr, count: 4 +min: 2, max: 16, c: r, password: mrrrrrrhrcrrfcpqrh, count: 10 +min: 5, max: 13, c: n, password: nnbljfchnnnnnj, count: 7 +min: 1, max: 6, c: v, password: vvvvvmvv, count: 7 +min: 7, max: 15, c: q, password: szqhbkqxppcbkxmc, count: 2 +min: 9, max: 10, c: l, password: gllllvllsvll, count: 8 +min: 1, max: 4, c: m, password: mxldw, count: 1 +min: 5, max: 9, c: x, password: xxxxxxxxj, count: 8 +min: 11, max: 16, c: t, password: ttttttttwttttttfl, count: 14 +min: 7, max: 12, c: j, password: sjjzpjjjjljhj, count: 8 +min: 1, max: 5, c: x, password: wmplxj, count: 1 +min: 2, max: 6, c: z, password: zzxzzrzqplrh, count: 5 +min: 4, max: 6, c: w, password: cqbwwbww, count: 4 +min: 14, max: 15, c: l, password: llllltllllllllw, count: 13 +min: 3, max: 4, c: m, password: mhmvvz, count: 2 +min: 3, max: 4, c: w, password: wwmw, count: 3 +min: 1, max: 4, c: c, password: ccchpccc, count: 6 +min: 6, max: 10, c: p, password: pppppppppqprbppppp, count: 15 +min: 9, max: 15, c: h, password: hhhjcrhhhhhhchhjht, count: 12 +min: 8, max: 11, c: g, password: gggggggkggggggggg, count: 16 +min: 4, max: 9, c: h, password: hhkqxhhhlh, count: 6 +min: 7, max: 8, c: f, password: mlfdfrmfbfttmffqfff, count: 9 +min: 7, max: 9, c: t, password: nttttttvsn, count: 6 +min: 6, max: 9, c: h, password: hhhhbhvhph, count: 7 +min: 4, max: 5, c: f, password: hhcdf, count: 1 +min: 3, max: 4, c: k, password: kfxkcr, count: 2 +min: 1, max: 4, c: z, password: zzml, count: 2 +min: 3, max: 5, c: f, password: cjjffbzffqfsbm, count: 5 +min: 4, max: 5, c: f, password: ffdfh, count: 3 +min: 6, max: 17, c: h, password: hhhhhhhhhhhhhhhhrh, count: 17 +min: 8, max: 10, c: d, password: qdddzddddzdd, count: 9 +min: 7, max: 8, c: j, password: nfxxthqj, count: 1 +min: 2, max: 4, c: n, password: nnnc, count: 3 +min: 3, max: 5, c: v, password: vlvzx, count: 2 +min: 6, max: 10, c: n, password: nnnnnnnnns, count: 9 +min: 11, max: 13, c: q, password: bzhwhbvwqffzs, count: 1 +min: 3, max: 6, c: c, password: gccmcc, count: 4 +min: 2, max: 5, c: m, password: xmbgm, count: 2 +min: 2, max: 11, c: g, password: tgztmzzbgjzc, count: 2 +min: 2, max: 5, c: j, password: jsjbj, count: 3 +min: 3, max: 4, c: v, password: vvljvvv, count: 5 +min: 3, max: 6, c: p, password: pxwcnwmp, count: 2 +min: 2, max: 7, c: j, password: ndjnzmjklxqwpkpnwb, count: 2 +min: 1, max: 20, c: s, password: slssswsnssscgbssxsdg, count: 11 +min: 3, max: 4, c: r, password: rrrfjc, count: 3 +min: 5, max: 16, c: t, password: ttntptttsqtttpwtgbt, count: 11 +min: 3, max: 4, c: g, password: fxgg, count: 2 +min: 13, max: 17, c: l, password: llltllllllllvllllvrl, count: 16 +min: 5, max: 8, c: q, password: vxfpqhqd, count: 2 +min: 4, max: 8, c: c, password: cvqcwkccp, count: 4 +min: 5, max: 11, c: x, password: kxqkghvxxdqfwxxkxx, count: 7 +min: 4, max: 5, c: t, password: tttht, count: 4 +min: 8, max: 11, c: n, password: mnnpnnpsnqdknnvsh, count: 7 +min: 1, max: 4, c: g, password: gggngpdggv, count: 6 +min: 5, max: 6, c: s, password: ssssss, count: 6 +min: 4, max: 7, c: d, password: mddfddk, count: 4 +min: 7, max: 8, c: f, password: fffffffb, count: 7 +min: 4, max: 11, c: x, password: cbmcvvvvxgn, count: 1 +min: 14, max: 16, c: d, password: vdddkddpddddllrddddd, count: 14 +min: 8, max: 9, c: h, password: qhhhsnxhjmzhlhdjxhf, count: 7 +min: 5, max: 13, c: f, password: fxfhlqsffxfgwpcz, count: 5 +min: 14, max: 16, c: g, password: jggggnngggngggggjggg, count: 15 +min: 1, max: 5, c: z, password: rzgzt, count: 2 +min: 3, max: 6, c: f, password: fffgrv, count: 3 +min: 3, max: 4, c: w, password: zwwtwdw, count: 4 +min: 9, max: 12, c: g, password: dkmhhvhjgsvqglbrr, count: 2 +min: 4, max: 5, c: g, password: gbrtx, count: 1 +min: 1, max: 5, c: r, password: xrrrr, count: 4 +min: 2, max: 5, c: d, password: ddddddddddddddd, count: 15 +min: 4, max: 5, c: j, password: jjvjz, count: 3 +min: 2, max: 4, c: b, password: blbbbt, count: 4 +min: 16, max: 17, c: b, password: bbbbbbbbbbblbbbzbc, count: 15 +min: 8, max: 13, c: l, password: lljlqlkslqllllll, count: 11 +min: 6, max: 15, c: g, password: wgfgzggggggbtch, count: 8 +min: 4, max: 13, c: w, password: cwvbtpnjdkvww, count: 3 +min: 8, max: 10, c: x, password: xtdxxxxxxhxxx, count: 10 +min: 3, max: 6, c: p, password: pprpppp, count: 6 +min: 15, max: 17, c: p, password: ppppppppppppppkpppp, count: 18 +min: 1, max: 3, c: w, password: wnwpwwbllb, count: 4 +min: 3, max: 5, c: m, password: mxqdq, count: 1 +min: 13, max: 16, c: s, password: hsrsssqssssscgssss, count: 13 +min: 1, max: 2, c: c, password: zccccm, count: 4 +min: 5, max: 8, c: r, password: rrrrkrrm, count: 6 +min: 5, max: 6, c: j, password: njjkjjsj, count: 5 +min: 5, max: 10, c: r, password: rrrrhrrrrr, count: 9 +min: 5, max: 12, c: x, password: xmxwxnmxsldlrpgxxxc, count: 7 +min: 4, max: 6, c: z, password: ztzwfzj, count: 3 +min: 11, max: 15, c: w, password: wwcwwwwwwwzwwww, count: 13 +min: 5, max: 7, c: c, password: cpccccnd, count: 5 +min: 1, max: 16, c: q, password: qqvhqhnpqscqqldqbzh, count: 7 +min: 8, max: 9, c: s, password: kfpdswzssssqssscms, count: 9 +min: 2, max: 16, c: l, password: hppbqldllnlljvflltl, count: 8 +min: 4, max: 12, c: c, password: cccccccccccpccc, count: 14 +min: 5, max: 6, c: r, password: rrrrqb, count: 4 +min: 11, max: 12, c: f, password: ffffdffffmfdkff, count: 11 +min: 5, max: 6, c: k, password: lhkkkf, count: 3 +min: 12, max: 15, c: z, password: bzzzzzzzzstzzzz, count: 12 +min: 5, max: 13, c: c, password: kgsscwsfzcbwchwk, count: 3 +min: 11, max: 18, c: m, password: wmmjbmfpvmmmthfwpsxf, count: 6 +min: 7, max: 14, c: m, password: mmmfmmtqmmmmmmmmrc, count: 13 +min: 14, max: 15, c: g, password: wbqfggngtbqvpqp, count: 3 +min: 10, max: 11, c: k, password: kkkvxktjtkbjkkkk, count: 9 +min: 2, max: 4, c: b, password: wbtkp, count: 1 +min: 4, max: 10, c: v, password: vvvvbffvmtvvz, count: 7 +min: 6, max: 8, c: m, password: vtvgmmbc, count: 2 +min: 1, max: 7, c: d, password: hddsnzd, count: 3 +min: 2, max: 3, c: d, password: rndxchftldndc, count: 3 +min: 2, max: 11, c: z, password: zzcwbxkzzqzzp, count: 6 +min: 5, max: 6, c: q, password: wqqqjq, count: 4 +min: 9, max: 10, c: d, password: ddddddpdcdd, count: 9 +min: 1, max: 12, c: g, password: ggfggggggggbn, count: 10 +min: 4, max: 5, c: v, password: vvvrvv, count: 5 +min: 12, max: 14, c: r, password: rrrrrrrrrrrqrr, count: 13 +min: 6, max: 10, c: s, password: sssshvssss, count: 8 +min: 7, max: 10, c: g, password: gqgzgggksggggdqghs, count: 10 +min: 8, max: 9, c: c, password: ccccccccf, count: 8 +min: 13, max: 18, c: j, password: gfjjjjjjjjgjhwjjch, count: 11 +min: 11, max: 15, c: m, password: mmmmmmmmmmmmmmm, count: 15 +min: 2, max: 4, c: s, password: ssqsr, count: 3 +min: 7, max: 8, c: v, password: vxxvbfdgvvgvtw, count: 5 +min: 2, max: 7, c: x, password: xwxxxxx, count: 6 +min: 3, max: 5, c: p, password: pzppfp, count: 4 +min: 1, max: 2, c: z, password: zfzwpzpxzc, count: 4 +min: 6, max: 7, c: r, password: vrrxrrnrb, count: 5 +min: 3, max: 4, c: f, password: nvftvrjsgxszkfsffg, count: 4 +min: 1, max: 5, c: w, password: kndqwltttskcwtzqt, count: 2 +min: 1, max: 9, c: z, password: zzzzzzzzzz, count: 10 +min: 10, max: 11, c: v, password: vvvvvvvvvvv, count: 11 +min: 1, max: 5, c: m, password: gmjhm, count: 2 +min: 7, max: 11, c: j, password: sdjjpjjjdgnccjjjsq, count: 8 +min: 1, max: 6, c: m, password: rrmcmmmmmbm, count: 7 +min: 1, max: 6, c: n, password: nlclfggwnm, count: 2 +min: 3, max: 7, c: s, password: clfnmssns, count: 3 +min: 3, max: 7, c: m, password: tqjmmmx, count: 3 +min: 13, max: 14, c: n, password: nfnvkntnlnnnxfwlnnnn, count: 11 +min: 3, max: 4, c: p, password: xphp, count: 2 +min: 8, max: 9, c: n, password: nnnlnnnzn, count: 7 +min: 11, max: 12, c: h, password: hhhhhhhdhhhhh, count: 12 +min: 1, max: 4, c: p, password: pjgsphp, count: 3 +min: 3, max: 9, c: f, password: pvfnfmfrcffffjf, count: 8 +min: 15, max: 16, c: d, password: dddddddddzddldgdd, count: 14 +min: 2, max: 4, c: b, password: bvztgnzbpr, count: 2 +min: 3, max: 7, c: w, password: wgwhmpwwwlwzzhwnv, count: 7 +min: 5, max: 9, c: n, password: nmznnvnnsznnw, count: 7 +min: 4, max: 6, c: f, password: zqffsnffdlbkt, count: 4 +min: 6, max: 7, c: s, password: sssssss, count: 7 +min: 2, max: 5, c: q, password: kqlqqmv, count: 3 +min: 11, max: 14, c: q, password: pjqrzjfdgmqzpd, count: 2 +min: 17, max: 18, c: s, password: sssssssssssssssssj, count: 17 +min: 8, max: 12, c: x, password: zxxxpxxxxxxt, count: 9 +min: 2, max: 4, c: h, password: hqhhhwfshp, count: 5 +min: 1, max: 9, c: b, password: qzwgfbzjvt, count: 1 +min: 8, max: 10, c: c, password: cccccccccn, count: 9 +min: 3, max: 5, c: n, password: nnnkwn, count: 4 +min: 4, max: 6, c: m, password: zmmhdzmmx, count: 4 +min: 7, max: 13, c: v, password: vvvvvnvvvvvvsvv, count: 13 +min: 1, max: 12, c: z, password: zzvzxzfzzrzm, count: 7 +min: 6, max: 11, c: p, password: ppppplppppvppppfp, count: 14 +min: 1, max: 5, c: s, password: sjsss, count: 4 +min: 2, max: 19, c: w, password: wwwwwwwwwwwwwwwwwwcw, count: 19 +min: 5, max: 6, c: k, password: zxlkrkbcrcwkdqtkkw, count: 5 +min: 1, max: 4, c: w, password: hjjbzqwnpjrbglkr, count: 1 +min: 8, max: 9, c: n, password: sznnljnqn, count: 4 +min: 7, max: 13, c: k, password: dwkpnjkdkglnm, count: 3 +min: 14, max: 20, c: x, password: xzxrxxsxxxxxxxxxxxjx, count: 16 +min: 4, max: 7, c: w, password: rtrwdvww, count: 3 +min: 14, max: 18, c: m, password: mmmpmmmmmmmmmlmnmq, count: 14 +min: 3, max: 4, c: z, password: zzxz, count: 3 +min: 8, max: 10, c: z, password: zzzzzzzzzjz, count: 10 +min: 11, max: 14, c: v, password: vcvwvxvcslbvvhv, count: 7 +min: 4, max: 8, c: j, password: jgjjbrjhp, count: 4 +min: 5, max: 6, c: d, password: dddddm, count: 5 +min: 4, max: 5, c: n, password: nnnzn, count: 4 +min: 15, max: 16, c: t, password: ttttttttttttttnc, count: 14 +min: 5, max: 8, c: b, password: bbtbspvbbgllcrgxd, count: 5 +min: 8, max: 9, c: w, password: wwwwwwwqw, count: 8 +min: 3, max: 5, c: j, password: vbjmxwjgjfrzttznwc, count: 3 +min: 12, max: 14, c: l, password: llllllllllnglzlwbl, count: 13 +min: 2, max: 4, c: f, password: ntffj, count: 2 +min: 2, max: 4, c: c, password: gvccrcc, count: 4 +min: 19, max: 20, c: w, password: wwwwwwwwwwwwwwwwwwpw, count: 19 +min: 1, max: 3, c: k, password: klwgkc, count: 2 +min: 3, max: 9, c: s, password: qsmlssskpsbsscs, count: 8 +min: 8, max: 9, c: j, password: jjjjjjjdj, count: 8 +min: 5, max: 9, c: s, password: bszlpsssss, count: 6 +min: 13, max: 14, c: l, password: llxllhlllllllllll, count: 15 +min: 1, max: 6, c: s, password: ssssscs, count: 6 +min: 7, max: 8, c: v, password: pbvptdvv, count: 3 +min: 10, max: 15, c: v, password: vvvvvvgvvvvvvvcv, count: 14 +min: 4, max: 5, c: k, password: kkcskfldskdc, count: 4 +min: 13, max: 14, c: v, password: vvvvvvvvvvvvvgv, count: 14 +min: 3, max: 7, c: n, password: hnjnnnnnsnfp, count: 7 +min: 3, max: 8, c: m, password: mtmjhrzzllqml, count: 3 +min: 9, max: 11, c: w, password: wwwwwwwwwwxw, count: 11 +min: 10, max: 20, c: g, password: pkvgkfvmxgkpjjhtqvcg, count: 3 +min: 8, max: 11, c: w, password: wwwwwwzwwwdw, count: 10 +min: 5, max: 7, c: r, password: rrrrrrb, count: 6 +min: 2, max: 7, c: b, password: sbldlwvcb, count: 2 +min: 10, max: 17, c: v, password: vvvvvvqgcvvkdvsvvjv, count: 12 +min: 4, max: 5, c: d, password: tkddnddzqpdfdddd, count: 9 +min: 10, max: 12, c: p, password: npppppppppfm, count: 9 +min: 1, max: 12, c: t, password: wttttttttttttt, count: 13 +min: 4, max: 5, c: f, password: qfffz, count: 3 +min: 11, max: 14, c: p, password: ppppppppppppgvpcp, count: 14 +min: 6, max: 8, c: w, password: qswwwrwwmww, count: 7 +min: 9, max: 15, c: g, password: txgchzlpgggdhgggbg, count: 8 +min: 2, max: 10, c: h, password: hthhzhhhshhh, count: 9 +min: 5, max: 8, c: l, password: lllllzkk, count: 5 +min: 17, max: 18, c: l, password: nlllllllllllllllvll, count: 17 +min: 3, max: 6, c: c, password: zdwcjcccdqct, count: 5 +min: 8, max: 17, c: m, password: mmmmmmmmmmmmmmmmjm, count: 17 +min: 10, max: 12, c: c, password: ccccncrccccb, count: 9 +min: 4, max: 12, c: j, password: jjjbjjjjjjnwjj, count: 11 +min: 2, max: 6, c: h, password: chbhhfc, count: 3 +min: 5, max: 6, c: c, password: cccpncc, count: 5 +min: 6, max: 7, c: m, password: dmwmkmphmmdmm, count: 7 +min: 6, max: 7, c: k, password: rxwkmkv, count: 2 +min: 1, max: 5, c: f, password: fzgfl, count: 2 +min: 4, max: 7, c: x, password: dxkmxhb, count: 2 +min: 1, max: 5, c: f, password: hhfzfpfffffsff, count: 9 +min: 1, max: 7, c: s, password: sssslsvv, count: 5 +min: 3, max: 7, c: w, password: wgwwwsh, count: 4 +min: 12, max: 15, c: d, password: mdsdbkltdvthvfjdddn, count: 6 +min: 16, max: 18, c: x, password: xxxxxxxxxxxxxxxxtl, count: 16 +min: 5, max: 19, c: x, password: xwxxxxxxxxxxxxxxbpn, count: 15 +min: 3, max: 5, c: h, password: hhrfh, count: 3 +min: 8, max: 10, c: g, password: ggggggggggkgg, count: 12 +min: 3, max: 8, c: c, password: cccccccmc, count: 8 +min: 5, max: 7, c: r, password: wrrrxrrr, count: 6 +min: 7, max: 8, c: p, password: phpprdslbpxprpg, count: 6 +min: 17, max: 19, c: z, password: zzzzvzzzzzdzzzzzzzg, count: 16 +min: 2, max: 4, c: x, password: kxxxxxm, count: 5 +min: 2, max: 11, c: w, password: gwwzpwwwwwplrqfh, count: 7 +min: 6, max: 9, c: t, password: qtcttttgf, count: 5 +min: 9, max: 12, c: g, password: gggggggggggsg, count: 12 +min: 3, max: 6, c: n, password: fzmnxb, count: 1 +min: 5, max: 9, c: x, password: pqxxxwdtn, count: 3 +min: 5, max: 6, c: j, password: jjjjjkq, count: 5 +min: 10, max: 12, c: h, password: hhhhhdhhhzhh, count: 10 +min: 1, max: 4, c: g, password: gskgk, count: 2 +min: 3, max: 5, c: c, password: ccccj, count: 4 +min: 1, max: 10, c: m, password: wmxsgmzmrzmrmmmjmmct, count: 9 +min: 5, max: 10, c: p, password: lmpppvptdgpjpwfwpp, count: 8 +min: 2, max: 4, c: z, password: bzgm, count: 1 +min: 6, max: 7, c: d, password: ddzdddj, count: 5 +min: 3, max: 7, c: r, password: gchrfwr, count: 2 +min: 4, max: 7, c: k, password: kkcvkkkkkk, count: 8 +min: 8, max: 12, c: t, password: tpwtttctvtttftpt, count: 10 +min: 11, max: 12, c: c, password: ccccccxcdncbwcc, count: 10 +min: 2, max: 10, c: p, password: jwwxlppppppnpn, count: 7 +min: 9, max: 16, c: w, password: chmwwwwwjwrwjwzjww, count: 10 +min: 1, max: 6, c: j, password: jkqjjbj, count: 4 +min: 5, max: 8, c: k, password: kkkkkklhkk, count: 8 +min: 3, max: 5, c: q, password: qqqqc, count: 4 +min: 16, max: 17, c: x, password: xxxxxxxxxxxxxxxtg, count: 15 +min: 4, max: 9, c: f, password: fmfkcfffffkcfmfhnzf, count: 10 +min: 5, max: 6, c: z, password: zhzzlz, count: 4 +min: 4, max: 17, c: k, password: kbwmwvkkvvhxkkkckqvk, count: 8 +min: 3, max: 5, c: d, password: dddmmdt, count: 4 +min: 4, max: 10, c: m, password: mmmmmmmmms, count: 9 +min: 5, max: 6, c: g, password: ghgggpj, count: 4 +min: 1, max: 5, c: c, password: cccck, count: 4 +min: 3, max: 7, c: z, password: zzjzzzzz, count: 7 +min: 2, max: 7, c: v, password: xrprnvvtsrgsk, count: 2 +min: 1, max: 5, c: s, password: sqqsn, count: 2 +min: 3, max: 5, c: j, password: xwpnj, count: 1 +min: 5, max: 7, c: v, password: vvvvvvqmv, count: 7 +min: 4, max: 5, c: j, password: jjjjzjjjjljjc, count: 10 +min: 2, max: 4, c: h, password: hghh, count: 3 +min: 3, max: 5, c: n, password: fnnpc, count: 2 +min: 16, max: 20, c: d, password: dddddddzdddddddpdddd, count: 18 +min: 3, max: 4, c: t, password: tnpt, count: 2 +min: 2, max: 7, c: f, password: fxffffkff, count: 7 +min: 6, max: 9, c: b, password: bbbhbbwhbbrblmtb, count: 9 +min: 7, max: 10, c: m, password: msmxmrnmrmmmm, count: 8 +min: 3, max: 4, c: r, password: rrzrr, count: 4 +min: 7, max: 8, c: m, password: mgmmmmjmm, count: 7 +min: 2, max: 3, c: l, password: lmll, count: 3 +min: 2, max: 6, c: h, password: cngphhhbfpvvsgrqhhzq, count: 5 +min: 6, max: 8, c: d, password: dddddddg, count: 7 +min: 12, max: 15, c: p, password: vfjxwpcpdvpnjwp, count: 4 +min: 12, max: 17, c: m, password: mzfmmsvfxmqsmcfjmwjb, count: 6 +min: 15, max: 19, c: b, password: bbbbbfbbbbbsbbmbbbbb, count: 17 +min: 7, max: 8, c: n, password: qdnjnnnpvmfnn, count: 6 +min: 6, max: 8, c: l, password: llllllll, count: 8 +min: 3, max: 4, c: n, password: nnbdh, count: 2 +min: 11, max: 12, c: w, password: hprdhfrpvcwbgwjcw, count: 3 +min: 2, max: 7, c: r, password: jrfrbjrhrw, count: 4 +min: 1, max: 6, c: v, password: fvzknvvv, count: 4 +min: 10, max: 11, c: t, password: tttstdhttqrttt, count: 9 +min: 5, max: 14, c: f, password: fxffnffffnfffff, count: 12 +min: 10, max: 13, c: q, password: qqqqqqqqqjqqqqq, count: 14 +min: 1, max: 5, c: v, password: tnvfvxvjvbvjk, count: 5 +min: 4, max: 5, c: c, password: ccccpc, count: 5 +min: 4, max: 6, c: t, password: tttttktttt, count: 9 +min: 1, max: 2, c: r, password: rwrsq, count: 2 +min: 11, max: 12, c: c, password: cccggjcccccr, count: 8 +min: 11, max: 16, c: g, password: gwggggggggqggbgggfg, count: 15 +min: 12, max: 14, c: b, password: bbggzhxsjjsbsf, count: 3 +min: 5, max: 7, c: r, password: kjdwpfbmcptrslrrr, count: 4 +min: 1, max: 2, c: l, password: lvbl, count: 2 +min: 6, max: 11, c: c, password: hsksgzhccbccbdfnzqcv, count: 5 +min: 6, max: 7, c: m, password: gmmmmmc, count: 5 +min: 1, max: 2, c: h, password: hhhh, count: 4 +min: 1, max: 3, c: g, password: rggg, count: 3 +min: 4, max: 8, c: z, password: rzzzzfbwzxkzzz, count: 8 +min: 3, max: 6, c: w, password: wwwwww, count: 6 +min: 3, max: 4, c: g, password: ggwtg, count: 3 +min: 9, max: 11, c: v, password: wxfltmvjvjm, count: 2 +min: 2, max: 4, c: l, password: llck, count: 2 +min: 2, max: 3, c: m, password: mmkgpdwzdm, count: 3 +min: 2, max: 5, c: d, password: bdjhdhjldzh, count: 3 +min: 10, max: 12, c: j, password: jnjlmjjjjpcdkjjjx, count: 9 +min: 3, max: 9, c: q, password: qqzqqqqqqqqqq, count: 12 +min: 4, max: 8, c: d, password: ddzwdpddd, count: 6 +min: 3, max: 7, c: m, password: mzmbsmcjgmpmmdkmr, count: 7 +min: 8, max: 13, c: q, password: xrxvgqdvvmjhhgdfz, count: 1 +min: 3, max: 12, c: z, password: zzjzzzzzzzzzzz, count: 13 +min: 5, max: 10, c: k, password: jkkkmkkkmkk, count: 8 +min: 6, max: 7, c: m, password: mmllmmtm, count: 5 +min: 17, max: 19, c: c, password: ccccccccccccccnckccc, count: 18 +min: 6, max: 9, c: w, password: wwwtbrwwwxww, count: 8 +min: 7, max: 9, c: d, password: wfdkwddsdsmdbswv, count: 5 +min: 11, max: 12, c: g, password: ggggggggggbgg, count: 12 +min: 13, max: 14, c: j, password: prjjdjjjjjjjcjjj, count: 12 +min: 3, max: 5, c: j, password: jjlljv, count: 3 +min: 3, max: 4, c: h, password: hrlh, count: 2 +min: 6, max: 7, c: l, password: hplnxlsjnwxzllllljcj, count: 7 +min: 4, max: 5, c: g, password: gfgml, count: 2 +min: 4, max: 5, c: z, password: zwkznzn, count: 3 +min: 4, max: 11, c: n, password: stnzhznnfnqcnn, count: 6 +min: 2, max: 5, c: h, password: hmzhh, count: 3 +min: 4, max: 6, c: w, password: wwbwwc, count: 4 +min: 4, max: 11, c: w, password: vmwwrxpkwcp, count: 3 +min: 4, max: 8, c: t, password: thxttstmtbstcvjtlflh, count: 7 +min: 6, max: 8, c: v, password: hvvkvvhfm, count: 4 +min: 16, max: 18, c: b, password: tbbbbbbbbbbbbbbbbr, count: 16 +min: 8, max: 10, c: f, password: fffffffcfl, count: 8 +min: 13, max: 15, c: r, password: rrrdrrrrrrrrrbr, count: 13 +min: 8, max: 14, c: t, password: ztstxttttttttwz, count: 10 +min: 8, max: 12, c: j, password: jgjjjjgjjjjx, count: 9 +min: 5, max: 6, c: m, password: nmqjdmgfqqmcmmvndztl, count: 5 +min: 2, max: 6, c: v, password: vwvvvvtv, count: 6 +min: 15, max: 16, c: l, password: llllllllllllllll, count: 16 +min: 3, max: 10, c: q, password: qqqqqqqqqxqq, count: 11 +min: 8, max: 9, c: j, password: rggxhvjjjk, count: 3 +min: 1, max: 3, c: p, password: pqhp, count: 2 +min: 4, max: 11, c: z, password: nkjddzczjrzktvnckmg, count: 3 +min: 5, max: 12, c: r, password: tfrdrswgwnbc, count: 2 +min: 8, max: 13, c: r, password: rrrrrrrrrrrrrr, count: 14 +min: 13, max: 18, c: x, password: xxmxvxxxxxxxhrxxxc, count: 13 +min: 7, max: 8, c: z, password: zzkzzzzw, count: 6 +min: 4, max: 8, c: m, password: mmmqmmskqlmmgm, count: 8 +min: 1, max: 3, c: w, password: bmwg, count: 1 +min: 1, max: 4, c: z, password: vzzzzzwz, count: 6 +min: 3, max: 4, c: d, password: dqdw, count: 2 +min: 2, max: 9, c: z, password: hzhqpndtllsw, count: 1 +min: 10, max: 13, c: t, password: tttttttttttbjb, count: 11 +min: 12, max: 14, c: r, password: rrrxrrsrrrgfrrr, count: 11 +min: 12, max: 19, c: g, password: hdxnlgglxwrgzkggcwp, count: 5 +min: 3, max: 4, c: x, password: qxjx, count: 2 +min: 1, max: 2, c: r, password: rrpdlqhcnwwr, count: 3 +min: 5, max: 11, c: c, password: vdbzvccdccldsjcq, count: 5 +min: 4, max: 6, c: k, password: kxkwkk, count: 4 +min: 16, max: 18, c: k, password: kkkknkkkkkkkfkkkkx, count: 15 +min: 1, max: 2, c: q, password: tqtghddbk, count: 1 +min: 7, max: 8, c: g, password: ggcgggvgg, count: 7 +min: 13, max: 19, c: d, password: ddddddfjdddddfddddd, count: 16 +min: 9, max: 15, c: z, password: pzhzzzzzqpzzzzzz, count: 12 +min: 4, max: 5, c: l, password: lclld, count: 3 +min: 2, max: 15, c: r, password: jrrmtzrxlczbttrcvkn, count: 4 +min: 3, max: 5, c: z, password: zzzzc, count: 4 +min: 15, max: 16, c: k, password: kkkckkdjnkkkkkkkkk, count: 14 +min: 11, max: 13, c: m, password: mmmmmmmmwmmmzm, count: 12 +min: 8, max: 13, c: p, password: ppdpptppdppxkppppppp, count: 15 +min: 1, max: 3, c: g, password: gszcmgjg, count: 3 +min: 5, max: 11, c: h, password: skbchhdbnphpbfl, count: 3 +min: 4, max: 7, c: d, password: prdjctk, count: 1 +min: 15, max: 18, c: f, password: ffcffffffffffzdffc, count: 14 +min: 7, max: 11, c: g, password: npggtwgzgtgzhx, count: 5 +min: 12, max: 14, c: m, password: mmmmmmmmmmmpmkm, count: 13 +min: 10, max: 11, c: b, password: bbbbbbbbbbb, count: 11 +min: 3, max: 16, c: k, password: kgxtvmlgpkptpghkb, count: 3 +min: 4, max: 6, c: m, password: zcwmzmvqvgmmsxj, count: 4 +min: 6, max: 15, c: m, password: mzmmccmmlmmrmlnl, count: 8 +min: 12, max: 13, c: x, password: xxxxxxxxwxxxz, count: 11 +min: 4, max: 5, c: d, password: mhvdtxfklzdpgdqdpqhd, count: 5 +min: 5, max: 10, c: g, password: nghgggggggqg, count: 9 +min: 7, max: 9, c: k, password: kkkkfkkkwk, count: 8 +min: 6, max: 7, c: c, password: cvcvczncn, count: 4 +min: 10, max: 11, c: t, password: tttqttttttv, count: 9 +min: 18, max: 20, c: h, password: hfsqhkwfhttgfhmbghhx, count: 6 +min: 6, max: 7, c: v, password: vgvvvwz, count: 4 +min: 3, max: 4, c: z, password: zzzj, count: 3 +min: 3, max: 5, c: d, password: dhqjnhgldtdzx, count: 3 +min: 3, max: 4, c: b, password: jbrbbbbbbbblwb, count: 10 +min: 12, max: 15, c: g, password: gsgfdfksrggqvgggjgt, count: 8 +min: 6, max: 11, c: p, password: pmppnpqpdppdpppphpf, count: 12 +min: 13, max: 14, c: z, password: zzzzgzbzzzzzgzz, count: 12 +min: 4, max: 12, c: c, password: ccjcrvcnwccwctcczcp, count: 10 +min: 10, max: 11, c: c, password: szcccfccfpcchqs, count: 7 +min: 10, max: 14, c: l, password: lllllltgjlnlbprlll, count: 11 +min: 12, max: 17, c: z, password: zhzzzxzpzzzfzzzqznz, count: 13 +min: 12, max: 15, c: l, password: llllllllmvlvllfll, count: 13 +min: 7, max: 12, c: c, password: ccccccncccccc, count: 12 +min: 1, max: 5, c: m, password: mhmmzmm, count: 5 +min: 11, max: 17, c: r, password: rrzrrwrrsrcrsmdrvrr, count: 11 +min: 4, max: 5, c: w, password: fwwpwfw, count: 4 +min: 7, max: 8, c: n, password: nnnnnnnk, count: 7 +min: 3, max: 18, c: n, password: rxhzsscgbnmzpvbqmzf, count: 1 +min: 4, max: 11, c: k, password: kkkkkkkkkkkxkkskkkdz, count: 16 +min: 10, max: 11, c: c, password: cccccccccckcccccc, count: 16 +min: 8, max: 15, c: r, password: zrrtfrjrrrrrjrrrrrr, count: 14 +min: 15, max: 16, c: h, password: ghgvlhwgqslhhhhxmp, count: 6 +min: 3, max: 5, c: f, password: ffffqf, count: 5 +min: 3, max: 8, c: s, password: bssmfsgspxssgjhsjdv, count: 7 +min: 3, max: 5, c: q, password: bfdhq, count: 1 +min: 4, max: 7, c: k, password: qknkkkd, count: 4 +min: 6, max: 9, c: b, password: bbbtbnfbbb, count: 7 +min: 12, max: 14, c: x, password: xxxxxxxqxkxvxxwxxcw, count: 13 +min: 3, max: 6, c: c, password: chfckc, count: 3 +min: 3, max: 8, c: h, password: kzkhgrffz, count: 1 +min: 10, max: 16, c: f, password: fffgjfffsvffdzfhfzff, count: 12 +min: 1, max: 3, c: r, password: rgcr, count: 2 +min: 16, max: 17, c: x, password: xxxxxdxxxxxxxxxxl, count: 15 +min: 6, max: 11, c: j, password: rsjcjjcbpchkvfjpml, count: 4 +min: 9, max: 10, c: s, password: sssqvsssjsss, count: 9 +min: 17, max: 18, c: v, password: vvvvvvvvvvvvvvvvvv, count: 18 +min: 3, max: 5, c: t, password: jtmtgtxxhzskzk, count: 3 +min: 1, max: 6, c: t, password: ttqkvdgs, count: 2 +min: 13, max: 16, c: q, password: qqqqqqhqqqqqzqqjqq, count: 15 +min: 10, max: 11, c: b, password: bbbbbvbbbbw, count: 9 +min: 6, max: 7, c: w, password: sgwmqwgwtbrllf, count: 3 +min: 10, max: 11, c: f, password: ffffffftffff, count: 11 +min: 12, max: 13, c: w, password: wwwwwwwwwwwzt, count: 11 +min: 18, max: 19, c: t, password: ttttttttttttttttttt, count: 19 +min: 1, max: 5, c: h, password: zghhr, count: 2 +min: 1, max: 2, c: v, password: dvjnctwvlp, count: 2 +min: 1, max: 2, c: j, password: jhzkzjh, count: 2 +min: 3, max: 6, c: h, password: rhhbhhh, count: 5 +min: 2, max: 4, c: d, password: dddrd, count: 4 +min: 17, max: 18, c: s, password: ssssssssssssssssns, count: 17 +min: 1, max: 8, c: m, password: smmmmmmmm, count: 8 +min: 2, max: 4, c: s, password: dcfsbzwqq, count: 1 +min: 11, max: 12, c: d, password: vnldqthkptgkkfdmtw, count: 2 +min: 8, max: 12, c: p, password: vpppzpprppppp, count: 10 +min: 6, max: 8, c: q, password: jqqqsphqjwrqj, count: 5 +min: 8, max: 10, c: k, password: ktkkkkdkkkk, count: 9 +min: 4, max: 12, c: v, password: nvvwvvvjzvvvv, count: 9 +min: 5, max: 6, c: z, password: zzzzzt, count: 5 +min: 1, max: 5, c: w, password: xwwwwwwww, count: 8 +min: 11, max: 14, c: p, password: pppfbpppkpftdpkpgpp, count: 11 +min: 2, max: 3, c: v, password: zrlv, count: 1 +min: 2, max: 4, c: f, password: fbwff, count: 3 +min: 5, max: 6, c: s, password: ssssmn, count: 4 +min: 11, max: 12, c: z, password: zzwztpzpjzhz, count: 6 +min: 5, max: 6, c: c, password: cccjcc, count: 5 +min: 4, max: 6, c: v, password: vvvgpvcpwv, count: 5 +min: 5, max: 6, c: j, password: jnzcpjnzjjcpsjfps, count: 5 +min: 12, max: 14, c: m, password: tpzwjjgpbbdmgxgphd, count: 1 +min: 13, max: 15, c: n, password: nznnnncnnnnnnnf, count: 12 +min: 8, max: 11, c: w, password: qsxwnlhwwxw, count: 4 +min: 6, max: 9, c: t, password: ltbdttnst, count: 4 +min: 10, max: 12, c: t, password: hnjdfgrhtgkl, count: 1 +min: 2, max: 4, c: d, password: dbddddc, count: 5 +min: 13, max: 14, c: g, password: gggggggbgggmgmgm, count: 12 +min: 4, max: 12, c: r, password: rrrzrgkrrrrkr, count: 9 +min: 14, max: 17, c: n, password: nnhnnnnnnnnnnnnnhnn, count: 17 +628 From 10fb8fbe75b993ab5fb6d166ca73cef51b78d245 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Wed, 2 Dec 2020 22:03:52 -0800 Subject: [PATCH 07/52] Completed day 3 --- 2020/Makefile | 3 + 2020/day3.cpp | 68 ++++++++++ 2020/day3.input | 323 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 394 insertions(+) create mode 100644 2020/day3.cpp create mode 100644 2020/day3.input diff --git a/2020/Makefile b/2020/Makefile index 89345cb..4ee74ce 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -4,6 +4,9 @@ day1.out: out/types.o day1.cpp day1.input day2.out: out/types.o day2.cpp day2.input g++ $(flags) day2.cpp out/types.o -o $@ +day3.out: out/types.o day3.cpp day3.input + g++ $(flags) day3.cpp out/types.o -o $@ + out/types.o: types.hpp types.cpp mkdir -p out/ g++ $(flags) -c types.cpp -o $@ diff --git a/2020/day3.cpp b/2020/day3.cpp new file mode 100644 index 0000000..4c6268b --- /dev/null +++ b/2020/day3.cpp @@ -0,0 +1,68 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +auto read_field_and_count_trees(std::vector & trees, usize horizontal_increment, usize vertical_increment) -> u64 { + auto tree_count = u64(0); + + auto x_index = usize(-horizontal_increment); + auto y_index = usize(-1); + auto line = std::string(); + auto file = std::ifstream("day3.input"); + + while (getline(file, line)) { + auto vertical_check = (++y_index % vertical_increment == 0); + tree_count += vertical_check * (line[(x_index += (vertical_check * horizontal_increment)) % line.size()] == '#'); + } + + return tree_count; +} + +auto main(i32 argc, char ** argv) -> i32 { + auto trees = std::vector(); + auto tree_counts = std::vector(); + + tree_counts.push_back(read_field_and_count_trees(trees, 3, 1)); + std::cout << tree_counts[0] << std::endl; + + tree_counts.push_back(read_field_and_count_trees(trees, 1, 1)); + tree_counts.push_back(read_field_and_count_trees(trees, 5, 1)); + tree_counts.push_back(read_field_and_count_trees(trees, 7, 1)); + tree_counts.push_back(read_field_and_count_trees(trees, 1, 2)); + auto tree_count_product = u64(1); + for (auto tree_count : tree_counts) { + tree_count_product *= tree_count; + } + std::cout << tree_count_product << std::endl; + + return 0; +} diff --git a/2020/day3.input b/2020/day3.input new file mode 100644 index 0000000..6727b2a --- /dev/null +++ b/2020/day3.input @@ -0,0 +1,323 @@ +.....#............#....#####.## +.#.#....#......#....##......... +......#.#.#.....###.#.#........ +......#...#.....#####....#..##. +...#............##...###.##.... +#.....#...#....#......##....##. +#...#.#....#..#..##.##...#..... +.......#..........#..#..#.#.... +.#.....#.#.......#..#...#....#. +#..#.##.#..................###. +...#.#.##...##.###.....#..#...# +..#.#...#............#.......#. +#..#.#..#.#....#...#.#.....#..# +#......##....#..#.#.#........#. +....#..#.#.#.##............#..# +....#..#..#...#.#.##......#...# +##...#...........#.....###.#... +..#...#.#...#.#.....#....##.##. +....##...##.#....#.....#.##.... +#........##......#......#.#.#.# +....#.#.#.........##......#.... +.#......#...#.....##..#....#..# +....#..#.#.....#..........#..#. +..##...#..##................#.# +.....#....#.#..#......#........ +........#..#.#......#.#........ +.....#.#....##.###....#...#.... +...##.#.......#....###..#...... +............##.#..#...#........ +#..###..#.....#.####........... +.......##.....#......#......#.. +#........##..#.....##.......#.# +#.##...#...#...#......##..#.#.# +......#....##.#.#...#...##....# +#..#....##.#......#.......##... +.#..........#..........#....#.# +#.....##......##....#.......... +..#.#.....#.#...#........#..... +...#........#..#..#.##..##..... +......###.....#..#...#.###...## +.##.##.......#.......###...#... +#.#..#.#.#....#.....###..#...## +......#.##..........#.......##. +#..#.#.........#.....##...##... +..#...#....#....###.#......#... +.....#..#.######.....#..#.#.... +..#.#.....#.....##.#....##.#.## +...#.#.#....#....##..#..#.#.##. +...........#.#...#..#..####.... +.........#####.#.#.#...#.##.#.. +.......#...#......#.##.#.##.... +....#.....#.....###..........#. +.#.###....##.#..#..........#... +#...#.........##.....####....#. +##....##...#..........#........ +...#.#.#.#....#..........#..... +.......#....#......##.......#.. +.#.#..#.........#.#.##....#.... +..#.............#..##.#.##..### +.#.##..............#..#..##..#. +..##.#..#......#...##..#.##...# +......#..#....#....#....##..#.. +...#...##.............#..###... +...##....#.#.##........#.....## +....#.#.......#..###..#....#### +#...#...##..#.####..#...##....# +.......#..#.##..#...#.#........ +###.#......#..##..#......#.##.. +#....#............#.....#...... +..##...#..##......#..#....#.... +.#..##...#....#.#...#...#..#..# +........#....###...#..##..###.# +.........#....#....#..#.#.#...# +.#....###.##...#.#...........## +..#..#.#..#.#.##..#...##....... +##..#.#.#....#...#..#.......... +#..#.......#....#..##...####... +............#.#..........##.##. +#...#..#.#....#..#.#....##..... +......#...#...#.##............# +#.....##..###..#.#..#.#.##..#.# +#..#.#..#......#.......##.#.... +##..#.#..#...#......#.##...###. +.#....#..............#....#.#.. +..#.#..##....#....#..##........ +.#.#...#..#.....#.#..##........ +.....#..#.#......#....#.#..#.#. +....#.###...###.#.#.....#...... +...........#.#....##....##..... +..#..#.##..........#...#...#..# +.....#.###.#..........#........ +....#....##........###...#..... +.#.....##.......#....#..##..### +#.....#...............##......# +#..#.#..#.#.#.....#.#...#...... +.##.###...#....#..........##... +.#.......#..................... +.#.#....#...##..#...#...##..... +.#.#...#.......#.......#...#... +....#.#..#.#..#...#....##...... +....##.....#.##....#.##..##..## +..#............#...###.##..#... +.#..#.........#.##....#....#..# +.#..##..#..#........#.#.##.#.## +.###.#...#...............#...#. +...#.##.##.#......#...#....##.# +#......##.......##...###....#.# +#..##.....##......#.#.##....#.# +...#.#....#.#.#...........##..# +#.....##......##.#..........##. +###....#.#...#.#..####......... +.##.#.#...##..#.....#..#...#... +#.....#.#......#..........#.#.. +..###.##.#...................#. +#.............#..#........#.##. +#.#.#.#..#.....##..##.#....#... +...#...#..#...#..##..##........ +...##...##..#...##...........#. +.####..#.#.#.##.#.......#...... +...#....#.......#......#....... +.....#.#...#...#..##..#..#..... +......#.....###.#..#..#.#..###. +.#....#....#..#..##.....##...#. +.#.............##.###.#...#.#.. +#..#..#......#.###............# +##.#..##....#..........#.#.#... +......#........#...#.......##.. +....#.#..#..........#.....#.#.. +...#..#...#.#...#........#..... +.....##...#....#.........##.##. +....#...#...#.##.##...#....#... +.#..#.....##......#..#.#..#.... +........##...##.##......#.#.#.# +.................#..#.....##.#. +...#.....#...#.........#..#.#.# +....##.#.....#........#...#..#. +#...............#..#.....#...#. +.....#..#....#...#.####.#.#.... +####.#..#.##...#....#...##..... +#...##..#...####..#....#.#...#. +..#.......#.##..##...#.#....... +...........##.......#....#..#.. +#.##....#...#.....#....##...... +....##.#.......#..#...##....... +...#.........##.#..#......#.### +.#..#..#....#.#.##....###..###. +....#.#........##........##.... +....########....#.#.#.###.#...# +...#.###.###.##......##.......# +.#...#.###.......#..........#.. +..#..##.........#............#. +.......##.#...#...##...#...#..# +#.##....#.#...#.....#..#.#..... +..#........#..#.#.#.#....#.##.. +...#...#.#.........#...#.#..##. +#....#......#.#...........#..## +...#.#.#..#...##...#...#...#... +###..........#.#..........#.... +..#....#.#.#.#............#.#.. +....#...#..###...#.#....#...... +#...........####......##.#..... +..#..##.#...#.....#..#.......## +#.....#..###.....#...##..##.... +##..###..##...........#.#...#.. +.....#......#..............#... +#..#.##.###.......#.......#...# +#........#....##......#.#...... +.#.#.#...#.......#........#.##. +#..#..##.....#...#.#.#.#..###.. +.#.#....#..#..#.#....##.#.#.... +..#.#.........####.#...#.#.###. +....##........##....#........#. +................#..........#... +..#...................###.##..# +.........#..#..#.#...#....#.#.# +......#.....###.....#.#..#...#. +.#.#.....#..##............##... +...##......##.#....#........... +...##..##..###.#...##.......... +....###...#..#.#......#......#. +....##..............#..#..#.#.. +####.......#...##.##..#.#...... +.#......#.....#....###..#....#. +.#.......#...##...#..##.#...... +#.......#.......#.#....#.#.#..# +........#..#..#............##.# +#.#...#.#..##..#.......##..#... +...#....#...#..........##..#... +#.#...#.##....###......##....#. +#..#...###........#..#....#..#. +#....#....###....#..#.......#.. +....#.#........#.............#. +.#.##........##...#...#...#...# +#.....##.....#.......#.#.#..... +.#.##..........##..#....#...... +.#..##.##.#...##....#.#....##.. +........#.#.##.#....#.#..#....# +..#...........................# +.#...........#....#....#.#..#.. +........##...........#...#...#. +..#.....#..#......#..##.......# +..#....###..###...#.#.#..#....# +#..#.#...#......##......#...... +...........#...##..##....##.... +#.#......###..#.....#.......#.# +#.....#....#....#.#...#...#.... +....#...#.......#....##.#..#... +.####..##......##.#........#..# +..###..#.#.....#...........##.. +..##.#.#..#....#..#..#......... +..........#.#.#####...#........ +.###......##.#....#........#... +.....#..#..#.#..#.........#.... +..#....#...#...#...##.......... +....#..##.#.........##.#..##... +##.####..#...#.#...#.....#..### +..#..#...#...#.....##....#..#.# +#..##..#.....#....#.#.....##..# +...#...........##.....#......#. +......#...#.....#.#..###....... +.........#.....###.##..#...#... +.#...#.##...#..........#.#..##. +......#.......##.....#.....##.. +........###..........#...#..... +##.......###..###...##...#..... +#.#.............#..#..#.#...... +..##........#.###.....#....##.. +......#...#......#....##......# +..#.....#...##...#.......#..#.. +..#.###..##.##...#....#...##.#. +........##...#..#.#..##.....#.# +.......................#......# +..##.###......#.#.............# +....#...........###............ +##...##.....#.......##.......#. +...#..##..##..#.#.###..#......# +........#........#.#..#..#..... +.#......#....##..........#...#. +.##...........##....#.......... +.#..#....###.......#....#..##.. +.....###..........#....#.#.#... +...#....###.#.#......#......#.. +#.#.##.#.....#..#........#...#. +...#.##.........#..#.....#..... +.##...##......##...###...#..... +...#.....#.##..#...#..#........ +........#............#.#.#..##. +###...#.....#...#..#........##. +##...#..#.....#.#....#.#.#..... +#..##.......#...#.#...##..#.... +#...#.##.....#.#..#.##......#.# +..#......#.#.#.##.##..........# +..#.##......#.#.#..##.......... +....#..#....#..#..............# +..........###.....##..#........ +...#.....##.....#..#.#..#...##. +.#..##.#..#....#.#......#.##... +...#.....#..#.#...#..#.....#.#. +#...#.#......##...#..#...#....# +..#.......##...#..#.......#...# +#.....#...........##.#......... +.#......##.....####...#.......# +........#..#.....#.......#..#.. +....#.#...##..##...#..#....#... +#.#......#...#.#.###.....#..... +..##...#.#........#.##....#.#.# +.#....#......#.#...###.#....... +.......#.#...##....#.#....#.... +.....##..##...#..#.#.....##..#. +.##..#.#.#....##.#...#.....#... +.#..#..##....#.##.......#...#.. +....#.##...#..##......#.....#.. +.#..#....##....#............... +..##...#.....###............... +..............#.#.##........#.# +.#.#....#....#...#.#........#.. +.##...#...#.#....#....#.#.....# +#..............#......#.####.#. +......#...........#..#.....##.. +#.#..##.##.....#......#..#.#..# +##.##..#.##.#.............#...# +...#..#......#....#............ +........###.#.#..#...#.....#.## +..#.......#.##.........#..#.... +...##.#........##...#.#.##..#.. +...#..#......#...#....#........ +...........#..#..#...##...#.... +...#.....#....#..####..##.....# +.......#..#..#......#.........# +#......#........###.....##....# +..#..#..#.#.#....##...##......# +#.#..#..###.#..#.....####...... +.#................#####....#... +.#.........#...#.......#......# +..#.......#######........#..... +..#........#.....#..#...#..#..# +.#..#.#..#....#.#..##...#..#.#. +..#...........#.#...#.#.##..... +...#.#.#....##.###....#...####. +.....#..#.....#..#.#.........#. +......##...#...###............# +..#.#......###..####..#......#. +###.##.#..#......##.#..##.....# +....###...##............#.#.... +..#.....##...#...##....#...#... +#.....#.....#...#...#.#..#..... +####..........##.#.#..#.....##. +...#..........#...#...##..##.#. +..........#.........#.#..#..#.. +#....###.....#.#...#.......##.# +#..#.##.....#..........#...#... +...#.#.###.......##..#.....#... +#...#.#..#.............#..#.#.. +#........#.................#..# +..#.#....#.#..##.#...#..#....#. +#...#..........#...###....#...# +......#.............#....#....# +#.#.......##.......#.#....##..# +##...#....#.............#..#... +........#...###.##.#..###.#...# +...##...#..#..#...##..##......# +..#.......##....#.#.##....#.... +.....#....#..#.#...##.#.#.....# From d47170409ed5301e5368b97bdd2f481bdc26844e Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Wed, 2 Dec 2020 22:03:52 -0800 Subject: [PATCH 08/52] Completed day 3 --- 2020/Makefile | 3 + 2020/day3.cpp | 68 ++++++++++ 2020/day3.input | 323 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 394 insertions(+) create mode 100644 2020/day3.cpp create mode 100644 2020/day3.input diff --git a/2020/Makefile b/2020/Makefile index 89345cb..4ee74ce 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -4,6 +4,9 @@ day1.out: out/types.o day1.cpp day1.input day2.out: out/types.o day2.cpp day2.input g++ $(flags) day2.cpp out/types.o -o $@ +day3.out: out/types.o day3.cpp day3.input + g++ $(flags) day3.cpp out/types.o -o $@ + out/types.o: types.hpp types.cpp mkdir -p out/ g++ $(flags) -c types.cpp -o $@ diff --git a/2020/day3.cpp b/2020/day3.cpp new file mode 100644 index 0000000..4c6268b --- /dev/null +++ b/2020/day3.cpp @@ -0,0 +1,68 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +auto read_field_and_count_trees(std::vector & trees, usize horizontal_increment, usize vertical_increment) -> u64 { + auto tree_count = u64(0); + + auto x_index = usize(-horizontal_increment); + auto y_index = usize(-1); + auto line = std::string(); + auto file = std::ifstream("day3.input"); + + while (getline(file, line)) { + auto vertical_check = (++y_index % vertical_increment == 0); + tree_count += vertical_check * (line[(x_index += (vertical_check * horizontal_increment)) % line.size()] == '#'); + } + + return tree_count; +} + +auto main(i32 argc, char ** argv) -> i32 { + auto trees = std::vector(); + auto tree_counts = std::vector(); + + tree_counts.push_back(read_field_and_count_trees(trees, 3, 1)); + std::cout << tree_counts[0] << std::endl; + + tree_counts.push_back(read_field_and_count_trees(trees, 1, 1)); + tree_counts.push_back(read_field_and_count_trees(trees, 5, 1)); + tree_counts.push_back(read_field_and_count_trees(trees, 7, 1)); + tree_counts.push_back(read_field_and_count_trees(trees, 1, 2)); + auto tree_count_product = u64(1); + for (auto tree_count : tree_counts) { + tree_count_product *= tree_count; + } + std::cout << tree_count_product << std::endl; + + return 0; +} diff --git a/2020/day3.input b/2020/day3.input new file mode 100644 index 0000000..6727b2a --- /dev/null +++ b/2020/day3.input @@ -0,0 +1,323 @@ +.....#............#....#####.## +.#.#....#......#....##......... +......#.#.#.....###.#.#........ +......#...#.....#####....#..##. +...#............##...###.##.... +#.....#...#....#......##....##. +#...#.#....#..#..##.##...#..... +.......#..........#..#..#.#.... +.#.....#.#.......#..#...#....#. +#..#.##.#..................###. +...#.#.##...##.###.....#..#...# +..#.#...#............#.......#. +#..#.#..#.#....#...#.#.....#..# +#......##....#..#.#.#........#. +....#..#.#.#.##............#..# +....#..#..#...#.#.##......#...# +##...#...........#.....###.#... +..#...#.#...#.#.....#....##.##. +....##...##.#....#.....#.##.... +#........##......#......#.#.#.# +....#.#.#.........##......#.... +.#......#...#.....##..#....#..# +....#..#.#.....#..........#..#. +..##...#..##................#.# +.....#....#.#..#......#........ +........#..#.#......#.#........ +.....#.#....##.###....#...#.... +...##.#.......#....###..#...... +............##.#..#...#........ +#..###..#.....#.####........... +.......##.....#......#......#.. +#........##..#.....##.......#.# +#.##...#...#...#......##..#.#.# +......#....##.#.#...#...##....# +#..#....##.#......#.......##... +.#..........#..........#....#.# +#.....##......##....#.......... +..#.#.....#.#...#........#..... +...#........#..#..#.##..##..... +......###.....#..#...#.###...## +.##.##.......#.......###...#... +#.#..#.#.#....#.....###..#...## +......#.##..........#.......##. +#..#.#.........#.....##...##... +..#...#....#....###.#......#... +.....#..#.######.....#..#.#.... +..#.#.....#.....##.#....##.#.## +...#.#.#....#....##..#..#.#.##. +...........#.#...#..#..####.... +.........#####.#.#.#...#.##.#.. +.......#...#......#.##.#.##.... +....#.....#.....###..........#. +.#.###....##.#..#..........#... +#...#.........##.....####....#. +##....##...#..........#........ +...#.#.#.#....#..........#..... +.......#....#......##.......#.. +.#.#..#.........#.#.##....#.... +..#.............#..##.#.##..### +.#.##..............#..#..##..#. +..##.#..#......#...##..#.##...# +......#..#....#....#....##..#.. +...#...##.............#..###... +...##....#.#.##........#.....## +....#.#.......#..###..#....#### +#...#...##..#.####..#...##....# +.......#..#.##..#...#.#........ +###.#......#..##..#......#.##.. +#....#............#.....#...... +..##...#..##......#..#....#.... +.#..##...#....#.#...#...#..#..# +........#....###...#..##..###.# +.........#....#....#..#.#.#...# +.#....###.##...#.#...........## +..#..#.#..#.#.##..#...##....... +##..#.#.#....#...#..#.......... +#..#.......#....#..##...####... +............#.#..........##.##. +#...#..#.#....#..#.#....##..... +......#...#...#.##............# +#.....##..###..#.#..#.#.##..#.# +#..#.#..#......#.......##.#.... +##..#.#..#...#......#.##...###. +.#....#..............#....#.#.. +..#.#..##....#....#..##........ +.#.#...#..#.....#.#..##........ +.....#..#.#......#....#.#..#.#. +....#.###...###.#.#.....#...... +...........#.#....##....##..... +..#..#.##..........#...#...#..# +.....#.###.#..........#........ +....#....##........###...#..... +.#.....##.......#....#..##..### +#.....#...............##......# +#..#.#..#.#.#.....#.#...#...... +.##.###...#....#..........##... +.#.......#..................... +.#.#....#...##..#...#...##..... +.#.#...#.......#.......#...#... +....#.#..#.#..#...#....##...... +....##.....#.##....#.##..##..## +..#............#...###.##..#... +.#..#.........#.##....#....#..# +.#..##..#..#........#.#.##.#.## +.###.#...#...............#...#. +...#.##.##.#......#...#....##.# +#......##.......##...###....#.# +#..##.....##......#.#.##....#.# +...#.#....#.#.#...........##..# +#.....##......##.#..........##. +###....#.#...#.#..####......... +.##.#.#...##..#.....#..#...#... +#.....#.#......#..........#.#.. +..###.##.#...................#. +#.............#..#........#.##. +#.#.#.#..#.....##..##.#....#... +...#...#..#...#..##..##........ +...##...##..#...##...........#. +.####..#.#.#.##.#.......#...... +...#....#.......#......#....... +.....#.#...#...#..##..#..#..... +......#.....###.#..#..#.#..###. +.#....#....#..#..##.....##...#. +.#.............##.###.#...#.#.. +#..#..#......#.###............# +##.#..##....#..........#.#.#... +......#........#...#.......##.. +....#.#..#..........#.....#.#.. +...#..#...#.#...#........#..... +.....##...#....#.........##.##. +....#...#...#.##.##...#....#... +.#..#.....##......#..#.#..#.... +........##...##.##......#.#.#.# +.................#..#.....##.#. +...#.....#...#.........#..#.#.# +....##.#.....#........#...#..#. +#...............#..#.....#...#. +.....#..#....#...#.####.#.#.... +####.#..#.##...#....#...##..... +#...##..#...####..#....#.#...#. +..#.......#.##..##...#.#....... +...........##.......#....#..#.. +#.##....#...#.....#....##...... +....##.#.......#..#...##....... +...#.........##.#..#......#.### +.#..#..#....#.#.##....###..###. +....#.#........##........##.... +....########....#.#.#.###.#...# +...#.###.###.##......##.......# +.#...#.###.......#..........#.. +..#..##.........#............#. +.......##.#...#...##...#...#..# +#.##....#.#...#.....#..#.#..... +..#........#..#.#.#.#....#.##.. +...#...#.#.........#...#.#..##. +#....#......#.#...........#..## +...#.#.#..#...##...#...#...#... +###..........#.#..........#.... +..#....#.#.#.#............#.#.. +....#...#..###...#.#....#...... +#...........####......##.#..... +..#..##.#...#.....#..#.......## +#.....#..###.....#...##..##.... +##..###..##...........#.#...#.. +.....#......#..............#... +#..#.##.###.......#.......#...# +#........#....##......#.#...... +.#.#.#...#.......#........#.##. +#..#..##.....#...#.#.#.#..###.. +.#.#....#..#..#.#....##.#.#.... +..#.#.........####.#...#.#.###. +....##........##....#........#. +................#..........#... +..#...................###.##..# +.........#..#..#.#...#....#.#.# +......#.....###.....#.#..#...#. +.#.#.....#..##............##... +...##......##.#....#........... +...##..##..###.#...##.......... +....###...#..#.#......#......#. +....##..............#..#..#.#.. +####.......#...##.##..#.#...... +.#......#.....#....###..#....#. +.#.......#...##...#..##.#...... +#.......#.......#.#....#.#.#..# +........#..#..#............##.# +#.#...#.#..##..#.......##..#... +...#....#...#..........##..#... +#.#...#.##....###......##....#. +#..#...###........#..#....#..#. +#....#....###....#..#.......#.. +....#.#........#.............#. +.#.##........##...#...#...#...# +#.....##.....#.......#.#.#..... +.#.##..........##..#....#...... +.#..##.##.#...##....#.#....##.. +........#.#.##.#....#.#..#....# +..#...........................# +.#...........#....#....#.#..#.. +........##...........#...#...#. +..#.....#..#......#..##.......# +..#....###..###...#.#.#..#....# +#..#.#...#......##......#...... +...........#...##..##....##.... +#.#......###..#.....#.......#.# +#.....#....#....#.#...#...#.... +....#...#.......#....##.#..#... +.####..##......##.#........#..# +..###..#.#.....#...........##.. +..##.#.#..#....#..#..#......... +..........#.#.#####...#........ +.###......##.#....#........#... +.....#..#..#.#..#.........#.... +..#....#...#...#...##.......... +....#..##.#.........##.#..##... +##.####..#...#.#...#.....#..### +..#..#...#...#.....##....#..#.# +#..##..#.....#....#.#.....##..# +...#...........##.....#......#. +......#...#.....#.#..###....... +.........#.....###.##..#...#... +.#...#.##...#..........#.#..##. +......#.......##.....#.....##.. +........###..........#...#..... +##.......###..###...##...#..... +#.#.............#..#..#.#...... +..##........#.###.....#....##.. +......#...#......#....##......# +..#.....#...##...#.......#..#.. +..#.###..##.##...#....#...##.#. +........##...#..#.#..##.....#.# +.......................#......# +..##.###......#.#.............# +....#...........###............ +##...##.....#.......##.......#. +...#..##..##..#.#.###..#......# +........#........#.#..#..#..... +.#......#....##..........#...#. +.##...........##....#.......... +.#..#....###.......#....#..##.. +.....###..........#....#.#.#... +...#....###.#.#......#......#.. +#.#.##.#.....#..#........#...#. +...#.##.........#..#.....#..... +.##...##......##...###...#..... +...#.....#.##..#...#..#........ +........#............#.#.#..##. +###...#.....#...#..#........##. +##...#..#.....#.#....#.#.#..... +#..##.......#...#.#...##..#.... +#...#.##.....#.#..#.##......#.# +..#......#.#.#.##.##..........# +..#.##......#.#.#..##.......... +....#..#....#..#..............# +..........###.....##..#........ +...#.....##.....#..#.#..#...##. +.#..##.#..#....#.#......#.##... +...#.....#..#.#...#..#.....#.#. +#...#.#......##...#..#...#....# +..#.......##...#..#.......#...# +#.....#...........##.#......... +.#......##.....####...#.......# +........#..#.....#.......#..#.. +....#.#...##..##...#..#....#... +#.#......#...#.#.###.....#..... +..##...#.#........#.##....#.#.# +.#....#......#.#...###.#....... +.......#.#...##....#.#....#.... +.....##..##...#..#.#.....##..#. +.##..#.#.#....##.#...#.....#... +.#..#..##....#.##.......#...#.. +....#.##...#..##......#.....#.. +.#..#....##....#............... +..##...#.....###............... +..............#.#.##........#.# +.#.#....#....#...#.#........#.. +.##...#...#.#....#....#.#.....# +#..............#......#.####.#. +......#...........#..#.....##.. +#.#..##.##.....#......#..#.#..# +##.##..#.##.#.............#...# +...#..#......#....#............ +........###.#.#..#...#.....#.## +..#.......#.##.........#..#.... +...##.#........##...#.#.##..#.. +...#..#......#...#....#........ +...........#..#..#...##...#.... +...#.....#....#..####..##.....# +.......#..#..#......#.........# +#......#........###.....##....# +..#..#..#.#.#....##...##......# +#.#..#..###.#..#.....####...... +.#................#####....#... +.#.........#...#.......#......# +..#.......#######........#..... +..#........#.....#..#...#..#..# +.#..#.#..#....#.#..##...#..#.#. +..#...........#.#...#.#.##..... +...#.#.#....##.###....#...####. +.....#..#.....#..#.#.........#. +......##...#...###............# +..#.#......###..####..#......#. +###.##.#..#......##.#..##.....# +....###...##............#.#.... +..#.....##...#...##....#...#... +#.....#.....#...#...#.#..#..... +####..........##.#.#..#.....##. +...#..........#...#...##..##.#. +..........#.........#.#..#..#.. +#....###.....#.#...#.......##.# +#..#.##.....#..........#...#... +...#.#.###.......##..#.....#... +#...#.#..#.............#..#.#.. +#........#.................#..# +..#.#....#.#..##.#...#..#....#. +#...#..........#...###....#...# +......#.............#....#....# +#.#.......##.......#.#....##..# +##...#....#.............#..#... +........#...###.##.#..###.#...# +...##...#..#..#...##..##......# +..#.......##....#.#.##....#.... +.....#....#..#.#...##.#.#.....# From df7228bc99fab7c9de7ced8a62e89fe750f177d9 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Thu, 3 Dec 2020 09:38:55 -0800 Subject: [PATCH 09/52] Removed debugging output file --- 2020/day2.output | 1001 ---------------------------------------------- 1 file changed, 1001 deletions(-) delete mode 100644 2020/day2.output diff --git a/2020/day2.output b/2020/day2.output deleted file mode 100644 index d11a364..0000000 --- a/2020/day2.output +++ /dev/null @@ -1,1001 +0,0 @@ -min: 9, max: 11, c: p, password: pppppppppxblp, count: 10 -min: 2, max: 4, c: b, password: bbxbb, count: 4 -min: 3, max: 5, c: q, password: dqfqb, count: 2 -min: 5, max: 8, c: g, password: ggcgggglg, count: 7 -min: 10, max: 18, c: l, password: gllpmlgtrmnllhllrlll, count: 10 -min: 18, max: 19, c: z, password: zzzzznszzzzzzzzzzzxz, count: 17 -min: 3, max: 6, c: r, password: frrhxsnrmgmw, count: 3 -min: 1, max: 8, c: n, password: zkxhnxnzghnm, count: 3 -min: 11, max: 12, c: z, password: zzczzzztlzlzzzz, count: 11 -min: 4, max: 7, c: q, password: qqqbncqqq, count: 6 -min: 3, max: 4, c: c, password: ccvfc, count: 3 -min: 19, max: 20, c: l, password: sltlklljdlzglwllllzl, count: 11 -min: 6, max: 16, c: h, password: dhhhrhvhnhdchfsnhq, count: 8 -min: 3, max: 7, c: l, password: fllllqjlll, count: 7 -min: 8, max: 9, c: k, password: xkkjqklkm, count: 4 -min: 1, max: 2, c: l, password: llgpl, count: 3 -min: 2, max: 4, c: x, password: qkjxvqlv, count: 1 -min: 5, max: 6, c: c, password: cwcccjch, count: 5 -min: 3, max: 7, c: n, password: bnnhnwnqtdnndnncnd, count: 9 -min: 8, max: 9, c: n, password: nnrkmdnkn, count: 4 -min: 6, max: 9, c: t, password: ttttrtltptgvcd, count: 7 -min: 3, max: 4, c: h, password: hhwhhhdhhhh, count: 9 -min: 7, max: 8, c: w, password: wdwvcwwszcwwwwwq, count: 9 -min: 2, max: 4, c: n, password: vnng, count: 2 -min: 3, max: 13, c: v, password: vvvvvvvvvvvvjv, count: 13 -min: 9, max: 11, c: c, password: zcccccccccfcbccc, count: 13 -min: 10, max: 11, c: w, password: wkwwwwwwwxw, count: 9 -min: 10, max: 12, c: z, password: zzzzzjzzzrnzz, count: 10 -min: 5, max: 6, c: t, password: ttttts, count: 5 -min: 13, max: 19, c: b, password: bbmfbbbbbrbbgbbbrbbb, count: 15 -min: 8, max: 9, c: d, password: bdddvkddjbdgdd, count: 8 -min: 19, max: 20, c: m, password: mmmmmmmmmcmmmmmmmmmq, count: 18 -min: 6, max: 18, c: w, password: wwwwwwhwjwwwwwwcwjw, count: 15 -min: 4, max: 10, c: t, password: tttttttttj, count: 9 -min: 2, max: 7, c: j, password: fbdgmfjbjgjn, count: 3 -min: 7, max: 8, c: w, password: wwwwwwcww, count: 8 -min: 8, max: 12, c: c, password: cbmdccbccckjccch, count: 9 -min: 13, max: 15, c: f, password: fpfffffffffffqf, count: 13 -min: 7, max: 11, c: t, password: sbtstwdxjpclwd, count: 2 -min: 1, max: 3, c: s, password: shkkqcs, count: 2 -min: 7, max: 8, c: l, password: bdggzczl, count: 1 -min: 1, max: 6, c: g, password: zgggggglggggggw, count: 12 -min: 12, max: 16, c: h, password: hhhhhhhhhhhhhhphhhh, count: 18 -min: 8, max: 19, c: k, password: htknkhkrkdkhkpwppkk, count: 8 -min: 8, max: 10, c: k, password: kkxkkkbrkgk, count: 7 -min: 8, max: 9, c: h, password: hvhhhhhfhhv, count: 8 -min: 15, max: 16, c: x, password: xxxxxxxxxxxxxxxh, count: 15 -min: 1, max: 12, c: b, password: bgwpjbkhbptsbbb, count: 6 -min: 9, max: 10, c: j, password: pjtjpjpnbjjlsgbn, count: 5 -min: 8, max: 9, c: s, password: sscplbswssssglxs, count: 8 -min: 14, max: 15, c: j, password: jjjhjjjjjjxjjjj, count: 13 -min: 1, max: 4, c: q, password: qnqj, count: 2 -min: 3, max: 5, c: d, password: qpdddqvwbzldf, count: 4 -min: 14, max: 15, c: b, password: bbbbbbbbbbbbbbt, count: 14 -min: 1, max: 2, c: t, password: tdxt, count: 2 -min: 1, max: 7, c: g, password: dlpkvrgjzpnr, count: 1 -min: 3, max: 11, c: m, password: lmnwjjxpfmm, count: 3 -min: 3, max: 8, c: l, password: llglllllll, count: 9 -min: 2, max: 4, c: r, password: gfmrlbmsvqzrmbnd, count: 2 -min: 5, max: 9, c: s, password: srsqssssds, count: 7 -min: 8, max: 9, c: v, password: vvvvmvvvhw, count: 7 -min: 7, max: 10, c: d, password: mddwdvjdcdwdcgddd, count: 9 -min: 4, max: 7, c: k, password: fksjkkkk, count: 5 -min: 6, max: 9, c: t, password: fnrxmlwtt, count: 2 -min: 11, max: 12, c: d, password: dddddddddfmd, count: 10 -min: 4, max: 5, c: z, password: zzdzzzz, count: 6 -min: 11, max: 13, c: z, password: zzzzzzzzzzpzmzzz, count: 14 -min: 12, max: 14, c: z, password: zrgnvcrxkzzzrb, count: 4 -min: 10, max: 13, c: q, password: qpqqqqqrqxvqq, count: 9 -min: 6, max: 10, c: g, password: gglggggggzgggg, count: 12 -min: 2, max: 8, c: j, password: jfqjrdjjjjjj, count: 8 -min: 7, max: 8, c: z, password: hzlvrczjp, count: 2 -min: 4, max: 5, c: k, password: kggjkl, count: 2 -min: 4, max: 7, c: m, password: mpmmmcmm, count: 6 -min: 13, max: 14, c: x, password: xxxxxxzxxxxxxw, count: 12 -min: 6, max: 7, c: n, password: znnnnnlpjcn, count: 6 -min: 10, max: 16, c: g, password: gggzvgggntggfgghggg, count: 13 -min: 2, max: 17, c: n, password: hnchrpvzhkdsnhgcnfql, count: 3 -min: 2, max: 8, c: f, password: fkfpffff, count: 6 -min: 4, max: 7, c: s, password: qwdspspj, count: 2 -min: 6, max: 7, c: r, password: rrrrrnx, count: 5 -min: 7, max: 8, c: p, password: wpppppsp, count: 6 -min: 8, max: 10, c: m, password: mmmwmjmmmvmzpm, count: 9 -min: 6, max: 7, c: j, password: jjjjjncd, count: 5 -min: 3, max: 4, c: k, password: kxkk, count: 3 -min: 2, max: 4, c: z, password: czzmzz, count: 4 -min: 11, max: 12, c: t, password: tttttttttttzkp, count: 11 -min: 10, max: 17, c: t, password: ttttvtltdttrqtztr, count: 10 -min: 3, max: 6, c: n, password: nnnnvvxv, count: 4 -min: 7, max: 8, c: v, password: rvvpvvvpsvv, count: 7 -min: 1, max: 2, c: r, password: nkfgnr, count: 1 -min: 4, max: 11, c: c, password: cccbccclcccc, count: 10 -min: 7, max: 12, c: q, password: qpbqtqkqqqqqqq, count: 10 -min: 2, max: 7, c: m, password: mfmmmmmmxmnm, count: 9 -min: 10, max: 11, c: n, password: bnnnpnnncxrnnnn, count: 10 -min: 10, max: 14, c: n, password: nsnnnnnwljnsnnn, count: 10 -min: 5, max: 9, c: b, password: vcvcblrxbvjbtzbrmbr, count: 5 -min: 3, max: 9, c: m, password: kmmmmxmmkmmk, count: 8 -min: 2, max: 10, c: l, password: llbllgzllnlll, count: 9 -min: 5, max: 6, c: d, password: ddpdwdddxhpdqd, count: 8 -min: 12, max: 18, c: j, password: cjfbjccqgxlczjptqlk, count: 3 -min: 1, max: 3, c: z, password: mzzz, count: 3 -min: 5, max: 11, c: m, password: mdfmmmmtmgw, count: 6 -min: 2, max: 14, c: h, password: nhhnbhghhlhhchsqsr, count: 8 -min: 3, max: 4, c: t, password: jvtt, count: 2 -min: 2, max: 8, c: t, password: tttkxxtsttht, count: 7 -min: 7, max: 15, c: w, password: wwwwfwwwwwwrbww, count: 12 -min: 1, max: 4, c: j, password: rbjj, count: 2 -min: 8, max: 12, c: f, password: ffkhffffcsfzff, count: 9 -min: 10, max: 12, c: p, password: pppcgpqphprh, count: 6 -min: 10, max: 11, c: l, password: lllllllllsl, count: 10 -min: 7, max: 8, c: s, password: svsssssss, count: 8 -min: 4, max: 5, c: c, password: cvjcc, count: 3 -min: 1, max: 5, c: v, password: vcdcd, count: 1 -min: 5, max: 14, c: z, password: zzwkzztzzzzzbzzvzzz, count: 14 -min: 11, max: 12, c: s, password: sssssssssssps, count: 12 -min: 5, max: 7, c: b, password: spmtbpn, count: 1 -min: 5, max: 6, c: c, password: cccccf, count: 5 -min: 10, max: 12, c: p, password: ptpppppppppk, count: 10 -min: 4, max: 13, c: f, password: ffkffffkffflb, count: 9 -min: 2, max: 5, c: t, password: nttqftpnwbjbxmqdqv, count: 3 -min: 17, max: 18, c: w, password: wwwwtwwwwwwwwwwwkwww, count: 18 -min: 7, max: 9, c: f, password: lmrffdbffvfmf, count: 6 -min: 2, max: 5, c: h, password: hhhvzrhh, count: 5 -min: 10, max: 11, c: q, password: qmdrdfqgzql, count: 3 -min: 3, max: 11, c: g, password: ggggggggggm, count: 10 -min: 4, max: 5, c: z, password: zzzrzzp, count: 5 -min: 5, max: 7, c: w, password: wwwwkwwww, count: 8 -min: 10, max: 11, c: f, password: ffffffffffp, count: 10 -min: 6, max: 9, c: v, password: vvvvvvvmv, count: 8 -min: 4, max: 5, c: x, password: wjxxxxxtd, count: 5 -min: 12, max: 13, c: p, password: vppppppppppzbp, count: 11 -min: 2, max: 7, c: b, password: bqntbls, count: 2 -min: 15, max: 16, c: p, password: ppppppppppppzpfxn, count: 13 -min: 2, max: 3, c: b, password: bbcnbq, count: 3 -min: 10, max: 11, c: k, password: kkkklkmkkhk, count: 8 -min: 4, max: 6, c: w, password: wwwdjb, count: 3 -min: 4, max: 6, c: b, password: sczlwbnffbnxbvjbmj, count: 4 -min: 3, max: 17, c: m, password: jmmlmmmgmmmjmmmmmlmm, count: 15 -min: 6, max: 18, c: z, password: zmkwvzkpqzmzdfgdvt, count: 4 -min: 5, max: 6, c: q, password: sqwqqq, count: 4 -min: 1, max: 3, c: g, password: gjgt, count: 2 -min: 5, max: 8, c: x, password: bxcxxzxxws, count: 5 -min: 4, max: 5, c: c, password: rnscvcngbcmpddkcvctk, count: 5 -min: 7, max: 11, c: g, password: ggggglvgggngg, count: 10 -min: 2, max: 11, c: l, password: lsqlzlllllklgfl, count: 9 -min: 2, max: 9, c: m, password: cmqkbmdxp, count: 2 -min: 6, max: 7, c: w, password: wwwwwww, count: 7 -min: 8, max: 13, c: q, password: qbqzqqqqqlqqw, count: 9 -min: 3, max: 4, c: n, password: sfqnnnwvzn, count: 4 -min: 1, max: 2, c: w, password: nwww, count: 3 -min: 2, max: 4, c: v, password: hvvbqgnfl, count: 2 -min: 14, max: 15, c: m, password: gjgdmmmmkmqqcxmrsm, count: 7 -min: 2, max: 3, c: z, password: zzzx, count: 3 -min: 5, max: 13, c: q, password: qqqqdqqqqqtqjqq, count: 12 -min: 4, max: 5, c: z, password: zzzzk, count: 4 -min: 5, max: 6, c: t, password: tttttf, count: 5 -min: 3, max: 6, c: z, password: ztwzczkz, count: 4 -min: 3, max: 5, c: l, password: llpljllllllll, count: 11 -min: 2, max: 3, c: s, password: ssscp, count: 3 -min: 8, max: 10, c: d, password: dddddddwdddddwddg, count: 14 -min: 2, max: 6, c: s, password: sbssps, count: 4 -min: 1, max: 5, c: f, password: ffbfvfxbkmbhvbcfmxpf, count: 6 -min: 1, max: 6, c: j, password: gqfrmjgsgjjhcjhn, count: 4 -min: 2, max: 5, c: l, password: lwvllll, count: 5 -min: 2, max: 5, c: z, password: zkzhzb, count: 3 -min: 10, max: 11, c: s, password: wsblfxvmvsslbhfjtsws, count: 5 -min: 11, max: 17, c: f, password: fffffffxfffffffftfff, count: 18 -min: 4, max: 5, c: r, password: rrrkbrr, count: 5 -min: 7, max: 10, c: w, password: qwqwwwgzrdxww, count: 6 -min: 6, max: 8, c: s, password: ssssssscs, count: 8 -min: 4, max: 6, c: q, password: qbqwqzfqcfgkmzqxb, count: 5 -min: 6, max: 10, c: t, password: ttncfqqtttttp, count: 7 -min: 2, max: 4, c: m, password: bbzcjjqmfvln, count: 1 -min: 4, max: 7, c: n, password: cnqhntshdnnrnrnz, count: 6 -min: 7, max: 12, c: d, password: vmdndkzpmcbd, count: 3 -min: 6, max: 7, c: p, password: tpqpppzpjp, count: 6 -min: 3, max: 10, c: r, password: rgrrrpzrbrrr, count: 8 -min: 2, max: 15, c: h, password: ghbfhbgrtxrshphhl, count: 5 -min: 2, max: 6, c: j, password: pjjjjlj, count: 5 -min: 6, max: 9, c: j, password: rjrjjjwfjn, count: 5 -min: 10, max: 13, c: s, password: sssssssssjsssssss, count: 16 -min: 1, max: 6, c: c, password: crnjccgnw, count: 3 -min: 6, max: 7, c: l, password: qrllgql, count: 3 -min: 12, max: 13, c: z, password: wzzzzzzzzzzfz, count: 11 -min: 1, max: 2, c: c, password: ccclc, count: 4 -min: 2, max: 6, c: f, password: qdlflfr, count: 2 -min: 4, max: 10, c: r, password: drrrrrwrfrr, count: 8 -min: 5, max: 6, c: f, password: ffzffnf, count: 5 -min: 4, max: 6, c: p, password: hkppkbppp, count: 5 -min: 8, max: 9, c: r, password: rrrrrrrrx, count: 8 -min: 4, max: 12, c: f, password: fffffffffffwqp, count: 11 -min: 4, max: 6, c: q, password: qtqtjq, count: 3 -min: 4, max: 5, c: w, password: wwwcw, count: 4 -min: 2, max: 3, c: r, password: qrrr, count: 3 -min: 7, max: 10, c: k, password: nkpgzskkrb, count: 3 -min: 6, max: 9, c: h, password: hmsshhhwhhhhh, count: 9 -min: 2, max: 18, c: d, password: kxqddddqddsmddcdddwd, count: 12 -min: 6, max: 7, c: s, password: sssssssss, count: 9 -min: 4, max: 8, c: h, password: hhhbthhhhh, count: 8 -min: 1, max: 8, c: d, password: dtsbqtrpwdgfdzrtf, count: 3 -min: 6, max: 7, c: b, password: bbbbbwp, count: 5 -min: 5, max: 6, c: p, password: ppnpqjp, count: 4 -min: 4, max: 13, c: l, password: rtqpmllslrlxcblldqtc, count: 6 -min: 3, max: 4, c: m, password: wmmkcm, count: 3 -min: 4, max: 16, c: b, password: qkbvbvgxtlqbgmwc, count: 3 -min: 4, max: 5, c: h, password: hhhlghh, count: 5 -min: 10, max: 11, c: f, password: fjfffffffgjff, count: 10 -min: 9, max: 12, c: w, password: gwnfvwwrwswnqrvg, count: 5 -min: 4, max: 8, c: k, password: pjkkfkbqqzkmfk, count: 5 -min: 2, max: 8, c: x, password: xwxxxxxcxxx, count: 9 -min: 11, max: 19, c: w, password: wwwwwdjwwwrrwwlvwwww, count: 14 -min: 4, max: 14, c: w, password: rwqhwqwwlhpwfwwpww, count: 9 -min: 7, max: 9, c: j, password: vjjjjqdjjjjjj, count: 10 -min: 15, max: 17, c: x, password: kxrmxjvxxxvxxxzxxxf, count: 11 -min: 3, max: 10, c: p, password: pwpxppzgdrrx, count: 4 -min: 1, max: 5, c: p, password: ppppp, count: 5 -min: 10, max: 19, c: n, password: vfnwnjstnnjnqnngnzs, count: 8 -min: 2, max: 5, c: m, password: phsmq, count: 1 -min: 5, max: 6, c: m, password: mmmmxmm, count: 6 -min: 2, max: 12, c: f, password: tftgcmcblzcljsdlbvf, count: 2 -min: 6, max: 11, c: b, password: hbbbbbbbzhwbtbbhmrb, count: 11 -min: 7, max: 11, c: j, password: jjjjjjvjjjq, count: 9 -min: 3, max: 4, c: d, password: dddgddnmd, count: 6 -min: 11, max: 14, c: f, password: fxfffffftqfflffffpf, count: 14 -min: 14, max: 16, c: x, password: xxxxxcxxxxjgxxvt, count: 11 -min: 6, max: 7, c: h, password: hhhhhht, count: 6 -min: 7, max: 8, c: h, password: hhhhhhzphhhh, count: 10 -min: 5, max: 12, c: w, password: wfwwwjzwmpxwmw, count: 7 -min: 2, max: 7, c: h, password: chcjhhqhdlfshxvhz, count: 6 -min: 7, max: 15, c: h, password: hjhhjvhhhhqmhdhjh, count: 10 -min: 1, max: 2, c: f, password: bvhf, count: 1 -min: 4, max: 6, c: k, password: rkctkkm, count: 3 -min: 5, max: 6, c: n, password: nnnnnn, count: 6 -min: 10, max: 11, c: j, password: jjjjjjjcjjs, count: 9 -min: 4, max: 7, c: b, password: bbgbnkp, count: 3 -min: 2, max: 5, c: d, password: dddddjvddxdk, count: 8 -min: 11, max: 19, c: z, password: svzzgzzmzznzzzkcdzzz, count: 12 -min: 8, max: 9, c: z, password: zzzzzgzmz, count: 7 -min: 4, max: 10, c: v, password: vsvvvvnvsr, count: 6 -min: 5, max: 15, c: v, password: mvqvvkjfvwdvvdl, count: 6 -min: 13, max: 14, c: s, password: ssssssqzszssmk, count: 9 -min: 3, max: 4, c: w, password: wbwg, count: 2 -min: 10, max: 11, c: d, password: kdbdcddqddxdddd, count: 10 -min: 8, max: 9, c: t, password: tttttttntt, count: 9 -min: 2, max: 10, c: m, password: mqmmmmmmmm, count: 9 -min: 3, max: 8, c: c, password: bcswcncchpxcxcrccrx, count: 8 -min: 4, max: 10, c: q, password: qqqplwsfxgq, count: 4 -min: 15, max: 16, c: h, password: hhqhhhhhhvhhhhhthhhh, count: 17 -min: 11, max: 13, c: s, password: sssxssswsswsr, count: 9 -min: 6, max: 7, c: z, password: zzzzhvzz, count: 6 -min: 3, max: 4, c: j, password: ktjdxsjjxjtnq, count: 4 -min: 5, max: 7, c: w, password: wwxwlwwr, count: 5 -min: 2, max: 5, c: l, password: llltll, count: 5 -min: 2, max: 6, c: m, password: qmgvtmtp, count: 2 -min: 11, max: 16, c: v, password: vvvgvvlvhvvvvvvvvvgv, count: 16 -min: 2, max: 4, c: j, password: jsnjf, count: 2 -min: 11, max: 12, c: g, password: gdlcvdgzgqpg, count: 4 -min: 10, max: 12, c: x, password: rxxcxxxxxrrxx, count: 9 -min: 9, max: 12, c: n, password: nnnnnnnncdnn, count: 10 -min: 6, max: 10, c: j, password: vjjjpjhjjs, count: 6 -min: 5, max: 6, c: d, password: dcdddt, count: 4 -min: 3, max: 13, c: c, password: cccccvctcbvcvpcccc, count: 12 -min: 1, max: 7, c: d, password: ndddzzdx, count: 4 -min: 9, max: 10, c: w, password: wwwcwwwwfr, count: 7 -min: 9, max: 18, c: q, password: xjhsjqqrqpgprjmqqq, count: 6 -min: 8, max: 11, c: b, password: bprbbbwkbbbb, count: 8 -min: 4, max: 14, c: w, password: wxcwzsswmsqvfjvjzj, count: 3 -min: 5, max: 6, c: b, password: wbbmzbbm, count: 4 -min: 8, max: 13, c: f, password: lpjfsfswfffgfkff, count: 8 -min: 1, max: 3, c: x, password: vxxx, count: 3 -min: 6, max: 7, c: x, password: btxxxxcx, count: 5 -min: 6, max: 8, c: r, password: mwqrrqrrxr, count: 5 -min: 7, max: 14, c: h, password: hhhhjllhrsxtrhmbbpwh, count: 7 -min: 7, max: 10, c: f, password: phqzgfwfrpffpzq, count: 4 -min: 6, max: 17, c: d, password: ddddddddddddxdbdgdd, count: 16 -min: 5, max: 11, c: f, password: fhfnfflfhjvwvfff, count: 8 -min: 11, max: 12, c: h, password: hhgbtnkhhhhh, count: 7 -min: 2, max: 4, c: f, password: fdfgffr, count: 4 -min: 5, max: 6, c: w, password: wwwwxw, count: 5 -min: 4, max: 9, c: z, password: zbzzzczzv, count: 6 -min: 2, max: 4, c: k, password: jfpkc, count: 1 -min: 3, max: 4, c: r, password: kwgr, count: 1 -min: 4, max: 5, c: k, password: kkkks, count: 4 -min: 5, max: 6, c: r, password: rrrdrsr, count: 5 -min: 5, max: 6, c: t, password: tpwnmttclcrtt, count: 5 -min: 18, max: 19, c: t, password: ttbwxtxgfsphgtzzplbt, count: 5 -min: 1, max: 5, c: w, password: tthwwvw, count: 3 -min: 10, max: 13, c: z, password: mzzzzzwzzzzztz, count: 11 -min: 7, max: 10, c: r, password: rzrjrfpdrrrcmmrr, count: 8 -min: 2, max: 4, c: w, password: wwww, count: 4 -min: 5, max: 9, c: m, password: vksmmzdpsm, count: 3 -min: 1, max: 2, c: q, password: qqqqqqq, count: 7 -min: 1, max: 6, c: c, password: pccccn, count: 4 -min: 3, max: 8, c: r, password: pbchhhrr, count: 2 -min: 3, max: 8, c: v, password: bfdvkvdvglvn, count: 4 -min: 3, max: 6, c: h, password: hhhxhshhl, count: 6 -min: 4, max: 7, c: m, password: mkwpkwmtmm, count: 4 -min: 10, max: 11, c: g, password: ggggmggggcg, count: 9 -min: 1, max: 6, c: j, password: jjjjjw, count: 5 -min: 4, max: 10, c: z, password: zvzzxzzgzzz, count: 8 -min: 7, max: 9, c: k, password: kkkkkkkkjkkkk, count: 12 -min: 4, max: 18, c: f, password: vlnfpdzvbqhvsfmhqtf, count: 3 -min: 8, max: 11, c: s, password: sssssksshsssmhs, count: 11 -min: 2, max: 6, c: b, password: bbbbbm, count: 5 -min: 2, max: 3, c: h, password: hhvrlcf, count: 2 -min: 10, max: 19, c: c, password: mccwczqbjdlgfccnrqc, count: 6 -min: 8, max: 12, c: x, password: rxxxnxtfxcxxxpx, count: 9 -min: 13, max: 14, c: r, password: rrrnrrrrrrrrmrr, count: 13 -min: 4, max: 11, c: h, password: mhzstqhhghhhbhhh, count: 9 -min: 10, max: 11, c: f, password: fffffffffpf, count: 10 -min: 7, max: 8, c: j, password: jjjjjjmv, count: 6 -min: 5, max: 6, c: f, password: fhfffv, count: 4 -min: 3, max: 4, c: z, password: zzxtzq, count: 3 -min: 5, max: 6, c: v, password: jvszvzvvg, count: 4 -min: 9, max: 13, c: v, password: wvvgvdvvvsrjcg, count: 6 -min: 10, max: 11, c: t, password: pcttrntttttdthtxst, count: 10 -min: 1, max: 5, c: v, password: vvvvpv, count: 5 -min: 6, max: 9, c: q, password: qfqqqlqqqqq, count: 9 -min: 4, max: 8, c: f, password: ffffffmfkkfzpffffvff, count: 14 -min: 3, max: 5, c: n, password: lnmnnnnnnnn, count: 9 -min: 1, max: 5, c: k, password: kkwmdkflxtqktmcxdl, count: 4 -min: 1, max: 3, c: z, password: tnqp, count: 0 -min: 15, max: 16, c: h, password: hhhnhhhhfhhhhhjhhh, count: 15 -min: 2, max: 6, c: m, password: mmmxmb, count: 4 -min: 7, max: 12, c: q, password: qqjqhqfqwqcqqkqmql, count: 10 -min: 6, max: 10, c: s, password: ssjvrvsgsshsss, count: 8 -min: 11, max: 15, c: n, password: nnnnnnnnnnrnnnj, count: 13 -min: 14, max: 15, c: x, password: xxxxvxxxxxkxxxzx, count: 13 -min: 9, max: 14, c: b, password: bbbbbbpbbqbblbbbb, count: 14 -min: 4, max: 12, c: h, password: knthjdhlrxtpjwhnhn, count: 4 -min: 8, max: 9, c: v, password: vvvvvvvjjvvvv, count: 11 -min: 2, max: 3, c: d, password: dktdvd, count: 3 -min: 6, max: 8, c: z, password: zzzzzzzx, count: 7 -min: 10, max: 13, c: t, password: jrjfklzstpxwt, count: 2 -min: 4, max: 16, c: n, password: mngnnqnbnnwnqrdgk, count: 7 -min: 3, max: 5, c: v, password: vhqvvn, count: 3 -min: 1, max: 4, c: t, password: jhtq, count: 1 -min: 8, max: 11, c: f, password: qfffffqfffff, count: 10 -min: 14, max: 15, c: x, password: xxxxxxxxxxxxxxx, count: 15 -min: 2, max: 12, c: s, password: scsstsssmcssswgsw, count: 10 -min: 8, max: 13, c: t, password: tttttttqttttt, count: 12 -min: 8, max: 10, c: d, password: ddddddvdfbq, count: 7 -min: 9, max: 15, c: d, password: sdqpqddddjrdjnj, count: 6 -min: 17, max: 19, c: c, password: cccccdldcccpbccxgcc, count: 12 -min: 6, max: 14, c: v, password: lvvvvsvvvvvvvp, count: 11 -min: 16, max: 18, c: p, password: ppppppppppvpppppppt, count: 17 -min: 1, max: 3, c: v, password: vkvtzlvrdcvzplznltqs, count: 4 -min: 8, max: 10, c: s, password: sssssssssns, count: 10 -min: 1, max: 3, c: w, password: wcwfwxnwwp, count: 5 -min: 8, max: 10, c: v, password: kvvvvvvvvvkvvv, count: 12 -min: 7, max: 11, c: s, password: shsssssssns, count: 9 -min: 9, max: 10, c: w, password: wwwwtwwgkwww, count: 9 -min: 1, max: 2, c: x, password: vxxn, count: 2 -min: 4, max: 9, c: g, password: lkgggrcgpg, count: 5 -min: 1, max: 5, c: n, password: fjrnn, count: 2 -min: 4, max: 6, c: x, password: xtxzxxx, count: 5 -min: 18, max: 19, c: z, password: zzzzhvzhzzzzzzzzzsz, count: 15 -min: 15, max: 18, c: p, password: ppppppppppppppsppppp, count: 19 -min: 11, max: 14, c: h, password: rdhhhhhhhghhhrh, count: 11 -min: 3, max: 9, c: v, password: vvvvvvvvqvv, count: 10 -min: 4, max: 8, c: p, password: bbpmjpplp, count: 4 -min: 1, max: 15, c: n, password: qndxnnsmnrnsnnnnn, count: 10 -min: 7, max: 9, c: c, password: cccccctccc, count: 9 -min: 2, max: 6, c: m, password: xwfnmmn, count: 2 -min: 4, max: 16, c: t, password: nbttltzvhqjtcgbtttkt, count: 8 -min: 7, max: 8, c: r, password: rrlrrrrsrbr, count: 8 -min: 3, max: 5, c: h, password: hhghh, count: 4 -min: 3, max: 4, c: m, password: mmmxm, count: 4 -min: 15, max: 16, c: k, password: fckzkjskrkkkdkkl, count: 8 -min: 5, max: 6, c: c, password: cbsxmh, count: 1 -min: 1, max: 6, c: x, password: fxxxxxx, count: 6 -min: 5, max: 12, c: d, password: wdddqrdkwkmdfwd, count: 6 -min: 3, max: 10, c: s, password: smsqncrsjjdmjdlsls, count: 5 -min: 6, max: 7, c: k, password: vkkskkjkwkrkkk, count: 9 -min: 9, max: 17, c: z, password: qwzhqgrnvzzbzlhjz, count: 5 -min: 5, max: 6, c: w, password: dwwwwp, count: 4 -min: 5, max: 8, c: n, password: ncvgqnvn, count: 3 -min: 5, max: 6, c: v, password: vvnvvwvv, count: 6 -min: 3, max: 4, c: x, password: dxxxsbsxx, count: 5 -min: 8, max: 12, c: t, password: ttgtshxfmzlc, count: 3 -min: 10, max: 17, c: x, password: xthkjfxlktkbhdxzx, count: 4 -min: 5, max: 8, c: q, password: qqtqqqkqq, count: 7 -min: 4, max: 10, c: d, password: ndddgxvzswlsgdpnrc, count: 4 -min: 8, max: 11, c: h, password: bgcfhhrkhhb, count: 4 -min: 16, max: 19, c: g, password: qgdmbghrjhgcvgwpggg, count: 7 -min: 3, max: 5, c: s, password: fbsqqszkdkqzw, count: 2 -min: 9, max: 10, c: h, password: hhhhhhhhdhhh, count: 11 -min: 15, max: 17, c: b, password: bbbbbbbbbtbbbbzbbb, count: 16 -min: 11, max: 14, c: q, password: qqqhqqqqqqqqqsq, count: 13 -min: 4, max: 18, c: r, password: rhhrrpghwbqfznflrrr, count: 6 -min: 14, max: 15, c: l, password: lllllllllllllrl, count: 14 -min: 8, max: 14, c: s, password: nsfpsrsssnffssjss, count: 9 -min: 17, max: 18, c: k, password: kkkkkkkkkkklkkkkck, count: 16 -min: 1, max: 12, c: c, password: cmnccccccccktcc, count: 11 -min: 7, max: 14, c: p, password: pppppphppppppp, count: 13 -min: 1, max: 2, c: j, password: jtjq, count: 2 -min: 2, max: 6, c: w, password: wwpxxrwwwdwwh, count: 7 -min: 5, max: 12, c: p, password: zspwppnppdghqplnj, count: 6 -min: 3, max: 5, c: h, password: zhqphfth, count: 3 -min: 1, max: 3, c: q, password: xqqq, count: 3 -min: 4, max: 9, c: r, password: qrzrfgpnbj, count: 2 -min: 7, max: 8, c: q, password: qqqjqqqcqw, count: 7 -min: 4, max: 6, c: m, password: mmmmmwdmm, count: 7 -min: 4, max: 6, c: s, password: sqcssgnsrrddgshvbcs, count: 6 -min: 2, max: 6, c: m, password: mmsgtr, count: 2 -min: 3, max: 9, c: v, password: wvwvvvmvv, count: 6 -min: 3, max: 5, c: j, password: jcjvtgjjjxvjjgjbhj, count: 9 -min: 4, max: 6, c: f, password: qsffzgff, count: 4 -min: 8, max: 9, c: x, password: nxxbxwfrxx, count: 5 -min: 1, max: 7, c: m, password: mvmmmbmmljmg, count: 7 -min: 5, max: 8, c: d, password: pdcdqdddwdl, count: 6 -min: 1, max: 3, c: m, password: mmgns, count: 2 -min: 19, max: 20, c: r, password: rrrrrrrrrrrrrrrrrrxr, count: 19 -min: 1, max: 4, c: h, password: hpghbhkhhr, count: 5 -min: 5, max: 9, c: x, password: xxxxtxxxxxxxxxxx, count: 15 -min: 19, max: 20, c: p, password: qvwdwnssfckjczggpghp, count: 2 -min: 8, max: 12, c: k, password: kkkkkkkfkkkkkkkk, count: 15 -min: 10, max: 12, c: b, password: cbbbbdbbbqbkbb, count: 10 -min: 2, max: 8, c: n, password: nkkpnprnfcnnwsmndqnn, count: 8 -min: 11, max: 12, c: d, password: ddddddvddddvd, count: 11 -min: 4, max: 8, c: j, password: jjjjjjjqjjl, count: 9 -min: 1, max: 3, c: l, password: lvdlslllhllsg, count: 7 -min: 12, max: 15, c: j, password: jzjjjjjkjpjjjjqf, count: 11 -min: 6, max: 9, c: s, password: sssssssssssss, count: 13 -min: 1, max: 2, c: z, password: xzzcnjrzzzzzzz, count: 9 -min: 5, max: 6, c: h, password: hhhhhh, count: 6 -min: 7, max: 13, c: x, password: xxzxvsmxlbxpxz, count: 6 -min: 2, max: 4, c: d, password: dpnddbdfdm, count: 5 -min: 9, max: 16, c: n, password: nnnnnnnnknnnnnnr, count: 14 -min: 4, max: 5, c: n, password: nnnvnn, count: 5 -min: 13, max: 16, c: p, password: vppppppppppppppz, count: 14 -min: 3, max: 6, c: w, password: wwtwww, count: 5 -min: 7, max: 9, c: n, password: nnxnwntnnn, count: 7 -min: 4, max: 12, c: q, password: mqcnsrvqqzgqkwz, count: 4 -min: 3, max: 4, c: t, password: dwtj, count: 1 -min: 9, max: 12, c: r, password: rrrrwrrrrdrcr, count: 10 -min: 8, max: 9, c: w, password: wwtcwwjhwwww, count: 8 -min: 6, max: 8, c: w, password: wwwwwwbgw, count: 7 -min: 5, max: 15, c: f, password: pgflfgfbbvvffkfkmw, count: 6 -min: 10, max: 17, c: s, password: ssssssssshsssfsssss, count: 17 -min: 19, max: 20, c: m, password: mmbmxfmmbzqhmxmxmmmw, count: 10 -min: 11, max: 12, c: d, password: ddddddddddsd, count: 11 -min: 13, max: 14, c: f, password: fffffffffffffdf, count: 14 -min: 1, max: 6, c: n, password: nnnnnnnn, count: 8 -min: 11, max: 19, c: x, password: wmxxbxxkxxxpxxxxxxc, count: 13 -min: 2, max: 3, c: z, password: szgkqvmzwztdcxtvn, count: 3 -min: 16, max: 20, c: z, password: zpzhwdtdzhvgcpdpzzzz, count: 7 -min: 15, max: 19, c: p, password: ppmpcxppppprsgnpppg, count: 11 -min: 4, max: 5, c: x, password: rrxfxxxqx, count: 5 -min: 1, max: 2, c: q, password: rqdwn, count: 1 -min: 4, max: 6, c: x, password: pkfxqxxfxbk, count: 4 -min: 13, max: 17, c: c, password: ccccccccccccncclc, count: 15 -min: 5, max: 7, c: z, password: zzzzvhz, count: 5 -min: 5, max: 6, c: r, password: rrrnrl, count: 4 -min: 2, max: 5, c: g, password: mfgkgxhckg, count: 3 -min: 3, max: 6, c: c, password: cnmcjcccdccccv, count: 9 -min: 7, max: 11, c: t, password: dttttttrttxtt, count: 10 -min: 6, max: 9, c: p, password: ptlfppppcvsp, count: 6 -min: 3, max: 5, c: g, password: ggxkwtj, count: 2 -min: 5, max: 16, c: x, password: phzxlbhqxgxzwjwkkxp, count: 4 -min: 7, max: 8, c: s, password: wsssssmsn, count: 6 -min: 1, max: 7, c: m, password: pmgrmkmmnnm, count: 5 -min: 15, max: 16, c: n, password: nnnnnnnnnvnnnnnln, count: 15 -min: 6, max: 8, c: t, password: ttzttftst, count: 6 -min: 5, max: 7, c: g, password: ggggggggggg, count: 11 -min: 13, max: 16, c: d, password: ddddddddddddpddbdfdd, count: 17 -min: 13, max: 14, c: f, password: jclffflwlffbfvffffbn, count: 10 -min: 3, max: 4, c: j, password: xjzjjjr, count: 4 -min: 8, max: 14, c: n, password: nnnwknndnlnlnn, count: 9 -min: 6, max: 7, c: s, password: sxsssnzs, count: 5 -min: 6, max: 7, c: r, password: rrsprrjrcrb, count: 6 -min: 10, max: 11, c: w, password: qwwcwqzwrbq, count: 4 -min: 7, max: 10, c: b, password: bbbbbbzbbbb, count: 10 -min: 5, max: 6, c: d, password: ddddkd, count: 5 -min: 16, max: 17, c: d, password: ldldddddpdldldddd, count: 12 -min: 5, max: 14, c: w, password: zdtwxnxwhwwpww, count: 6 -min: 6, max: 9, c: q, password: mqqxqsqqq, count: 6 -min: 2, max: 11, c: g, password: gpggzvgggkgmcmt, count: 7 -min: 6, max: 14, c: k, password: kfkkkxkkkkkkkjkk, count: 13 -min: 2, max: 3, c: m, password: zfmm, count: 2 -min: 13, max: 17, c: k, password: kkbkkkkmkktkkkrkk, count: 13 -min: 4, max: 6, c: z, password: tzprqwzzcpj, count: 3 -min: 3, max: 4, c: w, password: gblwcxwllzpv, count: 2 -min: 3, max: 5, c: d, password: ddcddd, count: 5 -min: 9, max: 13, c: r, password: rrfjmrcsrrwvrrk, count: 7 -min: 11, max: 17, c: m, password: dgwrmqjmclmczrlwf, count: 3 -min: 1, max: 4, c: v, password: vvhvvv, count: 5 -min: 10, max: 13, c: c, password: clhccbcvbvcfcccqccc, count: 11 -min: 11, max: 13, c: s, password: sssssssssssss, count: 13 -min: 6, max: 7, c: k, password: skkckkk, count: 5 -min: 2, max: 5, c: m, password: mfffq, count: 1 -min: 3, max: 5, c: x, password: jxbxx, count: 3 -min: 1, max: 2, c: c, password: ctcc, count: 3 -min: 5, max: 8, c: q, password: qqqqgqqqq, count: 8 -min: 11, max: 13, c: q, password: hqqbqqqqqqbqqqqqbk, count: 13 -min: 9, max: 11, c: q, password: qqqqqqqqqql, count: 10 -min: 15, max: 20, c: q, password: qqqqqqqqnqqqqqqqqqqq, count: 19 -min: 5, max: 7, c: g, password: gzngbvggmlzzrgx, count: 5 -min: 2, max: 10, c: n, password: zjknggzlvnxtbwnhmf, count: 3 -min: 2, max: 13, c: c, password: cccccccccccct, count: 12 -min: 4, max: 8, c: c, password: cccccccbcccc, count: 11 -min: 3, max: 5, c: k, password: kdkkz, count: 3 -min: 8, max: 10, c: h, password: nchthhghhjhjh, count: 7 -min: 10, max: 11, c: l, password: wllllllllplxllnjj, count: 11 -min: 14, max: 17, c: q, password: qqhqqqqqqtqvqcqqqrq, count: 14 -min: 5, max: 9, c: d, password: dddddddrz, count: 7 -min: 13, max: 14, c: z, password: zzzzzzzzzzzzzm, count: 13 -min: 7, max: 9, c: t, password: tttttctwlttt, count: 9 -min: 6, max: 13, c: w, password: dwcwdtwrwccwwl, count: 6 -min: 10, max: 11, c: h, password: hhhhhwhhmmhhhh, count: 11 -min: 7, max: 9, c: t, password: tttttjtttt, count: 9 -min: 12, max: 17, c: n, password: nnnnknnfpnnwncnnjn, count: 12 -min: 5, max: 6, c: c, password: zccccc, count: 5 -min: 11, max: 13, c: s, password: ssssksxssssss, count: 11 -min: 9, max: 17, c: q, password: qqqqcfbqrqqcqzqqlqqq, count: 13 -min: 3, max: 4, c: m, password: dmml, count: 2 -min: 4, max: 6, c: v, password: slvvvln, count: 3 -min: 4, max: 5, c: n, password: nnbmnn, count: 4 -min: 2, max: 7, c: h, password: whhhhhjvfhhh, count: 8 -min: 2, max: 5, c: s, password: slhss, count: 3 -min: 4, max: 5, c: q, password: zbhqhqgqdq, count: 4 -min: 2, max: 6, c: p, password: pjtxqp, count: 2 -min: 7, max: 9, c: h, password: hhhhhhkhh, count: 8 -min: 7, max: 8, c: w, password: fgvwcwws, count: 3 -min: 10, max: 13, c: d, password: ddddxhdddddvhdddd, count: 13 -min: 7, max: 16, c: m, password: mmnznmmwmwrmqzrqbmpr, count: 7 -min: 12, max: 13, c: v, password: vvvvvvvvvzvvjv, count: 12 -min: 18, max: 19, c: g, password: mztkzhgmndnffztwqfg, count: 2 -min: 7, max: 8, c: j, password: jjjcjjvjjjjpjjjjjjj, count: 16 -min: 7, max: 10, c: s, password: sssssssssz, count: 9 -min: 18, max: 20, c: s, password: sssssssssssssssssssg, count: 19 -min: 1, max: 4, c: r, password: trrrr, count: 4 -min: 2, max: 16, c: r, password: mrrrrrrhrcrrfcpqrh, count: 10 -min: 5, max: 13, c: n, password: nnbljfchnnnnnj, count: 7 -min: 1, max: 6, c: v, password: vvvvvmvv, count: 7 -min: 7, max: 15, c: q, password: szqhbkqxppcbkxmc, count: 2 -min: 9, max: 10, c: l, password: gllllvllsvll, count: 8 -min: 1, max: 4, c: m, password: mxldw, count: 1 -min: 5, max: 9, c: x, password: xxxxxxxxj, count: 8 -min: 11, max: 16, c: t, password: ttttttttwttttttfl, count: 14 -min: 7, max: 12, c: j, password: sjjzpjjjjljhj, count: 8 -min: 1, max: 5, c: x, password: wmplxj, count: 1 -min: 2, max: 6, c: z, password: zzxzzrzqplrh, count: 5 -min: 4, max: 6, c: w, password: cqbwwbww, count: 4 -min: 14, max: 15, c: l, password: llllltllllllllw, count: 13 -min: 3, max: 4, c: m, password: mhmvvz, count: 2 -min: 3, max: 4, c: w, password: wwmw, count: 3 -min: 1, max: 4, c: c, password: ccchpccc, count: 6 -min: 6, max: 10, c: p, password: pppppppppqprbppppp, count: 15 -min: 9, max: 15, c: h, password: hhhjcrhhhhhhchhjht, count: 12 -min: 8, max: 11, c: g, password: gggggggkggggggggg, count: 16 -min: 4, max: 9, c: h, password: hhkqxhhhlh, count: 6 -min: 7, max: 8, c: f, password: mlfdfrmfbfttmffqfff, count: 9 -min: 7, max: 9, c: t, password: nttttttvsn, count: 6 -min: 6, max: 9, c: h, password: hhhhbhvhph, count: 7 -min: 4, max: 5, c: f, password: hhcdf, count: 1 -min: 3, max: 4, c: k, password: kfxkcr, count: 2 -min: 1, max: 4, c: z, password: zzml, count: 2 -min: 3, max: 5, c: f, password: cjjffbzffqfsbm, count: 5 -min: 4, max: 5, c: f, password: ffdfh, count: 3 -min: 6, max: 17, c: h, password: hhhhhhhhhhhhhhhhrh, count: 17 -min: 8, max: 10, c: d, password: qdddzddddzdd, count: 9 -min: 7, max: 8, c: j, password: nfxxthqj, count: 1 -min: 2, max: 4, c: n, password: nnnc, count: 3 -min: 3, max: 5, c: v, password: vlvzx, count: 2 -min: 6, max: 10, c: n, password: nnnnnnnnns, count: 9 -min: 11, max: 13, c: q, password: bzhwhbvwqffzs, count: 1 -min: 3, max: 6, c: c, password: gccmcc, count: 4 -min: 2, max: 5, c: m, password: xmbgm, count: 2 -min: 2, max: 11, c: g, password: tgztmzzbgjzc, count: 2 -min: 2, max: 5, c: j, password: jsjbj, count: 3 -min: 3, max: 4, c: v, password: vvljvvv, count: 5 -min: 3, max: 6, c: p, password: pxwcnwmp, count: 2 -min: 2, max: 7, c: j, password: ndjnzmjklxqwpkpnwb, count: 2 -min: 1, max: 20, c: s, password: slssswsnssscgbssxsdg, count: 11 -min: 3, max: 4, c: r, password: rrrfjc, count: 3 -min: 5, max: 16, c: t, password: ttntptttsqtttpwtgbt, count: 11 -min: 3, max: 4, c: g, password: fxgg, count: 2 -min: 13, max: 17, c: l, password: llltllllllllvllllvrl, count: 16 -min: 5, max: 8, c: q, password: vxfpqhqd, count: 2 -min: 4, max: 8, c: c, password: cvqcwkccp, count: 4 -min: 5, max: 11, c: x, password: kxqkghvxxdqfwxxkxx, count: 7 -min: 4, max: 5, c: t, password: tttht, count: 4 -min: 8, max: 11, c: n, password: mnnpnnpsnqdknnvsh, count: 7 -min: 1, max: 4, c: g, password: gggngpdggv, count: 6 -min: 5, max: 6, c: s, password: ssssss, count: 6 -min: 4, max: 7, c: d, password: mddfddk, count: 4 -min: 7, max: 8, c: f, password: fffffffb, count: 7 -min: 4, max: 11, c: x, password: cbmcvvvvxgn, count: 1 -min: 14, max: 16, c: d, password: vdddkddpddddllrddddd, count: 14 -min: 8, max: 9, c: h, password: qhhhsnxhjmzhlhdjxhf, count: 7 -min: 5, max: 13, c: f, password: fxfhlqsffxfgwpcz, count: 5 -min: 14, max: 16, c: g, password: jggggnngggngggggjggg, count: 15 -min: 1, max: 5, c: z, password: rzgzt, count: 2 -min: 3, max: 6, c: f, password: fffgrv, count: 3 -min: 3, max: 4, c: w, password: zwwtwdw, count: 4 -min: 9, max: 12, c: g, password: dkmhhvhjgsvqglbrr, count: 2 -min: 4, max: 5, c: g, password: gbrtx, count: 1 -min: 1, max: 5, c: r, password: xrrrr, count: 4 -min: 2, max: 5, c: d, password: ddddddddddddddd, count: 15 -min: 4, max: 5, c: j, password: jjvjz, count: 3 -min: 2, max: 4, c: b, password: blbbbt, count: 4 -min: 16, max: 17, c: b, password: bbbbbbbbbbblbbbzbc, count: 15 -min: 8, max: 13, c: l, password: lljlqlkslqllllll, count: 11 -min: 6, max: 15, c: g, password: wgfgzggggggbtch, count: 8 -min: 4, max: 13, c: w, password: cwvbtpnjdkvww, count: 3 -min: 8, max: 10, c: x, password: xtdxxxxxxhxxx, count: 10 -min: 3, max: 6, c: p, password: pprpppp, count: 6 -min: 15, max: 17, c: p, password: ppppppppppppppkpppp, count: 18 -min: 1, max: 3, c: w, password: wnwpwwbllb, count: 4 -min: 3, max: 5, c: m, password: mxqdq, count: 1 -min: 13, max: 16, c: s, password: hsrsssqssssscgssss, count: 13 -min: 1, max: 2, c: c, password: zccccm, count: 4 -min: 5, max: 8, c: r, password: rrrrkrrm, count: 6 -min: 5, max: 6, c: j, password: njjkjjsj, count: 5 -min: 5, max: 10, c: r, password: rrrrhrrrrr, count: 9 -min: 5, max: 12, c: x, password: xmxwxnmxsldlrpgxxxc, count: 7 -min: 4, max: 6, c: z, password: ztzwfzj, count: 3 -min: 11, max: 15, c: w, password: wwcwwwwwwwzwwww, count: 13 -min: 5, max: 7, c: c, password: cpccccnd, count: 5 -min: 1, max: 16, c: q, password: qqvhqhnpqscqqldqbzh, count: 7 -min: 8, max: 9, c: s, password: kfpdswzssssqssscms, count: 9 -min: 2, max: 16, c: l, password: hppbqldllnlljvflltl, count: 8 -min: 4, max: 12, c: c, password: cccccccccccpccc, count: 14 -min: 5, max: 6, c: r, password: rrrrqb, count: 4 -min: 11, max: 12, c: f, password: ffffdffffmfdkff, count: 11 -min: 5, max: 6, c: k, password: lhkkkf, count: 3 -min: 12, max: 15, c: z, password: bzzzzzzzzstzzzz, count: 12 -min: 5, max: 13, c: c, password: kgsscwsfzcbwchwk, count: 3 -min: 11, max: 18, c: m, password: wmmjbmfpvmmmthfwpsxf, count: 6 -min: 7, max: 14, c: m, password: mmmfmmtqmmmmmmmmrc, count: 13 -min: 14, max: 15, c: g, password: wbqfggngtbqvpqp, count: 3 -min: 10, max: 11, c: k, password: kkkvxktjtkbjkkkk, count: 9 -min: 2, max: 4, c: b, password: wbtkp, count: 1 -min: 4, max: 10, c: v, password: vvvvbffvmtvvz, count: 7 -min: 6, max: 8, c: m, password: vtvgmmbc, count: 2 -min: 1, max: 7, c: d, password: hddsnzd, count: 3 -min: 2, max: 3, c: d, password: rndxchftldndc, count: 3 -min: 2, max: 11, c: z, password: zzcwbxkzzqzzp, count: 6 -min: 5, max: 6, c: q, password: wqqqjq, count: 4 -min: 9, max: 10, c: d, password: ddddddpdcdd, count: 9 -min: 1, max: 12, c: g, password: ggfggggggggbn, count: 10 -min: 4, max: 5, c: v, password: vvvrvv, count: 5 -min: 12, max: 14, c: r, password: rrrrrrrrrrrqrr, count: 13 -min: 6, max: 10, c: s, password: sssshvssss, count: 8 -min: 7, max: 10, c: g, password: gqgzgggksggggdqghs, count: 10 -min: 8, max: 9, c: c, password: ccccccccf, count: 8 -min: 13, max: 18, c: j, password: gfjjjjjjjjgjhwjjch, count: 11 -min: 11, max: 15, c: m, password: mmmmmmmmmmmmmmm, count: 15 -min: 2, max: 4, c: s, password: ssqsr, count: 3 -min: 7, max: 8, c: v, password: vxxvbfdgvvgvtw, count: 5 -min: 2, max: 7, c: x, password: xwxxxxx, count: 6 -min: 3, max: 5, c: p, password: pzppfp, count: 4 -min: 1, max: 2, c: z, password: zfzwpzpxzc, count: 4 -min: 6, max: 7, c: r, password: vrrxrrnrb, count: 5 -min: 3, max: 4, c: f, password: nvftvrjsgxszkfsffg, count: 4 -min: 1, max: 5, c: w, password: kndqwltttskcwtzqt, count: 2 -min: 1, max: 9, c: z, password: zzzzzzzzzz, count: 10 -min: 10, max: 11, c: v, password: vvvvvvvvvvv, count: 11 -min: 1, max: 5, c: m, password: gmjhm, count: 2 -min: 7, max: 11, c: j, password: sdjjpjjjdgnccjjjsq, count: 8 -min: 1, max: 6, c: m, password: rrmcmmmmmbm, count: 7 -min: 1, max: 6, c: n, password: nlclfggwnm, count: 2 -min: 3, max: 7, c: s, password: clfnmssns, count: 3 -min: 3, max: 7, c: m, password: tqjmmmx, count: 3 -min: 13, max: 14, c: n, password: nfnvkntnlnnnxfwlnnnn, count: 11 -min: 3, max: 4, c: p, password: xphp, count: 2 -min: 8, max: 9, c: n, password: nnnlnnnzn, count: 7 -min: 11, max: 12, c: h, password: hhhhhhhdhhhhh, count: 12 -min: 1, max: 4, c: p, password: pjgsphp, count: 3 -min: 3, max: 9, c: f, password: pvfnfmfrcffffjf, count: 8 -min: 15, max: 16, c: d, password: dddddddddzddldgdd, count: 14 -min: 2, max: 4, c: b, password: bvztgnzbpr, count: 2 -min: 3, max: 7, c: w, password: wgwhmpwwwlwzzhwnv, count: 7 -min: 5, max: 9, c: n, password: nmznnvnnsznnw, count: 7 -min: 4, max: 6, c: f, password: zqffsnffdlbkt, count: 4 -min: 6, max: 7, c: s, password: sssssss, count: 7 -min: 2, max: 5, c: q, password: kqlqqmv, count: 3 -min: 11, max: 14, c: q, password: pjqrzjfdgmqzpd, count: 2 -min: 17, max: 18, c: s, password: sssssssssssssssssj, count: 17 -min: 8, max: 12, c: x, password: zxxxpxxxxxxt, count: 9 -min: 2, max: 4, c: h, password: hqhhhwfshp, count: 5 -min: 1, max: 9, c: b, password: qzwgfbzjvt, count: 1 -min: 8, max: 10, c: c, password: cccccccccn, count: 9 -min: 3, max: 5, c: n, password: nnnkwn, count: 4 -min: 4, max: 6, c: m, password: zmmhdzmmx, count: 4 -min: 7, max: 13, c: v, password: vvvvvnvvvvvvsvv, count: 13 -min: 1, max: 12, c: z, password: zzvzxzfzzrzm, count: 7 -min: 6, max: 11, c: p, password: ppppplppppvppppfp, count: 14 -min: 1, max: 5, c: s, password: sjsss, count: 4 -min: 2, max: 19, c: w, password: wwwwwwwwwwwwwwwwwwcw, count: 19 -min: 5, max: 6, c: k, password: zxlkrkbcrcwkdqtkkw, count: 5 -min: 1, max: 4, c: w, password: hjjbzqwnpjrbglkr, count: 1 -min: 8, max: 9, c: n, password: sznnljnqn, count: 4 -min: 7, max: 13, c: k, password: dwkpnjkdkglnm, count: 3 -min: 14, max: 20, c: x, password: xzxrxxsxxxxxxxxxxxjx, count: 16 -min: 4, max: 7, c: w, password: rtrwdvww, count: 3 -min: 14, max: 18, c: m, password: mmmpmmmmmmmmmlmnmq, count: 14 -min: 3, max: 4, c: z, password: zzxz, count: 3 -min: 8, max: 10, c: z, password: zzzzzzzzzjz, count: 10 -min: 11, max: 14, c: v, password: vcvwvxvcslbvvhv, count: 7 -min: 4, max: 8, c: j, password: jgjjbrjhp, count: 4 -min: 5, max: 6, c: d, password: dddddm, count: 5 -min: 4, max: 5, c: n, password: nnnzn, count: 4 -min: 15, max: 16, c: t, password: ttttttttttttttnc, count: 14 -min: 5, max: 8, c: b, password: bbtbspvbbgllcrgxd, count: 5 -min: 8, max: 9, c: w, password: wwwwwwwqw, count: 8 -min: 3, max: 5, c: j, password: vbjmxwjgjfrzttznwc, count: 3 -min: 12, max: 14, c: l, password: llllllllllnglzlwbl, count: 13 -min: 2, max: 4, c: f, password: ntffj, count: 2 -min: 2, max: 4, c: c, password: gvccrcc, count: 4 -min: 19, max: 20, c: w, password: wwwwwwwwwwwwwwwwwwpw, count: 19 -min: 1, max: 3, c: k, password: klwgkc, count: 2 -min: 3, max: 9, c: s, password: qsmlssskpsbsscs, count: 8 -min: 8, max: 9, c: j, password: jjjjjjjdj, count: 8 -min: 5, max: 9, c: s, password: bszlpsssss, count: 6 -min: 13, max: 14, c: l, password: llxllhlllllllllll, count: 15 -min: 1, max: 6, c: s, password: ssssscs, count: 6 -min: 7, max: 8, c: v, password: pbvptdvv, count: 3 -min: 10, max: 15, c: v, password: vvvvvvgvvvvvvvcv, count: 14 -min: 4, max: 5, c: k, password: kkcskfldskdc, count: 4 -min: 13, max: 14, c: v, password: vvvvvvvvvvvvvgv, count: 14 -min: 3, max: 7, c: n, password: hnjnnnnnsnfp, count: 7 -min: 3, max: 8, c: m, password: mtmjhrzzllqml, count: 3 -min: 9, max: 11, c: w, password: wwwwwwwwwwxw, count: 11 -min: 10, max: 20, c: g, password: pkvgkfvmxgkpjjhtqvcg, count: 3 -min: 8, max: 11, c: w, password: wwwwwwzwwwdw, count: 10 -min: 5, max: 7, c: r, password: rrrrrrb, count: 6 -min: 2, max: 7, c: b, password: sbldlwvcb, count: 2 -min: 10, max: 17, c: v, password: vvvvvvqgcvvkdvsvvjv, count: 12 -min: 4, max: 5, c: d, password: tkddnddzqpdfdddd, count: 9 -min: 10, max: 12, c: p, password: npppppppppfm, count: 9 -min: 1, max: 12, c: t, password: wttttttttttttt, count: 13 -min: 4, max: 5, c: f, password: qfffz, count: 3 -min: 11, max: 14, c: p, password: ppppppppppppgvpcp, count: 14 -min: 6, max: 8, c: w, password: qswwwrwwmww, count: 7 -min: 9, max: 15, c: g, password: txgchzlpgggdhgggbg, count: 8 -min: 2, max: 10, c: h, password: hthhzhhhshhh, count: 9 -min: 5, max: 8, c: l, password: lllllzkk, count: 5 -min: 17, max: 18, c: l, password: nlllllllllllllllvll, count: 17 -min: 3, max: 6, c: c, password: zdwcjcccdqct, count: 5 -min: 8, max: 17, c: m, password: mmmmmmmmmmmmmmmmjm, count: 17 -min: 10, max: 12, c: c, password: ccccncrccccb, count: 9 -min: 4, max: 12, c: j, password: jjjbjjjjjjnwjj, count: 11 -min: 2, max: 6, c: h, password: chbhhfc, count: 3 -min: 5, max: 6, c: c, password: cccpncc, count: 5 -min: 6, max: 7, c: m, password: dmwmkmphmmdmm, count: 7 -min: 6, max: 7, c: k, password: rxwkmkv, count: 2 -min: 1, max: 5, c: f, password: fzgfl, count: 2 -min: 4, max: 7, c: x, password: dxkmxhb, count: 2 -min: 1, max: 5, c: f, password: hhfzfpfffffsff, count: 9 -min: 1, max: 7, c: s, password: sssslsvv, count: 5 -min: 3, max: 7, c: w, password: wgwwwsh, count: 4 -min: 12, max: 15, c: d, password: mdsdbkltdvthvfjdddn, count: 6 -min: 16, max: 18, c: x, password: xxxxxxxxxxxxxxxxtl, count: 16 -min: 5, max: 19, c: x, password: xwxxxxxxxxxxxxxxbpn, count: 15 -min: 3, max: 5, c: h, password: hhrfh, count: 3 -min: 8, max: 10, c: g, password: ggggggggggkgg, count: 12 -min: 3, max: 8, c: c, password: cccccccmc, count: 8 -min: 5, max: 7, c: r, password: wrrrxrrr, count: 6 -min: 7, max: 8, c: p, password: phpprdslbpxprpg, count: 6 -min: 17, max: 19, c: z, password: zzzzvzzzzzdzzzzzzzg, count: 16 -min: 2, max: 4, c: x, password: kxxxxxm, count: 5 -min: 2, max: 11, c: w, password: gwwzpwwwwwplrqfh, count: 7 -min: 6, max: 9, c: t, password: qtcttttgf, count: 5 -min: 9, max: 12, c: g, password: gggggggggggsg, count: 12 -min: 3, max: 6, c: n, password: fzmnxb, count: 1 -min: 5, max: 9, c: x, password: pqxxxwdtn, count: 3 -min: 5, max: 6, c: j, password: jjjjjkq, count: 5 -min: 10, max: 12, c: h, password: hhhhhdhhhzhh, count: 10 -min: 1, max: 4, c: g, password: gskgk, count: 2 -min: 3, max: 5, c: c, password: ccccj, count: 4 -min: 1, max: 10, c: m, password: wmxsgmzmrzmrmmmjmmct, count: 9 -min: 5, max: 10, c: p, password: lmpppvptdgpjpwfwpp, count: 8 -min: 2, max: 4, c: z, password: bzgm, count: 1 -min: 6, max: 7, c: d, password: ddzdddj, count: 5 -min: 3, max: 7, c: r, password: gchrfwr, count: 2 -min: 4, max: 7, c: k, password: kkcvkkkkkk, count: 8 -min: 8, max: 12, c: t, password: tpwtttctvtttftpt, count: 10 -min: 11, max: 12, c: c, password: ccccccxcdncbwcc, count: 10 -min: 2, max: 10, c: p, password: jwwxlppppppnpn, count: 7 -min: 9, max: 16, c: w, password: chmwwwwwjwrwjwzjww, count: 10 -min: 1, max: 6, c: j, password: jkqjjbj, count: 4 -min: 5, max: 8, c: k, password: kkkkkklhkk, count: 8 -min: 3, max: 5, c: q, password: qqqqc, count: 4 -min: 16, max: 17, c: x, password: xxxxxxxxxxxxxxxtg, count: 15 -min: 4, max: 9, c: f, password: fmfkcfffffkcfmfhnzf, count: 10 -min: 5, max: 6, c: z, password: zhzzlz, count: 4 -min: 4, max: 17, c: k, password: kbwmwvkkvvhxkkkckqvk, count: 8 -min: 3, max: 5, c: d, password: dddmmdt, count: 4 -min: 4, max: 10, c: m, password: mmmmmmmmms, count: 9 -min: 5, max: 6, c: g, password: ghgggpj, count: 4 -min: 1, max: 5, c: c, password: cccck, count: 4 -min: 3, max: 7, c: z, password: zzjzzzzz, count: 7 -min: 2, max: 7, c: v, password: xrprnvvtsrgsk, count: 2 -min: 1, max: 5, c: s, password: sqqsn, count: 2 -min: 3, max: 5, c: j, password: xwpnj, count: 1 -min: 5, max: 7, c: v, password: vvvvvvqmv, count: 7 -min: 4, max: 5, c: j, password: jjjjzjjjjljjc, count: 10 -min: 2, max: 4, c: h, password: hghh, count: 3 -min: 3, max: 5, c: n, password: fnnpc, count: 2 -min: 16, max: 20, c: d, password: dddddddzdddddddpdddd, count: 18 -min: 3, max: 4, c: t, password: tnpt, count: 2 -min: 2, max: 7, c: f, password: fxffffkff, count: 7 -min: 6, max: 9, c: b, password: bbbhbbwhbbrblmtb, count: 9 -min: 7, max: 10, c: m, password: msmxmrnmrmmmm, count: 8 -min: 3, max: 4, c: r, password: rrzrr, count: 4 -min: 7, max: 8, c: m, password: mgmmmmjmm, count: 7 -min: 2, max: 3, c: l, password: lmll, count: 3 -min: 2, max: 6, c: h, password: cngphhhbfpvvsgrqhhzq, count: 5 -min: 6, max: 8, c: d, password: dddddddg, count: 7 -min: 12, max: 15, c: p, password: vfjxwpcpdvpnjwp, count: 4 -min: 12, max: 17, c: m, password: mzfmmsvfxmqsmcfjmwjb, count: 6 -min: 15, max: 19, c: b, password: bbbbbfbbbbbsbbmbbbbb, count: 17 -min: 7, max: 8, c: n, password: qdnjnnnpvmfnn, count: 6 -min: 6, max: 8, c: l, password: llllllll, count: 8 -min: 3, max: 4, c: n, password: nnbdh, count: 2 -min: 11, max: 12, c: w, password: hprdhfrpvcwbgwjcw, count: 3 -min: 2, max: 7, c: r, password: jrfrbjrhrw, count: 4 -min: 1, max: 6, c: v, password: fvzknvvv, count: 4 -min: 10, max: 11, c: t, password: tttstdhttqrttt, count: 9 -min: 5, max: 14, c: f, password: fxffnffffnfffff, count: 12 -min: 10, max: 13, c: q, password: qqqqqqqqqjqqqqq, count: 14 -min: 1, max: 5, c: v, password: tnvfvxvjvbvjk, count: 5 -min: 4, max: 5, c: c, password: ccccpc, count: 5 -min: 4, max: 6, c: t, password: tttttktttt, count: 9 -min: 1, max: 2, c: r, password: rwrsq, count: 2 -min: 11, max: 12, c: c, password: cccggjcccccr, count: 8 -min: 11, max: 16, c: g, password: gwggggggggqggbgggfg, count: 15 -min: 12, max: 14, c: b, password: bbggzhxsjjsbsf, count: 3 -min: 5, max: 7, c: r, password: kjdwpfbmcptrslrrr, count: 4 -min: 1, max: 2, c: l, password: lvbl, count: 2 -min: 6, max: 11, c: c, password: hsksgzhccbccbdfnzqcv, count: 5 -min: 6, max: 7, c: m, password: gmmmmmc, count: 5 -min: 1, max: 2, c: h, password: hhhh, count: 4 -min: 1, max: 3, c: g, password: rggg, count: 3 -min: 4, max: 8, c: z, password: rzzzzfbwzxkzzz, count: 8 -min: 3, max: 6, c: w, password: wwwwww, count: 6 -min: 3, max: 4, c: g, password: ggwtg, count: 3 -min: 9, max: 11, c: v, password: wxfltmvjvjm, count: 2 -min: 2, max: 4, c: l, password: llck, count: 2 -min: 2, max: 3, c: m, password: mmkgpdwzdm, count: 3 -min: 2, max: 5, c: d, password: bdjhdhjldzh, count: 3 -min: 10, max: 12, c: j, password: jnjlmjjjjpcdkjjjx, count: 9 -min: 3, max: 9, c: q, password: qqzqqqqqqqqqq, count: 12 -min: 4, max: 8, c: d, password: ddzwdpddd, count: 6 -min: 3, max: 7, c: m, password: mzmbsmcjgmpmmdkmr, count: 7 -min: 8, max: 13, c: q, password: xrxvgqdvvmjhhgdfz, count: 1 -min: 3, max: 12, c: z, password: zzjzzzzzzzzzzz, count: 13 -min: 5, max: 10, c: k, password: jkkkmkkkmkk, count: 8 -min: 6, max: 7, c: m, password: mmllmmtm, count: 5 -min: 17, max: 19, c: c, password: ccccccccccccccnckccc, count: 18 -min: 6, max: 9, c: w, password: wwwtbrwwwxww, count: 8 -min: 7, max: 9, c: d, password: wfdkwddsdsmdbswv, count: 5 -min: 11, max: 12, c: g, password: ggggggggggbgg, count: 12 -min: 13, max: 14, c: j, password: prjjdjjjjjjjcjjj, count: 12 -min: 3, max: 5, c: j, password: jjlljv, count: 3 -min: 3, max: 4, c: h, password: hrlh, count: 2 -min: 6, max: 7, c: l, password: hplnxlsjnwxzllllljcj, count: 7 -min: 4, max: 5, c: g, password: gfgml, count: 2 -min: 4, max: 5, c: z, password: zwkznzn, count: 3 -min: 4, max: 11, c: n, password: stnzhznnfnqcnn, count: 6 -min: 2, max: 5, c: h, password: hmzhh, count: 3 -min: 4, max: 6, c: w, password: wwbwwc, count: 4 -min: 4, max: 11, c: w, password: vmwwrxpkwcp, count: 3 -min: 4, max: 8, c: t, password: thxttstmtbstcvjtlflh, count: 7 -min: 6, max: 8, c: v, password: hvvkvvhfm, count: 4 -min: 16, max: 18, c: b, password: tbbbbbbbbbbbbbbbbr, count: 16 -min: 8, max: 10, c: f, password: fffffffcfl, count: 8 -min: 13, max: 15, c: r, password: rrrdrrrrrrrrrbr, count: 13 -min: 8, max: 14, c: t, password: ztstxttttttttwz, count: 10 -min: 8, max: 12, c: j, password: jgjjjjgjjjjx, count: 9 -min: 5, max: 6, c: m, password: nmqjdmgfqqmcmmvndztl, count: 5 -min: 2, max: 6, c: v, password: vwvvvvtv, count: 6 -min: 15, max: 16, c: l, password: llllllllllllllll, count: 16 -min: 3, max: 10, c: q, password: qqqqqqqqqxqq, count: 11 -min: 8, max: 9, c: j, password: rggxhvjjjk, count: 3 -min: 1, max: 3, c: p, password: pqhp, count: 2 -min: 4, max: 11, c: z, password: nkjddzczjrzktvnckmg, count: 3 -min: 5, max: 12, c: r, password: tfrdrswgwnbc, count: 2 -min: 8, max: 13, c: r, password: rrrrrrrrrrrrrr, count: 14 -min: 13, max: 18, c: x, password: xxmxvxxxxxxxhrxxxc, count: 13 -min: 7, max: 8, c: z, password: zzkzzzzw, count: 6 -min: 4, max: 8, c: m, password: mmmqmmskqlmmgm, count: 8 -min: 1, max: 3, c: w, password: bmwg, count: 1 -min: 1, max: 4, c: z, password: vzzzzzwz, count: 6 -min: 3, max: 4, c: d, password: dqdw, count: 2 -min: 2, max: 9, c: z, password: hzhqpndtllsw, count: 1 -min: 10, max: 13, c: t, password: tttttttttttbjb, count: 11 -min: 12, max: 14, c: r, password: rrrxrrsrrrgfrrr, count: 11 -min: 12, max: 19, c: g, password: hdxnlgglxwrgzkggcwp, count: 5 -min: 3, max: 4, c: x, password: qxjx, count: 2 -min: 1, max: 2, c: r, password: rrpdlqhcnwwr, count: 3 -min: 5, max: 11, c: c, password: vdbzvccdccldsjcq, count: 5 -min: 4, max: 6, c: k, password: kxkwkk, count: 4 -min: 16, max: 18, c: k, password: kkkknkkkkkkkfkkkkx, count: 15 -min: 1, max: 2, c: q, password: tqtghddbk, count: 1 -min: 7, max: 8, c: g, password: ggcgggvgg, count: 7 -min: 13, max: 19, c: d, password: ddddddfjdddddfddddd, count: 16 -min: 9, max: 15, c: z, password: pzhzzzzzqpzzzzzz, count: 12 -min: 4, max: 5, c: l, password: lclld, count: 3 -min: 2, max: 15, c: r, password: jrrmtzrxlczbttrcvkn, count: 4 -min: 3, max: 5, c: z, password: zzzzc, count: 4 -min: 15, max: 16, c: k, password: kkkckkdjnkkkkkkkkk, count: 14 -min: 11, max: 13, c: m, password: mmmmmmmmwmmmzm, count: 12 -min: 8, max: 13, c: p, password: ppdpptppdppxkppppppp, count: 15 -min: 1, max: 3, c: g, password: gszcmgjg, count: 3 -min: 5, max: 11, c: h, password: skbchhdbnphpbfl, count: 3 -min: 4, max: 7, c: d, password: prdjctk, count: 1 -min: 15, max: 18, c: f, password: ffcffffffffffzdffc, count: 14 -min: 7, max: 11, c: g, password: npggtwgzgtgzhx, count: 5 -min: 12, max: 14, c: m, password: mmmmmmmmmmmpmkm, count: 13 -min: 10, max: 11, c: b, password: bbbbbbbbbbb, count: 11 -min: 3, max: 16, c: k, password: kgxtvmlgpkptpghkb, count: 3 -min: 4, max: 6, c: m, password: zcwmzmvqvgmmsxj, count: 4 -min: 6, max: 15, c: m, password: mzmmccmmlmmrmlnl, count: 8 -min: 12, max: 13, c: x, password: xxxxxxxxwxxxz, count: 11 -min: 4, max: 5, c: d, password: mhvdtxfklzdpgdqdpqhd, count: 5 -min: 5, max: 10, c: g, password: nghgggggggqg, count: 9 -min: 7, max: 9, c: k, password: kkkkfkkkwk, count: 8 -min: 6, max: 7, c: c, password: cvcvczncn, count: 4 -min: 10, max: 11, c: t, password: tttqttttttv, count: 9 -min: 18, max: 20, c: h, password: hfsqhkwfhttgfhmbghhx, count: 6 -min: 6, max: 7, c: v, password: vgvvvwz, count: 4 -min: 3, max: 4, c: z, password: zzzj, count: 3 -min: 3, max: 5, c: d, password: dhqjnhgldtdzx, count: 3 -min: 3, max: 4, c: b, password: jbrbbbbbbbblwb, count: 10 -min: 12, max: 15, c: g, password: gsgfdfksrggqvgggjgt, count: 8 -min: 6, max: 11, c: p, password: pmppnpqpdppdpppphpf, count: 12 -min: 13, max: 14, c: z, password: zzzzgzbzzzzzgzz, count: 12 -min: 4, max: 12, c: c, password: ccjcrvcnwccwctcczcp, count: 10 -min: 10, max: 11, c: c, password: szcccfccfpcchqs, count: 7 -min: 10, max: 14, c: l, password: lllllltgjlnlbprlll, count: 11 -min: 12, max: 17, c: z, password: zhzzzxzpzzzfzzzqznz, count: 13 -min: 12, max: 15, c: l, password: llllllllmvlvllfll, count: 13 -min: 7, max: 12, c: c, password: ccccccncccccc, count: 12 -min: 1, max: 5, c: m, password: mhmmzmm, count: 5 -min: 11, max: 17, c: r, password: rrzrrwrrsrcrsmdrvrr, count: 11 -min: 4, max: 5, c: w, password: fwwpwfw, count: 4 -min: 7, max: 8, c: n, password: nnnnnnnk, count: 7 -min: 3, max: 18, c: n, password: rxhzsscgbnmzpvbqmzf, count: 1 -min: 4, max: 11, c: k, password: kkkkkkkkkkkxkkskkkdz, count: 16 -min: 10, max: 11, c: c, password: cccccccccckcccccc, count: 16 -min: 8, max: 15, c: r, password: zrrtfrjrrrrrjrrrrrr, count: 14 -min: 15, max: 16, c: h, password: ghgvlhwgqslhhhhxmp, count: 6 -min: 3, max: 5, c: f, password: ffffqf, count: 5 -min: 3, max: 8, c: s, password: bssmfsgspxssgjhsjdv, count: 7 -min: 3, max: 5, c: q, password: bfdhq, count: 1 -min: 4, max: 7, c: k, password: qknkkkd, count: 4 -min: 6, max: 9, c: b, password: bbbtbnfbbb, count: 7 -min: 12, max: 14, c: x, password: xxxxxxxqxkxvxxwxxcw, count: 13 -min: 3, max: 6, c: c, password: chfckc, count: 3 -min: 3, max: 8, c: h, password: kzkhgrffz, count: 1 -min: 10, max: 16, c: f, password: fffgjfffsvffdzfhfzff, count: 12 -min: 1, max: 3, c: r, password: rgcr, count: 2 -min: 16, max: 17, c: x, password: xxxxxdxxxxxxxxxxl, count: 15 -min: 6, max: 11, c: j, password: rsjcjjcbpchkvfjpml, count: 4 -min: 9, max: 10, c: s, password: sssqvsssjsss, count: 9 -min: 17, max: 18, c: v, password: vvvvvvvvvvvvvvvvvv, count: 18 -min: 3, max: 5, c: t, password: jtmtgtxxhzskzk, count: 3 -min: 1, max: 6, c: t, password: ttqkvdgs, count: 2 -min: 13, max: 16, c: q, password: qqqqqqhqqqqqzqqjqq, count: 15 -min: 10, max: 11, c: b, password: bbbbbvbbbbw, count: 9 -min: 6, max: 7, c: w, password: sgwmqwgwtbrllf, count: 3 -min: 10, max: 11, c: f, password: ffffffftffff, count: 11 -min: 12, max: 13, c: w, password: wwwwwwwwwwwzt, count: 11 -min: 18, max: 19, c: t, password: ttttttttttttttttttt, count: 19 -min: 1, max: 5, c: h, password: zghhr, count: 2 -min: 1, max: 2, c: v, password: dvjnctwvlp, count: 2 -min: 1, max: 2, c: j, password: jhzkzjh, count: 2 -min: 3, max: 6, c: h, password: rhhbhhh, count: 5 -min: 2, max: 4, c: d, password: dddrd, count: 4 -min: 17, max: 18, c: s, password: ssssssssssssssssns, count: 17 -min: 1, max: 8, c: m, password: smmmmmmmm, count: 8 -min: 2, max: 4, c: s, password: dcfsbzwqq, count: 1 -min: 11, max: 12, c: d, password: vnldqthkptgkkfdmtw, count: 2 -min: 8, max: 12, c: p, password: vpppzpprppppp, count: 10 -min: 6, max: 8, c: q, password: jqqqsphqjwrqj, count: 5 -min: 8, max: 10, c: k, password: ktkkkkdkkkk, count: 9 -min: 4, max: 12, c: v, password: nvvwvvvjzvvvv, count: 9 -min: 5, max: 6, c: z, password: zzzzzt, count: 5 -min: 1, max: 5, c: w, password: xwwwwwwww, count: 8 -min: 11, max: 14, c: p, password: pppfbpppkpftdpkpgpp, count: 11 -min: 2, max: 3, c: v, password: zrlv, count: 1 -min: 2, max: 4, c: f, password: fbwff, count: 3 -min: 5, max: 6, c: s, password: ssssmn, count: 4 -min: 11, max: 12, c: z, password: zzwztpzpjzhz, count: 6 -min: 5, max: 6, c: c, password: cccjcc, count: 5 -min: 4, max: 6, c: v, password: vvvgpvcpwv, count: 5 -min: 5, max: 6, c: j, password: jnzcpjnzjjcpsjfps, count: 5 -min: 12, max: 14, c: m, password: tpzwjjgpbbdmgxgphd, count: 1 -min: 13, max: 15, c: n, password: nznnnncnnnnnnnf, count: 12 -min: 8, max: 11, c: w, password: qsxwnlhwwxw, count: 4 -min: 6, max: 9, c: t, password: ltbdttnst, count: 4 -min: 10, max: 12, c: t, password: hnjdfgrhtgkl, count: 1 -min: 2, max: 4, c: d, password: dbddddc, count: 5 -min: 13, max: 14, c: g, password: gggggggbgggmgmgm, count: 12 -min: 4, max: 12, c: r, password: rrrzrgkrrrrkr, count: 9 -min: 14, max: 17, c: n, password: nnhnnnnnnnnnnnnnhnn, count: 17 -628 From e8f0049fa83a6d0ed813cdaee9cca9a02737e124 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Thu, 3 Dec 2020 09:38:55 -0800 Subject: [PATCH 10/52] Removed debugging output file --- 2020/day2.output | 1001 ---------------------------------------------- 1 file changed, 1001 deletions(-) delete mode 100644 2020/day2.output diff --git a/2020/day2.output b/2020/day2.output deleted file mode 100644 index d11a364..0000000 --- a/2020/day2.output +++ /dev/null @@ -1,1001 +0,0 @@ -min: 9, max: 11, c: p, password: pppppppppxblp, count: 10 -min: 2, max: 4, c: b, password: bbxbb, count: 4 -min: 3, max: 5, c: q, password: dqfqb, count: 2 -min: 5, max: 8, c: g, password: ggcgggglg, count: 7 -min: 10, max: 18, c: l, password: gllpmlgtrmnllhllrlll, count: 10 -min: 18, max: 19, c: z, password: zzzzznszzzzzzzzzzzxz, count: 17 -min: 3, max: 6, c: r, password: frrhxsnrmgmw, count: 3 -min: 1, max: 8, c: n, password: zkxhnxnzghnm, count: 3 -min: 11, max: 12, c: z, password: zzczzzztlzlzzzz, count: 11 -min: 4, max: 7, c: q, password: qqqbncqqq, count: 6 -min: 3, max: 4, c: c, password: ccvfc, count: 3 -min: 19, max: 20, c: l, password: sltlklljdlzglwllllzl, count: 11 -min: 6, max: 16, c: h, password: dhhhrhvhnhdchfsnhq, count: 8 -min: 3, max: 7, c: l, password: fllllqjlll, count: 7 -min: 8, max: 9, c: k, password: xkkjqklkm, count: 4 -min: 1, max: 2, c: l, password: llgpl, count: 3 -min: 2, max: 4, c: x, password: qkjxvqlv, count: 1 -min: 5, max: 6, c: c, password: cwcccjch, count: 5 -min: 3, max: 7, c: n, password: bnnhnwnqtdnndnncnd, count: 9 -min: 8, max: 9, c: n, password: nnrkmdnkn, count: 4 -min: 6, max: 9, c: t, password: ttttrtltptgvcd, count: 7 -min: 3, max: 4, c: h, password: hhwhhhdhhhh, count: 9 -min: 7, max: 8, c: w, password: wdwvcwwszcwwwwwq, count: 9 -min: 2, max: 4, c: n, password: vnng, count: 2 -min: 3, max: 13, c: v, password: vvvvvvvvvvvvjv, count: 13 -min: 9, max: 11, c: c, password: zcccccccccfcbccc, count: 13 -min: 10, max: 11, c: w, password: wkwwwwwwwxw, count: 9 -min: 10, max: 12, c: z, password: zzzzzjzzzrnzz, count: 10 -min: 5, max: 6, c: t, password: ttttts, count: 5 -min: 13, max: 19, c: b, password: bbmfbbbbbrbbgbbbrbbb, count: 15 -min: 8, max: 9, c: d, password: bdddvkddjbdgdd, count: 8 -min: 19, max: 20, c: m, password: mmmmmmmmmcmmmmmmmmmq, count: 18 -min: 6, max: 18, c: w, password: wwwwwwhwjwwwwwwcwjw, count: 15 -min: 4, max: 10, c: t, password: tttttttttj, count: 9 -min: 2, max: 7, c: j, password: fbdgmfjbjgjn, count: 3 -min: 7, max: 8, c: w, password: wwwwwwcww, count: 8 -min: 8, max: 12, c: c, password: cbmdccbccckjccch, count: 9 -min: 13, max: 15, c: f, password: fpfffffffffffqf, count: 13 -min: 7, max: 11, c: t, password: sbtstwdxjpclwd, count: 2 -min: 1, max: 3, c: s, password: shkkqcs, count: 2 -min: 7, max: 8, c: l, password: bdggzczl, count: 1 -min: 1, max: 6, c: g, password: zgggggglggggggw, count: 12 -min: 12, max: 16, c: h, password: hhhhhhhhhhhhhhphhhh, count: 18 -min: 8, max: 19, c: k, password: htknkhkrkdkhkpwppkk, count: 8 -min: 8, max: 10, c: k, password: kkxkkkbrkgk, count: 7 -min: 8, max: 9, c: h, password: hvhhhhhfhhv, count: 8 -min: 15, max: 16, c: x, password: xxxxxxxxxxxxxxxh, count: 15 -min: 1, max: 12, c: b, password: bgwpjbkhbptsbbb, count: 6 -min: 9, max: 10, c: j, password: pjtjpjpnbjjlsgbn, count: 5 -min: 8, max: 9, c: s, password: sscplbswssssglxs, count: 8 -min: 14, max: 15, c: j, password: jjjhjjjjjjxjjjj, count: 13 -min: 1, max: 4, c: q, password: qnqj, count: 2 -min: 3, max: 5, c: d, password: qpdddqvwbzldf, count: 4 -min: 14, max: 15, c: b, password: bbbbbbbbbbbbbbt, count: 14 -min: 1, max: 2, c: t, password: tdxt, count: 2 -min: 1, max: 7, c: g, password: dlpkvrgjzpnr, count: 1 -min: 3, max: 11, c: m, password: lmnwjjxpfmm, count: 3 -min: 3, max: 8, c: l, password: llglllllll, count: 9 -min: 2, max: 4, c: r, password: gfmrlbmsvqzrmbnd, count: 2 -min: 5, max: 9, c: s, password: srsqssssds, count: 7 -min: 8, max: 9, c: v, password: vvvvmvvvhw, count: 7 -min: 7, max: 10, c: d, password: mddwdvjdcdwdcgddd, count: 9 -min: 4, max: 7, c: k, password: fksjkkkk, count: 5 -min: 6, max: 9, c: t, password: fnrxmlwtt, count: 2 -min: 11, max: 12, c: d, password: dddddddddfmd, count: 10 -min: 4, max: 5, c: z, password: zzdzzzz, count: 6 -min: 11, max: 13, c: z, password: zzzzzzzzzzpzmzzz, count: 14 -min: 12, max: 14, c: z, password: zrgnvcrxkzzzrb, count: 4 -min: 10, max: 13, c: q, password: qpqqqqqrqxvqq, count: 9 -min: 6, max: 10, c: g, password: gglggggggzgggg, count: 12 -min: 2, max: 8, c: j, password: jfqjrdjjjjjj, count: 8 -min: 7, max: 8, c: z, password: hzlvrczjp, count: 2 -min: 4, max: 5, c: k, password: kggjkl, count: 2 -min: 4, max: 7, c: m, password: mpmmmcmm, count: 6 -min: 13, max: 14, c: x, password: xxxxxxzxxxxxxw, count: 12 -min: 6, max: 7, c: n, password: znnnnnlpjcn, count: 6 -min: 10, max: 16, c: g, password: gggzvgggntggfgghggg, count: 13 -min: 2, max: 17, c: n, password: hnchrpvzhkdsnhgcnfql, count: 3 -min: 2, max: 8, c: f, password: fkfpffff, count: 6 -min: 4, max: 7, c: s, password: qwdspspj, count: 2 -min: 6, max: 7, c: r, password: rrrrrnx, count: 5 -min: 7, max: 8, c: p, password: wpppppsp, count: 6 -min: 8, max: 10, c: m, password: mmmwmjmmmvmzpm, count: 9 -min: 6, max: 7, c: j, password: jjjjjncd, count: 5 -min: 3, max: 4, c: k, password: kxkk, count: 3 -min: 2, max: 4, c: z, password: czzmzz, count: 4 -min: 11, max: 12, c: t, password: tttttttttttzkp, count: 11 -min: 10, max: 17, c: t, password: ttttvtltdttrqtztr, count: 10 -min: 3, max: 6, c: n, password: nnnnvvxv, count: 4 -min: 7, max: 8, c: v, password: rvvpvvvpsvv, count: 7 -min: 1, max: 2, c: r, password: nkfgnr, count: 1 -min: 4, max: 11, c: c, password: cccbccclcccc, count: 10 -min: 7, max: 12, c: q, password: qpbqtqkqqqqqqq, count: 10 -min: 2, max: 7, c: m, password: mfmmmmmmxmnm, count: 9 -min: 10, max: 11, c: n, password: bnnnpnnncxrnnnn, count: 10 -min: 10, max: 14, c: n, password: nsnnnnnwljnsnnn, count: 10 -min: 5, max: 9, c: b, password: vcvcblrxbvjbtzbrmbr, count: 5 -min: 3, max: 9, c: m, password: kmmmmxmmkmmk, count: 8 -min: 2, max: 10, c: l, password: llbllgzllnlll, count: 9 -min: 5, max: 6, c: d, password: ddpdwdddxhpdqd, count: 8 -min: 12, max: 18, c: j, password: cjfbjccqgxlczjptqlk, count: 3 -min: 1, max: 3, c: z, password: mzzz, count: 3 -min: 5, max: 11, c: m, password: mdfmmmmtmgw, count: 6 -min: 2, max: 14, c: h, password: nhhnbhghhlhhchsqsr, count: 8 -min: 3, max: 4, c: t, password: jvtt, count: 2 -min: 2, max: 8, c: t, password: tttkxxtsttht, count: 7 -min: 7, max: 15, c: w, password: wwwwfwwwwwwrbww, count: 12 -min: 1, max: 4, c: j, password: rbjj, count: 2 -min: 8, max: 12, c: f, password: ffkhffffcsfzff, count: 9 -min: 10, max: 12, c: p, password: pppcgpqphprh, count: 6 -min: 10, max: 11, c: l, password: lllllllllsl, count: 10 -min: 7, max: 8, c: s, password: svsssssss, count: 8 -min: 4, max: 5, c: c, password: cvjcc, count: 3 -min: 1, max: 5, c: v, password: vcdcd, count: 1 -min: 5, max: 14, c: z, password: zzwkzztzzzzzbzzvzzz, count: 14 -min: 11, max: 12, c: s, password: sssssssssssps, count: 12 -min: 5, max: 7, c: b, password: spmtbpn, count: 1 -min: 5, max: 6, c: c, password: cccccf, count: 5 -min: 10, max: 12, c: p, password: ptpppppppppk, count: 10 -min: 4, max: 13, c: f, password: ffkffffkffflb, count: 9 -min: 2, max: 5, c: t, password: nttqftpnwbjbxmqdqv, count: 3 -min: 17, max: 18, c: w, password: wwwwtwwwwwwwwwwwkwww, count: 18 -min: 7, max: 9, c: f, password: lmrffdbffvfmf, count: 6 -min: 2, max: 5, c: h, password: hhhvzrhh, count: 5 -min: 10, max: 11, c: q, password: qmdrdfqgzql, count: 3 -min: 3, max: 11, c: g, password: ggggggggggm, count: 10 -min: 4, max: 5, c: z, password: zzzrzzp, count: 5 -min: 5, max: 7, c: w, password: wwwwkwwww, count: 8 -min: 10, max: 11, c: f, password: ffffffffffp, count: 10 -min: 6, max: 9, c: v, password: vvvvvvvmv, count: 8 -min: 4, max: 5, c: x, password: wjxxxxxtd, count: 5 -min: 12, max: 13, c: p, password: vppppppppppzbp, count: 11 -min: 2, max: 7, c: b, password: bqntbls, count: 2 -min: 15, max: 16, c: p, password: ppppppppppppzpfxn, count: 13 -min: 2, max: 3, c: b, password: bbcnbq, count: 3 -min: 10, max: 11, c: k, password: kkkklkmkkhk, count: 8 -min: 4, max: 6, c: w, password: wwwdjb, count: 3 -min: 4, max: 6, c: b, password: sczlwbnffbnxbvjbmj, count: 4 -min: 3, max: 17, c: m, password: jmmlmmmgmmmjmmmmmlmm, count: 15 -min: 6, max: 18, c: z, password: zmkwvzkpqzmzdfgdvt, count: 4 -min: 5, max: 6, c: q, password: sqwqqq, count: 4 -min: 1, max: 3, c: g, password: gjgt, count: 2 -min: 5, max: 8, c: x, password: bxcxxzxxws, count: 5 -min: 4, max: 5, c: c, password: rnscvcngbcmpddkcvctk, count: 5 -min: 7, max: 11, c: g, password: ggggglvgggngg, count: 10 -min: 2, max: 11, c: l, password: lsqlzlllllklgfl, count: 9 -min: 2, max: 9, c: m, password: cmqkbmdxp, count: 2 -min: 6, max: 7, c: w, password: wwwwwww, count: 7 -min: 8, max: 13, c: q, password: qbqzqqqqqlqqw, count: 9 -min: 3, max: 4, c: n, password: sfqnnnwvzn, count: 4 -min: 1, max: 2, c: w, password: nwww, count: 3 -min: 2, max: 4, c: v, password: hvvbqgnfl, count: 2 -min: 14, max: 15, c: m, password: gjgdmmmmkmqqcxmrsm, count: 7 -min: 2, max: 3, c: z, password: zzzx, count: 3 -min: 5, max: 13, c: q, password: qqqqdqqqqqtqjqq, count: 12 -min: 4, max: 5, c: z, password: zzzzk, count: 4 -min: 5, max: 6, c: t, password: tttttf, count: 5 -min: 3, max: 6, c: z, password: ztwzczkz, count: 4 -min: 3, max: 5, c: l, password: llpljllllllll, count: 11 -min: 2, max: 3, c: s, password: ssscp, count: 3 -min: 8, max: 10, c: d, password: dddddddwdddddwddg, count: 14 -min: 2, max: 6, c: s, password: sbssps, count: 4 -min: 1, max: 5, c: f, password: ffbfvfxbkmbhvbcfmxpf, count: 6 -min: 1, max: 6, c: j, password: gqfrmjgsgjjhcjhn, count: 4 -min: 2, max: 5, c: l, password: lwvllll, count: 5 -min: 2, max: 5, c: z, password: zkzhzb, count: 3 -min: 10, max: 11, c: s, password: wsblfxvmvsslbhfjtsws, count: 5 -min: 11, max: 17, c: f, password: fffffffxfffffffftfff, count: 18 -min: 4, max: 5, c: r, password: rrrkbrr, count: 5 -min: 7, max: 10, c: w, password: qwqwwwgzrdxww, count: 6 -min: 6, max: 8, c: s, password: ssssssscs, count: 8 -min: 4, max: 6, c: q, password: qbqwqzfqcfgkmzqxb, count: 5 -min: 6, max: 10, c: t, password: ttncfqqtttttp, count: 7 -min: 2, max: 4, c: m, password: bbzcjjqmfvln, count: 1 -min: 4, max: 7, c: n, password: cnqhntshdnnrnrnz, count: 6 -min: 7, max: 12, c: d, password: vmdndkzpmcbd, count: 3 -min: 6, max: 7, c: p, password: tpqpppzpjp, count: 6 -min: 3, max: 10, c: r, password: rgrrrpzrbrrr, count: 8 -min: 2, max: 15, c: h, password: ghbfhbgrtxrshphhl, count: 5 -min: 2, max: 6, c: j, password: pjjjjlj, count: 5 -min: 6, max: 9, c: j, password: rjrjjjwfjn, count: 5 -min: 10, max: 13, c: s, password: sssssssssjsssssss, count: 16 -min: 1, max: 6, c: c, password: crnjccgnw, count: 3 -min: 6, max: 7, c: l, password: qrllgql, count: 3 -min: 12, max: 13, c: z, password: wzzzzzzzzzzfz, count: 11 -min: 1, max: 2, c: c, password: ccclc, count: 4 -min: 2, max: 6, c: f, password: qdlflfr, count: 2 -min: 4, max: 10, c: r, password: drrrrrwrfrr, count: 8 -min: 5, max: 6, c: f, password: ffzffnf, count: 5 -min: 4, max: 6, c: p, password: hkppkbppp, count: 5 -min: 8, max: 9, c: r, password: rrrrrrrrx, count: 8 -min: 4, max: 12, c: f, password: fffffffffffwqp, count: 11 -min: 4, max: 6, c: q, password: qtqtjq, count: 3 -min: 4, max: 5, c: w, password: wwwcw, count: 4 -min: 2, max: 3, c: r, password: qrrr, count: 3 -min: 7, max: 10, c: k, password: nkpgzskkrb, count: 3 -min: 6, max: 9, c: h, password: hmsshhhwhhhhh, count: 9 -min: 2, max: 18, c: d, password: kxqddddqddsmddcdddwd, count: 12 -min: 6, max: 7, c: s, password: sssssssss, count: 9 -min: 4, max: 8, c: h, password: hhhbthhhhh, count: 8 -min: 1, max: 8, c: d, password: dtsbqtrpwdgfdzrtf, count: 3 -min: 6, max: 7, c: b, password: bbbbbwp, count: 5 -min: 5, max: 6, c: p, password: ppnpqjp, count: 4 -min: 4, max: 13, c: l, password: rtqpmllslrlxcblldqtc, count: 6 -min: 3, max: 4, c: m, password: wmmkcm, count: 3 -min: 4, max: 16, c: b, password: qkbvbvgxtlqbgmwc, count: 3 -min: 4, max: 5, c: h, password: hhhlghh, count: 5 -min: 10, max: 11, c: f, password: fjfffffffgjff, count: 10 -min: 9, max: 12, c: w, password: gwnfvwwrwswnqrvg, count: 5 -min: 4, max: 8, c: k, password: pjkkfkbqqzkmfk, count: 5 -min: 2, max: 8, c: x, password: xwxxxxxcxxx, count: 9 -min: 11, max: 19, c: w, password: wwwwwdjwwwrrwwlvwwww, count: 14 -min: 4, max: 14, c: w, password: rwqhwqwwlhpwfwwpww, count: 9 -min: 7, max: 9, c: j, password: vjjjjqdjjjjjj, count: 10 -min: 15, max: 17, c: x, password: kxrmxjvxxxvxxxzxxxf, count: 11 -min: 3, max: 10, c: p, password: pwpxppzgdrrx, count: 4 -min: 1, max: 5, c: p, password: ppppp, count: 5 -min: 10, max: 19, c: n, password: vfnwnjstnnjnqnngnzs, count: 8 -min: 2, max: 5, c: m, password: phsmq, count: 1 -min: 5, max: 6, c: m, password: mmmmxmm, count: 6 -min: 2, max: 12, c: f, password: tftgcmcblzcljsdlbvf, count: 2 -min: 6, max: 11, c: b, password: hbbbbbbbzhwbtbbhmrb, count: 11 -min: 7, max: 11, c: j, password: jjjjjjvjjjq, count: 9 -min: 3, max: 4, c: d, password: dddgddnmd, count: 6 -min: 11, max: 14, c: f, password: fxfffffftqfflffffpf, count: 14 -min: 14, max: 16, c: x, password: xxxxxcxxxxjgxxvt, count: 11 -min: 6, max: 7, c: h, password: hhhhhht, count: 6 -min: 7, max: 8, c: h, password: hhhhhhzphhhh, count: 10 -min: 5, max: 12, c: w, password: wfwwwjzwmpxwmw, count: 7 -min: 2, max: 7, c: h, password: chcjhhqhdlfshxvhz, count: 6 -min: 7, max: 15, c: h, password: hjhhjvhhhhqmhdhjh, count: 10 -min: 1, max: 2, c: f, password: bvhf, count: 1 -min: 4, max: 6, c: k, password: rkctkkm, count: 3 -min: 5, max: 6, c: n, password: nnnnnn, count: 6 -min: 10, max: 11, c: j, password: jjjjjjjcjjs, count: 9 -min: 4, max: 7, c: b, password: bbgbnkp, count: 3 -min: 2, max: 5, c: d, password: dddddjvddxdk, count: 8 -min: 11, max: 19, c: z, password: svzzgzzmzznzzzkcdzzz, count: 12 -min: 8, max: 9, c: z, password: zzzzzgzmz, count: 7 -min: 4, max: 10, c: v, password: vsvvvvnvsr, count: 6 -min: 5, max: 15, c: v, password: mvqvvkjfvwdvvdl, count: 6 -min: 13, max: 14, c: s, password: ssssssqzszssmk, count: 9 -min: 3, max: 4, c: w, password: wbwg, count: 2 -min: 10, max: 11, c: d, password: kdbdcddqddxdddd, count: 10 -min: 8, max: 9, c: t, password: tttttttntt, count: 9 -min: 2, max: 10, c: m, password: mqmmmmmmmm, count: 9 -min: 3, max: 8, c: c, password: bcswcncchpxcxcrccrx, count: 8 -min: 4, max: 10, c: q, password: qqqplwsfxgq, count: 4 -min: 15, max: 16, c: h, password: hhqhhhhhhvhhhhhthhhh, count: 17 -min: 11, max: 13, c: s, password: sssxssswsswsr, count: 9 -min: 6, max: 7, c: z, password: zzzzhvzz, count: 6 -min: 3, max: 4, c: j, password: ktjdxsjjxjtnq, count: 4 -min: 5, max: 7, c: w, password: wwxwlwwr, count: 5 -min: 2, max: 5, c: l, password: llltll, count: 5 -min: 2, max: 6, c: m, password: qmgvtmtp, count: 2 -min: 11, max: 16, c: v, password: vvvgvvlvhvvvvvvvvvgv, count: 16 -min: 2, max: 4, c: j, password: jsnjf, count: 2 -min: 11, max: 12, c: g, password: gdlcvdgzgqpg, count: 4 -min: 10, max: 12, c: x, password: rxxcxxxxxrrxx, count: 9 -min: 9, max: 12, c: n, password: nnnnnnnncdnn, count: 10 -min: 6, max: 10, c: j, password: vjjjpjhjjs, count: 6 -min: 5, max: 6, c: d, password: dcdddt, count: 4 -min: 3, max: 13, c: c, password: cccccvctcbvcvpcccc, count: 12 -min: 1, max: 7, c: d, password: ndddzzdx, count: 4 -min: 9, max: 10, c: w, password: wwwcwwwwfr, count: 7 -min: 9, max: 18, c: q, password: xjhsjqqrqpgprjmqqq, count: 6 -min: 8, max: 11, c: b, password: bprbbbwkbbbb, count: 8 -min: 4, max: 14, c: w, password: wxcwzsswmsqvfjvjzj, count: 3 -min: 5, max: 6, c: b, password: wbbmzbbm, count: 4 -min: 8, max: 13, c: f, password: lpjfsfswfffgfkff, count: 8 -min: 1, max: 3, c: x, password: vxxx, count: 3 -min: 6, max: 7, c: x, password: btxxxxcx, count: 5 -min: 6, max: 8, c: r, password: mwqrrqrrxr, count: 5 -min: 7, max: 14, c: h, password: hhhhjllhrsxtrhmbbpwh, count: 7 -min: 7, max: 10, c: f, password: phqzgfwfrpffpzq, count: 4 -min: 6, max: 17, c: d, password: ddddddddddddxdbdgdd, count: 16 -min: 5, max: 11, c: f, password: fhfnfflfhjvwvfff, count: 8 -min: 11, max: 12, c: h, password: hhgbtnkhhhhh, count: 7 -min: 2, max: 4, c: f, password: fdfgffr, count: 4 -min: 5, max: 6, c: w, password: wwwwxw, count: 5 -min: 4, max: 9, c: z, password: zbzzzczzv, count: 6 -min: 2, max: 4, c: k, password: jfpkc, count: 1 -min: 3, max: 4, c: r, password: kwgr, count: 1 -min: 4, max: 5, c: k, password: kkkks, count: 4 -min: 5, max: 6, c: r, password: rrrdrsr, count: 5 -min: 5, max: 6, c: t, password: tpwnmttclcrtt, count: 5 -min: 18, max: 19, c: t, password: ttbwxtxgfsphgtzzplbt, count: 5 -min: 1, max: 5, c: w, password: tthwwvw, count: 3 -min: 10, max: 13, c: z, password: mzzzzzwzzzzztz, count: 11 -min: 7, max: 10, c: r, password: rzrjrfpdrrrcmmrr, count: 8 -min: 2, max: 4, c: w, password: wwww, count: 4 -min: 5, max: 9, c: m, password: vksmmzdpsm, count: 3 -min: 1, max: 2, c: q, password: qqqqqqq, count: 7 -min: 1, max: 6, c: c, password: pccccn, count: 4 -min: 3, max: 8, c: r, password: pbchhhrr, count: 2 -min: 3, max: 8, c: v, password: bfdvkvdvglvn, count: 4 -min: 3, max: 6, c: h, password: hhhxhshhl, count: 6 -min: 4, max: 7, c: m, password: mkwpkwmtmm, count: 4 -min: 10, max: 11, c: g, password: ggggmggggcg, count: 9 -min: 1, max: 6, c: j, password: jjjjjw, count: 5 -min: 4, max: 10, c: z, password: zvzzxzzgzzz, count: 8 -min: 7, max: 9, c: k, password: kkkkkkkkjkkkk, count: 12 -min: 4, max: 18, c: f, password: vlnfpdzvbqhvsfmhqtf, count: 3 -min: 8, max: 11, c: s, password: sssssksshsssmhs, count: 11 -min: 2, max: 6, c: b, password: bbbbbm, count: 5 -min: 2, max: 3, c: h, password: hhvrlcf, count: 2 -min: 10, max: 19, c: c, password: mccwczqbjdlgfccnrqc, count: 6 -min: 8, max: 12, c: x, password: rxxxnxtfxcxxxpx, count: 9 -min: 13, max: 14, c: r, password: rrrnrrrrrrrrmrr, count: 13 -min: 4, max: 11, c: h, password: mhzstqhhghhhbhhh, count: 9 -min: 10, max: 11, c: f, password: fffffffffpf, count: 10 -min: 7, max: 8, c: j, password: jjjjjjmv, count: 6 -min: 5, max: 6, c: f, password: fhfffv, count: 4 -min: 3, max: 4, c: z, password: zzxtzq, count: 3 -min: 5, max: 6, c: v, password: jvszvzvvg, count: 4 -min: 9, max: 13, c: v, password: wvvgvdvvvsrjcg, count: 6 -min: 10, max: 11, c: t, password: pcttrntttttdthtxst, count: 10 -min: 1, max: 5, c: v, password: vvvvpv, count: 5 -min: 6, max: 9, c: q, password: qfqqqlqqqqq, count: 9 -min: 4, max: 8, c: f, password: ffffffmfkkfzpffffvff, count: 14 -min: 3, max: 5, c: n, password: lnmnnnnnnnn, count: 9 -min: 1, max: 5, c: k, password: kkwmdkflxtqktmcxdl, count: 4 -min: 1, max: 3, c: z, password: tnqp, count: 0 -min: 15, max: 16, c: h, password: hhhnhhhhfhhhhhjhhh, count: 15 -min: 2, max: 6, c: m, password: mmmxmb, count: 4 -min: 7, max: 12, c: q, password: qqjqhqfqwqcqqkqmql, count: 10 -min: 6, max: 10, c: s, password: ssjvrvsgsshsss, count: 8 -min: 11, max: 15, c: n, password: nnnnnnnnnnrnnnj, count: 13 -min: 14, max: 15, c: x, password: xxxxvxxxxxkxxxzx, count: 13 -min: 9, max: 14, c: b, password: bbbbbbpbbqbblbbbb, count: 14 -min: 4, max: 12, c: h, password: knthjdhlrxtpjwhnhn, count: 4 -min: 8, max: 9, c: v, password: vvvvvvvjjvvvv, count: 11 -min: 2, max: 3, c: d, password: dktdvd, count: 3 -min: 6, max: 8, c: z, password: zzzzzzzx, count: 7 -min: 10, max: 13, c: t, password: jrjfklzstpxwt, count: 2 -min: 4, max: 16, c: n, password: mngnnqnbnnwnqrdgk, count: 7 -min: 3, max: 5, c: v, password: vhqvvn, count: 3 -min: 1, max: 4, c: t, password: jhtq, count: 1 -min: 8, max: 11, c: f, password: qfffffqfffff, count: 10 -min: 14, max: 15, c: x, password: xxxxxxxxxxxxxxx, count: 15 -min: 2, max: 12, c: s, password: scsstsssmcssswgsw, count: 10 -min: 8, max: 13, c: t, password: tttttttqttttt, count: 12 -min: 8, max: 10, c: d, password: ddddddvdfbq, count: 7 -min: 9, max: 15, c: d, password: sdqpqddddjrdjnj, count: 6 -min: 17, max: 19, c: c, password: cccccdldcccpbccxgcc, count: 12 -min: 6, max: 14, c: v, password: lvvvvsvvvvvvvp, count: 11 -min: 16, max: 18, c: p, password: ppppppppppvpppppppt, count: 17 -min: 1, max: 3, c: v, password: vkvtzlvrdcvzplznltqs, count: 4 -min: 8, max: 10, c: s, password: sssssssssns, count: 10 -min: 1, max: 3, c: w, password: wcwfwxnwwp, count: 5 -min: 8, max: 10, c: v, password: kvvvvvvvvvkvvv, count: 12 -min: 7, max: 11, c: s, password: shsssssssns, count: 9 -min: 9, max: 10, c: w, password: wwwwtwwgkwww, count: 9 -min: 1, max: 2, c: x, password: vxxn, count: 2 -min: 4, max: 9, c: g, password: lkgggrcgpg, count: 5 -min: 1, max: 5, c: n, password: fjrnn, count: 2 -min: 4, max: 6, c: x, password: xtxzxxx, count: 5 -min: 18, max: 19, c: z, password: zzzzhvzhzzzzzzzzzsz, count: 15 -min: 15, max: 18, c: p, password: ppppppppppppppsppppp, count: 19 -min: 11, max: 14, c: h, password: rdhhhhhhhghhhrh, count: 11 -min: 3, max: 9, c: v, password: vvvvvvvvqvv, count: 10 -min: 4, max: 8, c: p, password: bbpmjpplp, count: 4 -min: 1, max: 15, c: n, password: qndxnnsmnrnsnnnnn, count: 10 -min: 7, max: 9, c: c, password: cccccctccc, count: 9 -min: 2, max: 6, c: m, password: xwfnmmn, count: 2 -min: 4, max: 16, c: t, password: nbttltzvhqjtcgbtttkt, count: 8 -min: 7, max: 8, c: r, password: rrlrrrrsrbr, count: 8 -min: 3, max: 5, c: h, password: hhghh, count: 4 -min: 3, max: 4, c: m, password: mmmxm, count: 4 -min: 15, max: 16, c: k, password: fckzkjskrkkkdkkl, count: 8 -min: 5, max: 6, c: c, password: cbsxmh, count: 1 -min: 1, max: 6, c: x, password: fxxxxxx, count: 6 -min: 5, max: 12, c: d, password: wdddqrdkwkmdfwd, count: 6 -min: 3, max: 10, c: s, password: smsqncrsjjdmjdlsls, count: 5 -min: 6, max: 7, c: k, password: vkkskkjkwkrkkk, count: 9 -min: 9, max: 17, c: z, password: qwzhqgrnvzzbzlhjz, count: 5 -min: 5, max: 6, c: w, password: dwwwwp, count: 4 -min: 5, max: 8, c: n, password: ncvgqnvn, count: 3 -min: 5, max: 6, c: v, password: vvnvvwvv, count: 6 -min: 3, max: 4, c: x, password: dxxxsbsxx, count: 5 -min: 8, max: 12, c: t, password: ttgtshxfmzlc, count: 3 -min: 10, max: 17, c: x, password: xthkjfxlktkbhdxzx, count: 4 -min: 5, max: 8, c: q, password: qqtqqqkqq, count: 7 -min: 4, max: 10, c: d, password: ndddgxvzswlsgdpnrc, count: 4 -min: 8, max: 11, c: h, password: bgcfhhrkhhb, count: 4 -min: 16, max: 19, c: g, password: qgdmbghrjhgcvgwpggg, count: 7 -min: 3, max: 5, c: s, password: fbsqqszkdkqzw, count: 2 -min: 9, max: 10, c: h, password: hhhhhhhhdhhh, count: 11 -min: 15, max: 17, c: b, password: bbbbbbbbbtbbbbzbbb, count: 16 -min: 11, max: 14, c: q, password: qqqhqqqqqqqqqsq, count: 13 -min: 4, max: 18, c: r, password: rhhrrpghwbqfznflrrr, count: 6 -min: 14, max: 15, c: l, password: lllllllllllllrl, count: 14 -min: 8, max: 14, c: s, password: nsfpsrsssnffssjss, count: 9 -min: 17, max: 18, c: k, password: kkkkkkkkkkklkkkkck, count: 16 -min: 1, max: 12, c: c, password: cmnccccccccktcc, count: 11 -min: 7, max: 14, c: p, password: pppppphppppppp, count: 13 -min: 1, max: 2, c: j, password: jtjq, count: 2 -min: 2, max: 6, c: w, password: wwpxxrwwwdwwh, count: 7 -min: 5, max: 12, c: p, password: zspwppnppdghqplnj, count: 6 -min: 3, max: 5, c: h, password: zhqphfth, count: 3 -min: 1, max: 3, c: q, password: xqqq, count: 3 -min: 4, max: 9, c: r, password: qrzrfgpnbj, count: 2 -min: 7, max: 8, c: q, password: qqqjqqqcqw, count: 7 -min: 4, max: 6, c: m, password: mmmmmwdmm, count: 7 -min: 4, max: 6, c: s, password: sqcssgnsrrddgshvbcs, count: 6 -min: 2, max: 6, c: m, password: mmsgtr, count: 2 -min: 3, max: 9, c: v, password: wvwvvvmvv, count: 6 -min: 3, max: 5, c: j, password: jcjvtgjjjxvjjgjbhj, count: 9 -min: 4, max: 6, c: f, password: qsffzgff, count: 4 -min: 8, max: 9, c: x, password: nxxbxwfrxx, count: 5 -min: 1, max: 7, c: m, password: mvmmmbmmljmg, count: 7 -min: 5, max: 8, c: d, password: pdcdqdddwdl, count: 6 -min: 1, max: 3, c: m, password: mmgns, count: 2 -min: 19, max: 20, c: r, password: rrrrrrrrrrrrrrrrrrxr, count: 19 -min: 1, max: 4, c: h, password: hpghbhkhhr, count: 5 -min: 5, max: 9, c: x, password: xxxxtxxxxxxxxxxx, count: 15 -min: 19, max: 20, c: p, password: qvwdwnssfckjczggpghp, count: 2 -min: 8, max: 12, c: k, password: kkkkkkkfkkkkkkkk, count: 15 -min: 10, max: 12, c: b, password: cbbbbdbbbqbkbb, count: 10 -min: 2, max: 8, c: n, password: nkkpnprnfcnnwsmndqnn, count: 8 -min: 11, max: 12, c: d, password: ddddddvddddvd, count: 11 -min: 4, max: 8, c: j, password: jjjjjjjqjjl, count: 9 -min: 1, max: 3, c: l, password: lvdlslllhllsg, count: 7 -min: 12, max: 15, c: j, password: jzjjjjjkjpjjjjqf, count: 11 -min: 6, max: 9, c: s, password: sssssssssssss, count: 13 -min: 1, max: 2, c: z, password: xzzcnjrzzzzzzz, count: 9 -min: 5, max: 6, c: h, password: hhhhhh, count: 6 -min: 7, max: 13, c: x, password: xxzxvsmxlbxpxz, count: 6 -min: 2, max: 4, c: d, password: dpnddbdfdm, count: 5 -min: 9, max: 16, c: n, password: nnnnnnnnknnnnnnr, count: 14 -min: 4, max: 5, c: n, password: nnnvnn, count: 5 -min: 13, max: 16, c: p, password: vppppppppppppppz, count: 14 -min: 3, max: 6, c: w, password: wwtwww, count: 5 -min: 7, max: 9, c: n, password: nnxnwntnnn, count: 7 -min: 4, max: 12, c: q, password: mqcnsrvqqzgqkwz, count: 4 -min: 3, max: 4, c: t, password: dwtj, count: 1 -min: 9, max: 12, c: r, password: rrrrwrrrrdrcr, count: 10 -min: 8, max: 9, c: w, password: wwtcwwjhwwww, count: 8 -min: 6, max: 8, c: w, password: wwwwwwbgw, count: 7 -min: 5, max: 15, c: f, password: pgflfgfbbvvffkfkmw, count: 6 -min: 10, max: 17, c: s, password: ssssssssshsssfsssss, count: 17 -min: 19, max: 20, c: m, password: mmbmxfmmbzqhmxmxmmmw, count: 10 -min: 11, max: 12, c: d, password: ddddddddddsd, count: 11 -min: 13, max: 14, c: f, password: fffffffffffffdf, count: 14 -min: 1, max: 6, c: n, password: nnnnnnnn, count: 8 -min: 11, max: 19, c: x, password: wmxxbxxkxxxpxxxxxxc, count: 13 -min: 2, max: 3, c: z, password: szgkqvmzwztdcxtvn, count: 3 -min: 16, max: 20, c: z, password: zpzhwdtdzhvgcpdpzzzz, count: 7 -min: 15, max: 19, c: p, password: ppmpcxppppprsgnpppg, count: 11 -min: 4, max: 5, c: x, password: rrxfxxxqx, count: 5 -min: 1, max: 2, c: q, password: rqdwn, count: 1 -min: 4, max: 6, c: x, password: pkfxqxxfxbk, count: 4 -min: 13, max: 17, c: c, password: ccccccccccccncclc, count: 15 -min: 5, max: 7, c: z, password: zzzzvhz, count: 5 -min: 5, max: 6, c: r, password: rrrnrl, count: 4 -min: 2, max: 5, c: g, password: mfgkgxhckg, count: 3 -min: 3, max: 6, c: c, password: cnmcjcccdccccv, count: 9 -min: 7, max: 11, c: t, password: dttttttrttxtt, count: 10 -min: 6, max: 9, c: p, password: ptlfppppcvsp, count: 6 -min: 3, max: 5, c: g, password: ggxkwtj, count: 2 -min: 5, max: 16, c: x, password: phzxlbhqxgxzwjwkkxp, count: 4 -min: 7, max: 8, c: s, password: wsssssmsn, count: 6 -min: 1, max: 7, c: m, password: pmgrmkmmnnm, count: 5 -min: 15, max: 16, c: n, password: nnnnnnnnnvnnnnnln, count: 15 -min: 6, max: 8, c: t, password: ttzttftst, count: 6 -min: 5, max: 7, c: g, password: ggggggggggg, count: 11 -min: 13, max: 16, c: d, password: ddddddddddddpddbdfdd, count: 17 -min: 13, max: 14, c: f, password: jclffflwlffbfvffffbn, count: 10 -min: 3, max: 4, c: j, password: xjzjjjr, count: 4 -min: 8, max: 14, c: n, password: nnnwknndnlnlnn, count: 9 -min: 6, max: 7, c: s, password: sxsssnzs, count: 5 -min: 6, max: 7, c: r, password: rrsprrjrcrb, count: 6 -min: 10, max: 11, c: w, password: qwwcwqzwrbq, count: 4 -min: 7, max: 10, c: b, password: bbbbbbzbbbb, count: 10 -min: 5, max: 6, c: d, password: ddddkd, count: 5 -min: 16, max: 17, c: d, password: ldldddddpdldldddd, count: 12 -min: 5, max: 14, c: w, password: zdtwxnxwhwwpww, count: 6 -min: 6, max: 9, c: q, password: mqqxqsqqq, count: 6 -min: 2, max: 11, c: g, password: gpggzvgggkgmcmt, count: 7 -min: 6, max: 14, c: k, password: kfkkkxkkkkkkkjkk, count: 13 -min: 2, max: 3, c: m, password: zfmm, count: 2 -min: 13, max: 17, c: k, password: kkbkkkkmkktkkkrkk, count: 13 -min: 4, max: 6, c: z, password: tzprqwzzcpj, count: 3 -min: 3, max: 4, c: w, password: gblwcxwllzpv, count: 2 -min: 3, max: 5, c: d, password: ddcddd, count: 5 -min: 9, max: 13, c: r, password: rrfjmrcsrrwvrrk, count: 7 -min: 11, max: 17, c: m, password: dgwrmqjmclmczrlwf, count: 3 -min: 1, max: 4, c: v, password: vvhvvv, count: 5 -min: 10, max: 13, c: c, password: clhccbcvbvcfcccqccc, count: 11 -min: 11, max: 13, c: s, password: sssssssssssss, count: 13 -min: 6, max: 7, c: k, password: skkckkk, count: 5 -min: 2, max: 5, c: m, password: mfffq, count: 1 -min: 3, max: 5, c: x, password: jxbxx, count: 3 -min: 1, max: 2, c: c, password: ctcc, count: 3 -min: 5, max: 8, c: q, password: qqqqgqqqq, count: 8 -min: 11, max: 13, c: q, password: hqqbqqqqqqbqqqqqbk, count: 13 -min: 9, max: 11, c: q, password: qqqqqqqqqql, count: 10 -min: 15, max: 20, c: q, password: qqqqqqqqnqqqqqqqqqqq, count: 19 -min: 5, max: 7, c: g, password: gzngbvggmlzzrgx, count: 5 -min: 2, max: 10, c: n, password: zjknggzlvnxtbwnhmf, count: 3 -min: 2, max: 13, c: c, password: cccccccccccct, count: 12 -min: 4, max: 8, c: c, password: cccccccbcccc, count: 11 -min: 3, max: 5, c: k, password: kdkkz, count: 3 -min: 8, max: 10, c: h, password: nchthhghhjhjh, count: 7 -min: 10, max: 11, c: l, password: wllllllllplxllnjj, count: 11 -min: 14, max: 17, c: q, password: qqhqqqqqqtqvqcqqqrq, count: 14 -min: 5, max: 9, c: d, password: dddddddrz, count: 7 -min: 13, max: 14, c: z, password: zzzzzzzzzzzzzm, count: 13 -min: 7, max: 9, c: t, password: tttttctwlttt, count: 9 -min: 6, max: 13, c: w, password: dwcwdtwrwccwwl, count: 6 -min: 10, max: 11, c: h, password: hhhhhwhhmmhhhh, count: 11 -min: 7, max: 9, c: t, password: tttttjtttt, count: 9 -min: 12, max: 17, c: n, password: nnnnknnfpnnwncnnjn, count: 12 -min: 5, max: 6, c: c, password: zccccc, count: 5 -min: 11, max: 13, c: s, password: ssssksxssssss, count: 11 -min: 9, max: 17, c: q, password: qqqqcfbqrqqcqzqqlqqq, count: 13 -min: 3, max: 4, c: m, password: dmml, count: 2 -min: 4, max: 6, c: v, password: slvvvln, count: 3 -min: 4, max: 5, c: n, password: nnbmnn, count: 4 -min: 2, max: 7, c: h, password: whhhhhjvfhhh, count: 8 -min: 2, max: 5, c: s, password: slhss, count: 3 -min: 4, max: 5, c: q, password: zbhqhqgqdq, count: 4 -min: 2, max: 6, c: p, password: pjtxqp, count: 2 -min: 7, max: 9, c: h, password: hhhhhhkhh, count: 8 -min: 7, max: 8, c: w, password: fgvwcwws, count: 3 -min: 10, max: 13, c: d, password: ddddxhdddddvhdddd, count: 13 -min: 7, max: 16, c: m, password: mmnznmmwmwrmqzrqbmpr, count: 7 -min: 12, max: 13, c: v, password: vvvvvvvvvzvvjv, count: 12 -min: 18, max: 19, c: g, password: mztkzhgmndnffztwqfg, count: 2 -min: 7, max: 8, c: j, password: jjjcjjvjjjjpjjjjjjj, count: 16 -min: 7, max: 10, c: s, password: sssssssssz, count: 9 -min: 18, max: 20, c: s, password: sssssssssssssssssssg, count: 19 -min: 1, max: 4, c: r, password: trrrr, count: 4 -min: 2, max: 16, c: r, password: mrrrrrrhrcrrfcpqrh, count: 10 -min: 5, max: 13, c: n, password: nnbljfchnnnnnj, count: 7 -min: 1, max: 6, c: v, password: vvvvvmvv, count: 7 -min: 7, max: 15, c: q, password: szqhbkqxppcbkxmc, count: 2 -min: 9, max: 10, c: l, password: gllllvllsvll, count: 8 -min: 1, max: 4, c: m, password: mxldw, count: 1 -min: 5, max: 9, c: x, password: xxxxxxxxj, count: 8 -min: 11, max: 16, c: t, password: ttttttttwttttttfl, count: 14 -min: 7, max: 12, c: j, password: sjjzpjjjjljhj, count: 8 -min: 1, max: 5, c: x, password: wmplxj, count: 1 -min: 2, max: 6, c: z, password: zzxzzrzqplrh, count: 5 -min: 4, max: 6, c: w, password: cqbwwbww, count: 4 -min: 14, max: 15, c: l, password: llllltllllllllw, count: 13 -min: 3, max: 4, c: m, password: mhmvvz, count: 2 -min: 3, max: 4, c: w, password: wwmw, count: 3 -min: 1, max: 4, c: c, password: ccchpccc, count: 6 -min: 6, max: 10, c: p, password: pppppppppqprbppppp, count: 15 -min: 9, max: 15, c: h, password: hhhjcrhhhhhhchhjht, count: 12 -min: 8, max: 11, c: g, password: gggggggkggggggggg, count: 16 -min: 4, max: 9, c: h, password: hhkqxhhhlh, count: 6 -min: 7, max: 8, c: f, password: mlfdfrmfbfttmffqfff, count: 9 -min: 7, max: 9, c: t, password: nttttttvsn, count: 6 -min: 6, max: 9, c: h, password: hhhhbhvhph, count: 7 -min: 4, max: 5, c: f, password: hhcdf, count: 1 -min: 3, max: 4, c: k, password: kfxkcr, count: 2 -min: 1, max: 4, c: z, password: zzml, count: 2 -min: 3, max: 5, c: f, password: cjjffbzffqfsbm, count: 5 -min: 4, max: 5, c: f, password: ffdfh, count: 3 -min: 6, max: 17, c: h, password: hhhhhhhhhhhhhhhhrh, count: 17 -min: 8, max: 10, c: d, password: qdddzddddzdd, count: 9 -min: 7, max: 8, c: j, password: nfxxthqj, count: 1 -min: 2, max: 4, c: n, password: nnnc, count: 3 -min: 3, max: 5, c: v, password: vlvzx, count: 2 -min: 6, max: 10, c: n, password: nnnnnnnnns, count: 9 -min: 11, max: 13, c: q, password: bzhwhbvwqffzs, count: 1 -min: 3, max: 6, c: c, password: gccmcc, count: 4 -min: 2, max: 5, c: m, password: xmbgm, count: 2 -min: 2, max: 11, c: g, password: tgztmzzbgjzc, count: 2 -min: 2, max: 5, c: j, password: jsjbj, count: 3 -min: 3, max: 4, c: v, password: vvljvvv, count: 5 -min: 3, max: 6, c: p, password: pxwcnwmp, count: 2 -min: 2, max: 7, c: j, password: ndjnzmjklxqwpkpnwb, count: 2 -min: 1, max: 20, c: s, password: slssswsnssscgbssxsdg, count: 11 -min: 3, max: 4, c: r, password: rrrfjc, count: 3 -min: 5, max: 16, c: t, password: ttntptttsqtttpwtgbt, count: 11 -min: 3, max: 4, c: g, password: fxgg, count: 2 -min: 13, max: 17, c: l, password: llltllllllllvllllvrl, count: 16 -min: 5, max: 8, c: q, password: vxfpqhqd, count: 2 -min: 4, max: 8, c: c, password: cvqcwkccp, count: 4 -min: 5, max: 11, c: x, password: kxqkghvxxdqfwxxkxx, count: 7 -min: 4, max: 5, c: t, password: tttht, count: 4 -min: 8, max: 11, c: n, password: mnnpnnpsnqdknnvsh, count: 7 -min: 1, max: 4, c: g, password: gggngpdggv, count: 6 -min: 5, max: 6, c: s, password: ssssss, count: 6 -min: 4, max: 7, c: d, password: mddfddk, count: 4 -min: 7, max: 8, c: f, password: fffffffb, count: 7 -min: 4, max: 11, c: x, password: cbmcvvvvxgn, count: 1 -min: 14, max: 16, c: d, password: vdddkddpddddllrddddd, count: 14 -min: 8, max: 9, c: h, password: qhhhsnxhjmzhlhdjxhf, count: 7 -min: 5, max: 13, c: f, password: fxfhlqsffxfgwpcz, count: 5 -min: 14, max: 16, c: g, password: jggggnngggngggggjggg, count: 15 -min: 1, max: 5, c: z, password: rzgzt, count: 2 -min: 3, max: 6, c: f, password: fffgrv, count: 3 -min: 3, max: 4, c: w, password: zwwtwdw, count: 4 -min: 9, max: 12, c: g, password: dkmhhvhjgsvqglbrr, count: 2 -min: 4, max: 5, c: g, password: gbrtx, count: 1 -min: 1, max: 5, c: r, password: xrrrr, count: 4 -min: 2, max: 5, c: d, password: ddddddddddddddd, count: 15 -min: 4, max: 5, c: j, password: jjvjz, count: 3 -min: 2, max: 4, c: b, password: blbbbt, count: 4 -min: 16, max: 17, c: b, password: bbbbbbbbbbblbbbzbc, count: 15 -min: 8, max: 13, c: l, password: lljlqlkslqllllll, count: 11 -min: 6, max: 15, c: g, password: wgfgzggggggbtch, count: 8 -min: 4, max: 13, c: w, password: cwvbtpnjdkvww, count: 3 -min: 8, max: 10, c: x, password: xtdxxxxxxhxxx, count: 10 -min: 3, max: 6, c: p, password: pprpppp, count: 6 -min: 15, max: 17, c: p, password: ppppppppppppppkpppp, count: 18 -min: 1, max: 3, c: w, password: wnwpwwbllb, count: 4 -min: 3, max: 5, c: m, password: mxqdq, count: 1 -min: 13, max: 16, c: s, password: hsrsssqssssscgssss, count: 13 -min: 1, max: 2, c: c, password: zccccm, count: 4 -min: 5, max: 8, c: r, password: rrrrkrrm, count: 6 -min: 5, max: 6, c: j, password: njjkjjsj, count: 5 -min: 5, max: 10, c: r, password: rrrrhrrrrr, count: 9 -min: 5, max: 12, c: x, password: xmxwxnmxsldlrpgxxxc, count: 7 -min: 4, max: 6, c: z, password: ztzwfzj, count: 3 -min: 11, max: 15, c: w, password: wwcwwwwwwwzwwww, count: 13 -min: 5, max: 7, c: c, password: cpccccnd, count: 5 -min: 1, max: 16, c: q, password: qqvhqhnpqscqqldqbzh, count: 7 -min: 8, max: 9, c: s, password: kfpdswzssssqssscms, count: 9 -min: 2, max: 16, c: l, password: hppbqldllnlljvflltl, count: 8 -min: 4, max: 12, c: c, password: cccccccccccpccc, count: 14 -min: 5, max: 6, c: r, password: rrrrqb, count: 4 -min: 11, max: 12, c: f, password: ffffdffffmfdkff, count: 11 -min: 5, max: 6, c: k, password: lhkkkf, count: 3 -min: 12, max: 15, c: z, password: bzzzzzzzzstzzzz, count: 12 -min: 5, max: 13, c: c, password: kgsscwsfzcbwchwk, count: 3 -min: 11, max: 18, c: m, password: wmmjbmfpvmmmthfwpsxf, count: 6 -min: 7, max: 14, c: m, password: mmmfmmtqmmmmmmmmrc, count: 13 -min: 14, max: 15, c: g, password: wbqfggngtbqvpqp, count: 3 -min: 10, max: 11, c: k, password: kkkvxktjtkbjkkkk, count: 9 -min: 2, max: 4, c: b, password: wbtkp, count: 1 -min: 4, max: 10, c: v, password: vvvvbffvmtvvz, count: 7 -min: 6, max: 8, c: m, password: vtvgmmbc, count: 2 -min: 1, max: 7, c: d, password: hddsnzd, count: 3 -min: 2, max: 3, c: d, password: rndxchftldndc, count: 3 -min: 2, max: 11, c: z, password: zzcwbxkzzqzzp, count: 6 -min: 5, max: 6, c: q, password: wqqqjq, count: 4 -min: 9, max: 10, c: d, password: ddddddpdcdd, count: 9 -min: 1, max: 12, c: g, password: ggfggggggggbn, count: 10 -min: 4, max: 5, c: v, password: vvvrvv, count: 5 -min: 12, max: 14, c: r, password: rrrrrrrrrrrqrr, count: 13 -min: 6, max: 10, c: s, password: sssshvssss, count: 8 -min: 7, max: 10, c: g, password: gqgzgggksggggdqghs, count: 10 -min: 8, max: 9, c: c, password: ccccccccf, count: 8 -min: 13, max: 18, c: j, password: gfjjjjjjjjgjhwjjch, count: 11 -min: 11, max: 15, c: m, password: mmmmmmmmmmmmmmm, count: 15 -min: 2, max: 4, c: s, password: ssqsr, count: 3 -min: 7, max: 8, c: v, password: vxxvbfdgvvgvtw, count: 5 -min: 2, max: 7, c: x, password: xwxxxxx, count: 6 -min: 3, max: 5, c: p, password: pzppfp, count: 4 -min: 1, max: 2, c: z, password: zfzwpzpxzc, count: 4 -min: 6, max: 7, c: r, password: vrrxrrnrb, count: 5 -min: 3, max: 4, c: f, password: nvftvrjsgxszkfsffg, count: 4 -min: 1, max: 5, c: w, password: kndqwltttskcwtzqt, count: 2 -min: 1, max: 9, c: z, password: zzzzzzzzzz, count: 10 -min: 10, max: 11, c: v, password: vvvvvvvvvvv, count: 11 -min: 1, max: 5, c: m, password: gmjhm, count: 2 -min: 7, max: 11, c: j, password: sdjjpjjjdgnccjjjsq, count: 8 -min: 1, max: 6, c: m, password: rrmcmmmmmbm, count: 7 -min: 1, max: 6, c: n, password: nlclfggwnm, count: 2 -min: 3, max: 7, c: s, password: clfnmssns, count: 3 -min: 3, max: 7, c: m, password: tqjmmmx, count: 3 -min: 13, max: 14, c: n, password: nfnvkntnlnnnxfwlnnnn, count: 11 -min: 3, max: 4, c: p, password: xphp, count: 2 -min: 8, max: 9, c: n, password: nnnlnnnzn, count: 7 -min: 11, max: 12, c: h, password: hhhhhhhdhhhhh, count: 12 -min: 1, max: 4, c: p, password: pjgsphp, count: 3 -min: 3, max: 9, c: f, password: pvfnfmfrcffffjf, count: 8 -min: 15, max: 16, c: d, password: dddddddddzddldgdd, count: 14 -min: 2, max: 4, c: b, password: bvztgnzbpr, count: 2 -min: 3, max: 7, c: w, password: wgwhmpwwwlwzzhwnv, count: 7 -min: 5, max: 9, c: n, password: nmznnvnnsznnw, count: 7 -min: 4, max: 6, c: f, password: zqffsnffdlbkt, count: 4 -min: 6, max: 7, c: s, password: sssssss, count: 7 -min: 2, max: 5, c: q, password: kqlqqmv, count: 3 -min: 11, max: 14, c: q, password: pjqrzjfdgmqzpd, count: 2 -min: 17, max: 18, c: s, password: sssssssssssssssssj, count: 17 -min: 8, max: 12, c: x, password: zxxxpxxxxxxt, count: 9 -min: 2, max: 4, c: h, password: hqhhhwfshp, count: 5 -min: 1, max: 9, c: b, password: qzwgfbzjvt, count: 1 -min: 8, max: 10, c: c, password: cccccccccn, count: 9 -min: 3, max: 5, c: n, password: nnnkwn, count: 4 -min: 4, max: 6, c: m, password: zmmhdzmmx, count: 4 -min: 7, max: 13, c: v, password: vvvvvnvvvvvvsvv, count: 13 -min: 1, max: 12, c: z, password: zzvzxzfzzrzm, count: 7 -min: 6, max: 11, c: p, password: ppppplppppvppppfp, count: 14 -min: 1, max: 5, c: s, password: sjsss, count: 4 -min: 2, max: 19, c: w, password: wwwwwwwwwwwwwwwwwwcw, count: 19 -min: 5, max: 6, c: k, password: zxlkrkbcrcwkdqtkkw, count: 5 -min: 1, max: 4, c: w, password: hjjbzqwnpjrbglkr, count: 1 -min: 8, max: 9, c: n, password: sznnljnqn, count: 4 -min: 7, max: 13, c: k, password: dwkpnjkdkglnm, count: 3 -min: 14, max: 20, c: x, password: xzxrxxsxxxxxxxxxxxjx, count: 16 -min: 4, max: 7, c: w, password: rtrwdvww, count: 3 -min: 14, max: 18, c: m, password: mmmpmmmmmmmmmlmnmq, count: 14 -min: 3, max: 4, c: z, password: zzxz, count: 3 -min: 8, max: 10, c: z, password: zzzzzzzzzjz, count: 10 -min: 11, max: 14, c: v, password: vcvwvxvcslbvvhv, count: 7 -min: 4, max: 8, c: j, password: jgjjbrjhp, count: 4 -min: 5, max: 6, c: d, password: dddddm, count: 5 -min: 4, max: 5, c: n, password: nnnzn, count: 4 -min: 15, max: 16, c: t, password: ttttttttttttttnc, count: 14 -min: 5, max: 8, c: b, password: bbtbspvbbgllcrgxd, count: 5 -min: 8, max: 9, c: w, password: wwwwwwwqw, count: 8 -min: 3, max: 5, c: j, password: vbjmxwjgjfrzttznwc, count: 3 -min: 12, max: 14, c: l, password: llllllllllnglzlwbl, count: 13 -min: 2, max: 4, c: f, password: ntffj, count: 2 -min: 2, max: 4, c: c, password: gvccrcc, count: 4 -min: 19, max: 20, c: w, password: wwwwwwwwwwwwwwwwwwpw, count: 19 -min: 1, max: 3, c: k, password: klwgkc, count: 2 -min: 3, max: 9, c: s, password: qsmlssskpsbsscs, count: 8 -min: 8, max: 9, c: j, password: jjjjjjjdj, count: 8 -min: 5, max: 9, c: s, password: bszlpsssss, count: 6 -min: 13, max: 14, c: l, password: llxllhlllllllllll, count: 15 -min: 1, max: 6, c: s, password: ssssscs, count: 6 -min: 7, max: 8, c: v, password: pbvptdvv, count: 3 -min: 10, max: 15, c: v, password: vvvvvvgvvvvvvvcv, count: 14 -min: 4, max: 5, c: k, password: kkcskfldskdc, count: 4 -min: 13, max: 14, c: v, password: vvvvvvvvvvvvvgv, count: 14 -min: 3, max: 7, c: n, password: hnjnnnnnsnfp, count: 7 -min: 3, max: 8, c: m, password: mtmjhrzzllqml, count: 3 -min: 9, max: 11, c: w, password: wwwwwwwwwwxw, count: 11 -min: 10, max: 20, c: g, password: pkvgkfvmxgkpjjhtqvcg, count: 3 -min: 8, max: 11, c: w, password: wwwwwwzwwwdw, count: 10 -min: 5, max: 7, c: r, password: rrrrrrb, count: 6 -min: 2, max: 7, c: b, password: sbldlwvcb, count: 2 -min: 10, max: 17, c: v, password: vvvvvvqgcvvkdvsvvjv, count: 12 -min: 4, max: 5, c: d, password: tkddnddzqpdfdddd, count: 9 -min: 10, max: 12, c: p, password: npppppppppfm, count: 9 -min: 1, max: 12, c: t, password: wttttttttttttt, count: 13 -min: 4, max: 5, c: f, password: qfffz, count: 3 -min: 11, max: 14, c: p, password: ppppppppppppgvpcp, count: 14 -min: 6, max: 8, c: w, password: qswwwrwwmww, count: 7 -min: 9, max: 15, c: g, password: txgchzlpgggdhgggbg, count: 8 -min: 2, max: 10, c: h, password: hthhzhhhshhh, count: 9 -min: 5, max: 8, c: l, password: lllllzkk, count: 5 -min: 17, max: 18, c: l, password: nlllllllllllllllvll, count: 17 -min: 3, max: 6, c: c, password: zdwcjcccdqct, count: 5 -min: 8, max: 17, c: m, password: mmmmmmmmmmmmmmmmjm, count: 17 -min: 10, max: 12, c: c, password: ccccncrccccb, count: 9 -min: 4, max: 12, c: j, password: jjjbjjjjjjnwjj, count: 11 -min: 2, max: 6, c: h, password: chbhhfc, count: 3 -min: 5, max: 6, c: c, password: cccpncc, count: 5 -min: 6, max: 7, c: m, password: dmwmkmphmmdmm, count: 7 -min: 6, max: 7, c: k, password: rxwkmkv, count: 2 -min: 1, max: 5, c: f, password: fzgfl, count: 2 -min: 4, max: 7, c: x, password: dxkmxhb, count: 2 -min: 1, max: 5, c: f, password: hhfzfpfffffsff, count: 9 -min: 1, max: 7, c: s, password: sssslsvv, count: 5 -min: 3, max: 7, c: w, password: wgwwwsh, count: 4 -min: 12, max: 15, c: d, password: mdsdbkltdvthvfjdddn, count: 6 -min: 16, max: 18, c: x, password: xxxxxxxxxxxxxxxxtl, count: 16 -min: 5, max: 19, c: x, password: xwxxxxxxxxxxxxxxbpn, count: 15 -min: 3, max: 5, c: h, password: hhrfh, count: 3 -min: 8, max: 10, c: g, password: ggggggggggkgg, count: 12 -min: 3, max: 8, c: c, password: cccccccmc, count: 8 -min: 5, max: 7, c: r, password: wrrrxrrr, count: 6 -min: 7, max: 8, c: p, password: phpprdslbpxprpg, count: 6 -min: 17, max: 19, c: z, password: zzzzvzzzzzdzzzzzzzg, count: 16 -min: 2, max: 4, c: x, password: kxxxxxm, count: 5 -min: 2, max: 11, c: w, password: gwwzpwwwwwplrqfh, count: 7 -min: 6, max: 9, c: t, password: qtcttttgf, count: 5 -min: 9, max: 12, c: g, password: gggggggggggsg, count: 12 -min: 3, max: 6, c: n, password: fzmnxb, count: 1 -min: 5, max: 9, c: x, password: pqxxxwdtn, count: 3 -min: 5, max: 6, c: j, password: jjjjjkq, count: 5 -min: 10, max: 12, c: h, password: hhhhhdhhhzhh, count: 10 -min: 1, max: 4, c: g, password: gskgk, count: 2 -min: 3, max: 5, c: c, password: ccccj, count: 4 -min: 1, max: 10, c: m, password: wmxsgmzmrzmrmmmjmmct, count: 9 -min: 5, max: 10, c: p, password: lmpppvptdgpjpwfwpp, count: 8 -min: 2, max: 4, c: z, password: bzgm, count: 1 -min: 6, max: 7, c: d, password: ddzdddj, count: 5 -min: 3, max: 7, c: r, password: gchrfwr, count: 2 -min: 4, max: 7, c: k, password: kkcvkkkkkk, count: 8 -min: 8, max: 12, c: t, password: tpwtttctvtttftpt, count: 10 -min: 11, max: 12, c: c, password: ccccccxcdncbwcc, count: 10 -min: 2, max: 10, c: p, password: jwwxlppppppnpn, count: 7 -min: 9, max: 16, c: w, password: chmwwwwwjwrwjwzjww, count: 10 -min: 1, max: 6, c: j, password: jkqjjbj, count: 4 -min: 5, max: 8, c: k, password: kkkkkklhkk, count: 8 -min: 3, max: 5, c: q, password: qqqqc, count: 4 -min: 16, max: 17, c: x, password: xxxxxxxxxxxxxxxtg, count: 15 -min: 4, max: 9, c: f, password: fmfkcfffffkcfmfhnzf, count: 10 -min: 5, max: 6, c: z, password: zhzzlz, count: 4 -min: 4, max: 17, c: k, password: kbwmwvkkvvhxkkkckqvk, count: 8 -min: 3, max: 5, c: d, password: dddmmdt, count: 4 -min: 4, max: 10, c: m, password: mmmmmmmmms, count: 9 -min: 5, max: 6, c: g, password: ghgggpj, count: 4 -min: 1, max: 5, c: c, password: cccck, count: 4 -min: 3, max: 7, c: z, password: zzjzzzzz, count: 7 -min: 2, max: 7, c: v, password: xrprnvvtsrgsk, count: 2 -min: 1, max: 5, c: s, password: sqqsn, count: 2 -min: 3, max: 5, c: j, password: xwpnj, count: 1 -min: 5, max: 7, c: v, password: vvvvvvqmv, count: 7 -min: 4, max: 5, c: j, password: jjjjzjjjjljjc, count: 10 -min: 2, max: 4, c: h, password: hghh, count: 3 -min: 3, max: 5, c: n, password: fnnpc, count: 2 -min: 16, max: 20, c: d, password: dddddddzdddddddpdddd, count: 18 -min: 3, max: 4, c: t, password: tnpt, count: 2 -min: 2, max: 7, c: f, password: fxffffkff, count: 7 -min: 6, max: 9, c: b, password: bbbhbbwhbbrblmtb, count: 9 -min: 7, max: 10, c: m, password: msmxmrnmrmmmm, count: 8 -min: 3, max: 4, c: r, password: rrzrr, count: 4 -min: 7, max: 8, c: m, password: mgmmmmjmm, count: 7 -min: 2, max: 3, c: l, password: lmll, count: 3 -min: 2, max: 6, c: h, password: cngphhhbfpvvsgrqhhzq, count: 5 -min: 6, max: 8, c: d, password: dddddddg, count: 7 -min: 12, max: 15, c: p, password: vfjxwpcpdvpnjwp, count: 4 -min: 12, max: 17, c: m, password: mzfmmsvfxmqsmcfjmwjb, count: 6 -min: 15, max: 19, c: b, password: bbbbbfbbbbbsbbmbbbbb, count: 17 -min: 7, max: 8, c: n, password: qdnjnnnpvmfnn, count: 6 -min: 6, max: 8, c: l, password: llllllll, count: 8 -min: 3, max: 4, c: n, password: nnbdh, count: 2 -min: 11, max: 12, c: w, password: hprdhfrpvcwbgwjcw, count: 3 -min: 2, max: 7, c: r, password: jrfrbjrhrw, count: 4 -min: 1, max: 6, c: v, password: fvzknvvv, count: 4 -min: 10, max: 11, c: t, password: tttstdhttqrttt, count: 9 -min: 5, max: 14, c: f, password: fxffnffffnfffff, count: 12 -min: 10, max: 13, c: q, password: qqqqqqqqqjqqqqq, count: 14 -min: 1, max: 5, c: v, password: tnvfvxvjvbvjk, count: 5 -min: 4, max: 5, c: c, password: ccccpc, count: 5 -min: 4, max: 6, c: t, password: tttttktttt, count: 9 -min: 1, max: 2, c: r, password: rwrsq, count: 2 -min: 11, max: 12, c: c, password: cccggjcccccr, count: 8 -min: 11, max: 16, c: g, password: gwggggggggqggbgggfg, count: 15 -min: 12, max: 14, c: b, password: bbggzhxsjjsbsf, count: 3 -min: 5, max: 7, c: r, password: kjdwpfbmcptrslrrr, count: 4 -min: 1, max: 2, c: l, password: lvbl, count: 2 -min: 6, max: 11, c: c, password: hsksgzhccbccbdfnzqcv, count: 5 -min: 6, max: 7, c: m, password: gmmmmmc, count: 5 -min: 1, max: 2, c: h, password: hhhh, count: 4 -min: 1, max: 3, c: g, password: rggg, count: 3 -min: 4, max: 8, c: z, password: rzzzzfbwzxkzzz, count: 8 -min: 3, max: 6, c: w, password: wwwwww, count: 6 -min: 3, max: 4, c: g, password: ggwtg, count: 3 -min: 9, max: 11, c: v, password: wxfltmvjvjm, count: 2 -min: 2, max: 4, c: l, password: llck, count: 2 -min: 2, max: 3, c: m, password: mmkgpdwzdm, count: 3 -min: 2, max: 5, c: d, password: bdjhdhjldzh, count: 3 -min: 10, max: 12, c: j, password: jnjlmjjjjpcdkjjjx, count: 9 -min: 3, max: 9, c: q, password: qqzqqqqqqqqqq, count: 12 -min: 4, max: 8, c: d, password: ddzwdpddd, count: 6 -min: 3, max: 7, c: m, password: mzmbsmcjgmpmmdkmr, count: 7 -min: 8, max: 13, c: q, password: xrxvgqdvvmjhhgdfz, count: 1 -min: 3, max: 12, c: z, password: zzjzzzzzzzzzzz, count: 13 -min: 5, max: 10, c: k, password: jkkkmkkkmkk, count: 8 -min: 6, max: 7, c: m, password: mmllmmtm, count: 5 -min: 17, max: 19, c: c, password: ccccccccccccccnckccc, count: 18 -min: 6, max: 9, c: w, password: wwwtbrwwwxww, count: 8 -min: 7, max: 9, c: d, password: wfdkwddsdsmdbswv, count: 5 -min: 11, max: 12, c: g, password: ggggggggggbgg, count: 12 -min: 13, max: 14, c: j, password: prjjdjjjjjjjcjjj, count: 12 -min: 3, max: 5, c: j, password: jjlljv, count: 3 -min: 3, max: 4, c: h, password: hrlh, count: 2 -min: 6, max: 7, c: l, password: hplnxlsjnwxzllllljcj, count: 7 -min: 4, max: 5, c: g, password: gfgml, count: 2 -min: 4, max: 5, c: z, password: zwkznzn, count: 3 -min: 4, max: 11, c: n, password: stnzhznnfnqcnn, count: 6 -min: 2, max: 5, c: h, password: hmzhh, count: 3 -min: 4, max: 6, c: w, password: wwbwwc, count: 4 -min: 4, max: 11, c: w, password: vmwwrxpkwcp, count: 3 -min: 4, max: 8, c: t, password: thxttstmtbstcvjtlflh, count: 7 -min: 6, max: 8, c: v, password: hvvkvvhfm, count: 4 -min: 16, max: 18, c: b, password: tbbbbbbbbbbbbbbbbr, count: 16 -min: 8, max: 10, c: f, password: fffffffcfl, count: 8 -min: 13, max: 15, c: r, password: rrrdrrrrrrrrrbr, count: 13 -min: 8, max: 14, c: t, password: ztstxttttttttwz, count: 10 -min: 8, max: 12, c: j, password: jgjjjjgjjjjx, count: 9 -min: 5, max: 6, c: m, password: nmqjdmgfqqmcmmvndztl, count: 5 -min: 2, max: 6, c: v, password: vwvvvvtv, count: 6 -min: 15, max: 16, c: l, password: llllllllllllllll, count: 16 -min: 3, max: 10, c: q, password: qqqqqqqqqxqq, count: 11 -min: 8, max: 9, c: j, password: rggxhvjjjk, count: 3 -min: 1, max: 3, c: p, password: pqhp, count: 2 -min: 4, max: 11, c: z, password: nkjddzczjrzktvnckmg, count: 3 -min: 5, max: 12, c: r, password: tfrdrswgwnbc, count: 2 -min: 8, max: 13, c: r, password: rrrrrrrrrrrrrr, count: 14 -min: 13, max: 18, c: x, password: xxmxvxxxxxxxhrxxxc, count: 13 -min: 7, max: 8, c: z, password: zzkzzzzw, count: 6 -min: 4, max: 8, c: m, password: mmmqmmskqlmmgm, count: 8 -min: 1, max: 3, c: w, password: bmwg, count: 1 -min: 1, max: 4, c: z, password: vzzzzzwz, count: 6 -min: 3, max: 4, c: d, password: dqdw, count: 2 -min: 2, max: 9, c: z, password: hzhqpndtllsw, count: 1 -min: 10, max: 13, c: t, password: tttttttttttbjb, count: 11 -min: 12, max: 14, c: r, password: rrrxrrsrrrgfrrr, count: 11 -min: 12, max: 19, c: g, password: hdxnlgglxwrgzkggcwp, count: 5 -min: 3, max: 4, c: x, password: qxjx, count: 2 -min: 1, max: 2, c: r, password: rrpdlqhcnwwr, count: 3 -min: 5, max: 11, c: c, password: vdbzvccdccldsjcq, count: 5 -min: 4, max: 6, c: k, password: kxkwkk, count: 4 -min: 16, max: 18, c: k, password: kkkknkkkkkkkfkkkkx, count: 15 -min: 1, max: 2, c: q, password: tqtghddbk, count: 1 -min: 7, max: 8, c: g, password: ggcgggvgg, count: 7 -min: 13, max: 19, c: d, password: ddddddfjdddddfddddd, count: 16 -min: 9, max: 15, c: z, password: pzhzzzzzqpzzzzzz, count: 12 -min: 4, max: 5, c: l, password: lclld, count: 3 -min: 2, max: 15, c: r, password: jrrmtzrxlczbttrcvkn, count: 4 -min: 3, max: 5, c: z, password: zzzzc, count: 4 -min: 15, max: 16, c: k, password: kkkckkdjnkkkkkkkkk, count: 14 -min: 11, max: 13, c: m, password: mmmmmmmmwmmmzm, count: 12 -min: 8, max: 13, c: p, password: ppdpptppdppxkppppppp, count: 15 -min: 1, max: 3, c: g, password: gszcmgjg, count: 3 -min: 5, max: 11, c: h, password: skbchhdbnphpbfl, count: 3 -min: 4, max: 7, c: d, password: prdjctk, count: 1 -min: 15, max: 18, c: f, password: ffcffffffffffzdffc, count: 14 -min: 7, max: 11, c: g, password: npggtwgzgtgzhx, count: 5 -min: 12, max: 14, c: m, password: mmmmmmmmmmmpmkm, count: 13 -min: 10, max: 11, c: b, password: bbbbbbbbbbb, count: 11 -min: 3, max: 16, c: k, password: kgxtvmlgpkptpghkb, count: 3 -min: 4, max: 6, c: m, password: zcwmzmvqvgmmsxj, count: 4 -min: 6, max: 15, c: m, password: mzmmccmmlmmrmlnl, count: 8 -min: 12, max: 13, c: x, password: xxxxxxxxwxxxz, count: 11 -min: 4, max: 5, c: d, password: mhvdtxfklzdpgdqdpqhd, count: 5 -min: 5, max: 10, c: g, password: nghgggggggqg, count: 9 -min: 7, max: 9, c: k, password: kkkkfkkkwk, count: 8 -min: 6, max: 7, c: c, password: cvcvczncn, count: 4 -min: 10, max: 11, c: t, password: tttqttttttv, count: 9 -min: 18, max: 20, c: h, password: hfsqhkwfhttgfhmbghhx, count: 6 -min: 6, max: 7, c: v, password: vgvvvwz, count: 4 -min: 3, max: 4, c: z, password: zzzj, count: 3 -min: 3, max: 5, c: d, password: dhqjnhgldtdzx, count: 3 -min: 3, max: 4, c: b, password: jbrbbbbbbbblwb, count: 10 -min: 12, max: 15, c: g, password: gsgfdfksrggqvgggjgt, count: 8 -min: 6, max: 11, c: p, password: pmppnpqpdppdpppphpf, count: 12 -min: 13, max: 14, c: z, password: zzzzgzbzzzzzgzz, count: 12 -min: 4, max: 12, c: c, password: ccjcrvcnwccwctcczcp, count: 10 -min: 10, max: 11, c: c, password: szcccfccfpcchqs, count: 7 -min: 10, max: 14, c: l, password: lllllltgjlnlbprlll, count: 11 -min: 12, max: 17, c: z, password: zhzzzxzpzzzfzzzqznz, count: 13 -min: 12, max: 15, c: l, password: llllllllmvlvllfll, count: 13 -min: 7, max: 12, c: c, password: ccccccncccccc, count: 12 -min: 1, max: 5, c: m, password: mhmmzmm, count: 5 -min: 11, max: 17, c: r, password: rrzrrwrrsrcrsmdrvrr, count: 11 -min: 4, max: 5, c: w, password: fwwpwfw, count: 4 -min: 7, max: 8, c: n, password: nnnnnnnk, count: 7 -min: 3, max: 18, c: n, password: rxhzsscgbnmzpvbqmzf, count: 1 -min: 4, max: 11, c: k, password: kkkkkkkkkkkxkkskkkdz, count: 16 -min: 10, max: 11, c: c, password: cccccccccckcccccc, count: 16 -min: 8, max: 15, c: r, password: zrrtfrjrrrrrjrrrrrr, count: 14 -min: 15, max: 16, c: h, password: ghgvlhwgqslhhhhxmp, count: 6 -min: 3, max: 5, c: f, password: ffffqf, count: 5 -min: 3, max: 8, c: s, password: bssmfsgspxssgjhsjdv, count: 7 -min: 3, max: 5, c: q, password: bfdhq, count: 1 -min: 4, max: 7, c: k, password: qknkkkd, count: 4 -min: 6, max: 9, c: b, password: bbbtbnfbbb, count: 7 -min: 12, max: 14, c: x, password: xxxxxxxqxkxvxxwxxcw, count: 13 -min: 3, max: 6, c: c, password: chfckc, count: 3 -min: 3, max: 8, c: h, password: kzkhgrffz, count: 1 -min: 10, max: 16, c: f, password: fffgjfffsvffdzfhfzff, count: 12 -min: 1, max: 3, c: r, password: rgcr, count: 2 -min: 16, max: 17, c: x, password: xxxxxdxxxxxxxxxxl, count: 15 -min: 6, max: 11, c: j, password: rsjcjjcbpchkvfjpml, count: 4 -min: 9, max: 10, c: s, password: sssqvsssjsss, count: 9 -min: 17, max: 18, c: v, password: vvvvvvvvvvvvvvvvvv, count: 18 -min: 3, max: 5, c: t, password: jtmtgtxxhzskzk, count: 3 -min: 1, max: 6, c: t, password: ttqkvdgs, count: 2 -min: 13, max: 16, c: q, password: qqqqqqhqqqqqzqqjqq, count: 15 -min: 10, max: 11, c: b, password: bbbbbvbbbbw, count: 9 -min: 6, max: 7, c: w, password: sgwmqwgwtbrllf, count: 3 -min: 10, max: 11, c: f, password: ffffffftffff, count: 11 -min: 12, max: 13, c: w, password: wwwwwwwwwwwzt, count: 11 -min: 18, max: 19, c: t, password: ttttttttttttttttttt, count: 19 -min: 1, max: 5, c: h, password: zghhr, count: 2 -min: 1, max: 2, c: v, password: dvjnctwvlp, count: 2 -min: 1, max: 2, c: j, password: jhzkzjh, count: 2 -min: 3, max: 6, c: h, password: rhhbhhh, count: 5 -min: 2, max: 4, c: d, password: dddrd, count: 4 -min: 17, max: 18, c: s, password: ssssssssssssssssns, count: 17 -min: 1, max: 8, c: m, password: smmmmmmmm, count: 8 -min: 2, max: 4, c: s, password: dcfsbzwqq, count: 1 -min: 11, max: 12, c: d, password: vnldqthkptgkkfdmtw, count: 2 -min: 8, max: 12, c: p, password: vpppzpprppppp, count: 10 -min: 6, max: 8, c: q, password: jqqqsphqjwrqj, count: 5 -min: 8, max: 10, c: k, password: ktkkkkdkkkk, count: 9 -min: 4, max: 12, c: v, password: nvvwvvvjzvvvv, count: 9 -min: 5, max: 6, c: z, password: zzzzzt, count: 5 -min: 1, max: 5, c: w, password: xwwwwwwww, count: 8 -min: 11, max: 14, c: p, password: pppfbpppkpftdpkpgpp, count: 11 -min: 2, max: 3, c: v, password: zrlv, count: 1 -min: 2, max: 4, c: f, password: fbwff, count: 3 -min: 5, max: 6, c: s, password: ssssmn, count: 4 -min: 11, max: 12, c: z, password: zzwztpzpjzhz, count: 6 -min: 5, max: 6, c: c, password: cccjcc, count: 5 -min: 4, max: 6, c: v, password: vvvgpvcpwv, count: 5 -min: 5, max: 6, c: j, password: jnzcpjnzjjcpsjfps, count: 5 -min: 12, max: 14, c: m, password: tpzwjjgpbbdmgxgphd, count: 1 -min: 13, max: 15, c: n, password: nznnnncnnnnnnnf, count: 12 -min: 8, max: 11, c: w, password: qsxwnlhwwxw, count: 4 -min: 6, max: 9, c: t, password: ltbdttnst, count: 4 -min: 10, max: 12, c: t, password: hnjdfgrhtgkl, count: 1 -min: 2, max: 4, c: d, password: dbddddc, count: 5 -min: 13, max: 14, c: g, password: gggggggbgggmgmgm, count: 12 -min: 4, max: 12, c: r, password: rrrzrgkrrrrkr, count: 9 -min: 14, max: 17, c: n, password: nnhnnnnnnnnnnnnnhnn, count: 17 -628 From b94f927fba7f0adb1309f460f07070a199daff56 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 4 Dec 2020 21:15:42 -0800 Subject: [PATCH 11/52] Completed day 4 & 5 --- 2020/Makefile | 22 +- 2020/day4.cpp | 114 +++++ 2020/day4.input | 1147 ++++++++++++++++++++++++++++++++++++++++++++++ 2020/day4.output | 9 + 2020/day5.cpp | 67 +++ 2020/day5.input | 817 +++++++++++++++++++++++++++++++++ 6 files changed, 2168 insertions(+), 8 deletions(-) create mode 100644 2020/day4.cpp create mode 100644 2020/day4.input create mode 100644 2020/day4.output create mode 100644 2020/day5.cpp create mode 100644 2020/day5.input diff --git a/2020/Makefile b/2020/Makefile index 4ee74ce..60c4544 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -1,16 +1,22 @@ -day1.out: out/types.o day1.cpp day1.input - g++ $(flags) day1.cpp out/types.o -o $@ +day1.out: out/types.o day1.cpp + g++-10 -std=c++2a $(flags) day1.cpp out/types.o -o $@ -day2.out: out/types.o day2.cpp day2.input - g++ $(flags) day2.cpp out/types.o -o $@ +day2.out: out/types.o day2.cpp + g++-10 -std=c++2a $(flags) day2.cpp out/types.o -o $@ -day3.out: out/types.o day3.cpp day3.input - g++ $(flags) day3.cpp out/types.o -o $@ +day3.out: out/types.o day3.cpp + g++-10 -std=c++2a $(flags) day3.cpp out/types.o -o $@ + +day4.out: out/types.o day4.cpp + g++-10 -std=c++2a $(flags) day4.cpp out/types.o -o $@ + +day5.out: out/types.o day5.cpp + g++-10 -std=c++2a $(flags) day5.cpp out/types.o -o $@ out/types.o: types.hpp types.cpp mkdir -p out/ - g++ $(flags) -c types.cpp -o $@ + g++-10 -std=c++2a $(flags) -c types.cpp -o $@ .PHONY: clean clean: - rm out/* day*.out + rm out/* day*.out day*.output diff --git a/2020/day4.cpp b/2020/day4.cpp new file mode 100644 index 0000000..f0c5b78 --- /dev/null +++ b/2020/day4.cpp @@ -0,0 +1,114 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +struct KeyValue { + std::string key; + bool (*func)(const std::string & passport, usize index); +}; + +template +auto try_num(const std::string & passport, usize index) -> bool { + auto num = usize(0); + --index; + while (++index < passport.size() && '0' <= passport[index] && passport[index] <= '9') { + num = (num * 10) + passport[index] - '0'; + } + return Min <= num && num <= Max; +}; + +auto main(i32 argc, char * argv[]) -> i32 { + auto valid_count1 = usize(0); + auto valid_count2 = usize(0); + + auto passport = std::string(); + auto line = std::string(); + auto file = std::ifstream("day4.input"); + while (getline(file, line)) { + if (line == "") { + auto elements = std::vector{ + { "byr", try_num<1920, 2002> }, + { "iyr", try_num<2010, 2020> }, + { "eyr", try_num<2020, 2030> }, + { "hgt", [](const std::string & passport, usize index) -> bool { + return (try_num<150, 193>(passport, index) && passport.find("cm", index + 3) == index + 3) + || (try_num<59, 76 >(passport, index) && passport.find("in", index + 2) == index + 2); + }}, + { "hcl", [](const std::string & passport, usize index) -> bool { + if (index < passport.size() && passport[index] == '#') { + auto length = usize(0); + auto true_index = usize(0); + while ((true_index = index + ++length) < passport.size() && ( + ('0' <= passport[true_index] && passport[true_index] <= '9') + || ('a' <= passport[true_index] && passport[true_index] <= 'f') + || ('A' <= passport[true_index] && passport[true_index] <= 'F') + )); + return length == 7; + } + return false; + }}, + { "ecl", [](const std::string & passport, usize index) -> bool { + const static auto eye_colors = std::vector{ "amb", "blu", "brn", "gry", "grn", "hzl", "oth" }; + auto i = usize(0); + for (; i < eye_colors.size() && passport.find(eye_colors[i], index) != index; ++i); + return i < eye_colors.size(); + }}, + { "pid", [](const std::string & passport, usize index) -> bool { + auto length = usize(-1); + auto true_index = usize( 0); + while ((true_index = index + ++length) < passport.size() + && ('0' <= passport[true_index] && passport[true_index] <= '9') + ); + return length == 9; + }}, + }; + auto valid1 = true; + auto valid2 = true; + for (auto i = usize(0); i < elements.size() && valid1; ++i) { + auto index = usize(0); + valid2 = + (valid1 = ((index = passport.find(elements[i].key)) != std::string::npos)) + && valid2 + && elements[i].func(passport, index + elements[i].key.size() + 1); + } + valid_count1 += valid1; + valid_count2 += valid2; + passport = ""; + } else { + passport += line + ' '; + } + } + + std::cout << valid_count1 << ", " << valid_count2 << std::endl; + + return 0; +} diff --git a/2020/day4.input b/2020/day4.input new file mode 100644 index 0000000..e703e66 --- /dev/null +++ b/2020/day4.input @@ -0,0 +1,1147 @@ +byr:1983 iyr:2017 +pid:796082981 cid:129 eyr:2030 +ecl:oth hgt:182cm + +iyr:2019 +cid:314 +eyr:2039 hcl:#cfa07d hgt:171cm ecl:#0180ce byr:2006 pid:8204115568 + +byr:1991 eyr:2022 hcl:#341e13 iyr:2016 pid:729933757 hgt:167cm ecl:gry + +hcl:231d64 cid:124 ecl:gmt eyr:2039 +hgt:189in +pid:#9c3ea1 + +ecl:#1f58f9 +pid:#758e59 +iyr:2022 +hcl:z +byr:2016 hgt:68 eyr:1933 + +hcl:#fffffd ecl:gry eyr:2022 +hgt:172cm pid:781914826 byr:1930 iyr:2018 + +hcl:#08df7e ecl:grn byr:1942 +eyr:2028 iyr:2011 cid:141 pid:319110455 +hgt:186cm + +pid:991343040 hgt:179cm +hcl:#a97842 iyr:2020 +eyr:2024 +byr:1984 cid:181 + +pid:188cm byr:2005 +hgt:170cm cid:163 ecl:#a08502 hcl:2964fb eyr:1994 +iyr:2005 + +ecl:grn hcl:#fffffd iyr:2013 +pid:705547886 +byr:1928 hgt:168cm eyr:2030 + +cid:219 +pid:016251942 hcl:#602927 hgt:163cm +byr:1943 eyr:2029 ecl:oth iyr:2019 + +ecl:gry hgt:184cm eyr:2026 +iyr:2010 +pid:117647952 hcl:#efcc98 +byr:1942 + +cid:243 hcl:#888785 ecl:blu eyr:2027 pid:362697676 +iyr:2011 byr:1962 hgt:154cm + +hgt:154cm byr:1965 ecl:blu eyr:2030 +pid:779104554 iyr:2016 hcl:#435634 + +hcl:z eyr:1996 iyr:1993 +pid:#50f768 +ecl:zzz hgt:62cm byr:2017 + +ecl:grn byr:1988 iyr:2016 +hgt:167cm +hcl:#cfa07d +eyr:2030 pid:951967790 + +pid:320348494 iyr:2018 cid:281 +byr:2004 +hcl:#06a58b +eyr:2033 +ecl:zzz +hgt:76cm + +cid:83 ecl:brn eyr:2028 +byr:1941 iyr:2016 +hcl:#341e13 pid:806979833 +hgt:179cm + +ecl:brn +byr:1982 iyr:2010 eyr:2029 pid:535752324 hcl:#efcc98 + +ecl:oth +hgt:70in hcl:#866857 eyr:2025 pid:203320330 iyr:2018 byr:2000 + +hgt:70cm byr:2015 pid:#218eb5 hcl:#0ec4fe iyr:2014 cid:228 ecl:#c8533a +eyr:2035 + +hcl:#6b5442 +eyr:2020 ecl:hzl iyr:2017 hgt:173cm +cid:330 byr:1988 pid:173148327 + +iyr:2011 byr:1964 hgt:83 ecl:grn hcl:#c0946f pid:931162400 eyr:2028 + +cid:239 +byr:1960 ecl:hzl +hgt:164cm +hcl:#51040b iyr:2018 eyr:2025 + +cid:163 hgt:154cm +iyr:2015 eyr:2027 pid:838964596 +byr:1972 ecl:oth hcl:#efcc98 + +hgt:181cm +eyr:2028 ecl:blu +pid:853714682 hcl:#623a2f byr:1976 iyr:2020 + +cid:225 byr:1957 +hcl:#a97842 iyr:2013 eyr:2025 +pid:511588647 hgt:173cm ecl:blu + +hcl:#efcc98 +byr:1993 +ecl:oth +pid:871652492 eyr:2028 hgt:177cm iyr:2016 +cid:220 + +ecl:hzl +hgt:165cm +hcl:#733820 eyr:2028 cid:57 byr:1973 iyr:2018 pid:018982018 + +pid:491710153 iyr:2012 ecl:#c85046 hcl:#b6652a +eyr:2040 hgt:175cm byr:1981 + +pid:917105765 eyr:2021 hgt:181cm iyr:2019 cid:159 byr:1995 +ecl:gry + +hcl:#9d2ec4 iyr:2011 +eyr:2028 pid:149288934 hgt:63in ecl:blu byr:1960 + +byr:1923 pid:705818464 eyr:2024 cid:221 ecl:oth hcl:#7d3b0c hgt:193cm iyr:2014 + +pid:117111015 eyr:2030 +byr:1967 hcl:#ceb3a1 ecl:blu +hgt:157cm +iyr:2011 + +iyr:2019 ecl:oth +hcl:#fffffd hgt:172cm pid:215010680 +eyr:2025 + +pid:157cm cid:277 +iyr:1976 hgt:159in hcl:#341e13 ecl:#6c7644 eyr:2029 byr:1965 + +pid:787186482 ecl:brn +byr:1980 hcl:#f5dfb9 eyr:2020 +iyr:2018 hgt:188cm + +cid:168 +eyr:2023 hcl:#07c809 +iyr:2013 +hgt:169cm pid:250679100 byr:1945 ecl:gry + +hcl:#6b5442 pid:683134187 iyr:2013 eyr:2023 byr:1965 hgt:171cm ecl:hzl + +eyr:2028 hgt:180cm ecl:blu byr:1952 cid:314 iyr:2016 +pid:720794393 hcl:#602927 + +byr:1982 iyr:2016 +ecl:brn eyr:2027 +hgt:156cm pid:185583837 hcl:#ddbf30 + +hcl:#ceb3a1 pid:987624973 +eyr:2026 +iyr:2013 byr:1988 hgt:175cm ecl:grn + +eyr:2028 byr:1974 pid:350988773 hcl:#a97842 iyr:2015 +ecl:oth +hgt:160cm + +hcl:#b6652a +eyr:2028 +pid:717504683 byr:1970 +iyr:2013 +ecl:gry +hgt:156cm + +pid:453874703 iyr:2015 hcl:#a97842 ecl:hzl byr:1986 hgt:175cm cid:132 eyr:2025 + +hcl:#7d3b0c +eyr:2026 +ecl:brn hgt:154cm +byr:1959 pid:580659686 iyr:2015 + +ecl:amb hgt:191cm iyr:2018 +pid:681417707 byr:1994 eyr:2023 hcl:#c0946f + +eyr:2022 pid:302326561 iyr:2018 ecl:blu byr:1987 cid:89 hcl:#a97842 hgt:184cm + +eyr:2020 pid:457081226 +ecl:blu hcl:#866857 iyr:2011 +hgt:159cm byr:1959 + +eyr:2024 cid:322 byr:1991 pid:210415503 +hgt:69in ecl:grn +hcl:#623a2f + +ecl:blu iyr:2012 pid:524745721 hcl:#c0946f eyr:2026 hgt:176cm byr:1964 + +hgt:189cm iyr:2014 pid:679155617 hcl:#efcc98 eyr:2027 +cid:88 byr:1974 +ecl:blu + +byr:1935 eyr:2029 +iyr:2020 +hcl:#733820 ecl:blu hgt:190cm pid:509009432 + +hcl:#fffffd pid:446558583 byr:1931 ecl:brn iyr:2019 +hgt:159cm cid:146 +eyr:2024 + +eyr:2028 hcl:#efcc98 pid:330588516 hgt:65cm +byr:1972 iyr:2014 ecl:oth + +ecl:blu hgt:175cm cid:197 pid:068138358 eyr:2023 iyr:2017 hcl:#0441c6 byr:1999 + +byr:1992 hgt:193cm +ecl:brn iyr:2018 hcl:#866857 pid:905992465 +eyr:2022 + +hgt:95 byr:1965 +pid:810311252 eyr:2034 hcl:z iyr:1985 cid:254 + +hcl:#c0946f byr:1985 eyr:2030 hgt:161cm iyr:2010 ecl:gry pid:616639221 + +iyr:2011 eyr:2023 hgt:172cm cid:260 ecl:hzl +pid:594747312 +hcl:#a97842 byr:1937 + +eyr:2028 pid:134536806 cid:83 +ecl:brn byr:1928 +iyr:2015 +hcl:#fffffd hgt:157cm + +iyr:2016 +pid:035433923 hgt:180cm ecl:amb eyr:2027 byr:1934 +cid:195 hcl:#583d02 + +eyr:1936 cid:130 byr:1969 hgt:74cm hcl:50e1a7 ecl:gmt iyr:2010 pid:82008848 + +hcl:#733820 +eyr:2020 +hgt:174cm iyr:2018 ecl:hzl byr:1983 pid:087167304 + +byr:1972 hcl:#888785 eyr:2020 pid:593301831 iyr:2013 ecl:hzl hgt:188cm + +cid:282 hcl:#888785 hgt:170cm ecl:oth eyr:2029 +byr:1942 pid:014356555 iyr:2020 + +byr:1966 hcl:#623a2f ecl:oth hgt:165cm +eyr:2028 iyr:2012 pid:558908746 + +pid:#4f5b92 +hcl:#6b5442 hgt:188cm +byr:1994 iyr:2014 cid:127 eyr:2020 +ecl:oth + +hgt:153cm +ecl:brn iyr:2020 +eyr:2026 hcl:#18171d +pid:101990935 +byr:1932 + +iyr:2011 byr:1981 hgt:157cm hcl:#c0946f +eyr:2029 pid:545992967 +ecl:utc + +byr:1929 hcl:#602927 iyr:2018 ecl:grn +eyr:2027 +pid:256056759 +hgt:178cm + +iyr:2016 pid:813526512 eyr:2027 hcl:#20799c +ecl:blu +byr:1971 hgt:185cm + +iyr:2021 eyr:2040 +pid:5135078781 byr:2013 hcl:#7d3b0c hgt:62cm ecl:#dedf53 + +iyr:2013 +byr:1979 cid:269 hgt:179cm pid:871628606 eyr:2026 hcl:#53b66c +ecl:grn + +eyr:2020 +hcl:#ceb3a1 byr:1988 ecl:oth iyr:2012 +pid:558371571 + +pid:908462345 byr:1972 hgt:183cm ecl:gry cid:51 hcl:#af82df eyr:2023 iyr:2019 + +pid:106942710 ecl:hzl +hgt:157cm hcl:z eyr:2025 iyr:2016 +byr:1998 cid:271 + +iyr:2011 ecl:oth pid:191542220 +byr:1951 eyr:2027 hcl:#c0946f hgt:190cm + +eyr:2028 hgt:193cm pid:235913726 iyr:2012 hcl:#325350 +ecl:amb + +iyr:2018 hcl:#a97842 ecl:hzl byr:1988 pid:481250123 +cid:328 hgt:165cm eyr:2028 + +ecl:#a51d9c hcl:91236c pid:2538922220 byr:2017 eyr:2004 +iyr:2026 hgt:174 + +pid:959660262 eyr:2022 cid:339 hgt:170cm iyr:2012 +hcl:#cfa07d ecl:brn + +hcl:#866857 +ecl:dne hgt:70cm eyr:2013 iyr:1980 pid:780067045 +byr:1950 + +iyr:2011 +byr:1981 +pid:902964474 ecl:gry eyr:2021 +hgt:154cm +hcl:#602927 cid:156 + +iyr:2016 +hgt:156cm ecl:brn cid:315 eyr:2023 byr:1997 +hcl:#623a2f pid:339892714 + +ecl:brn hgt:73in cid:184 byr:1960 eyr:2024 iyr:2014 hcl:#888785 +pid:561655785 + +pid:579663338 +eyr:1977 +hcl:#ceb3a1 ecl:grt hgt:188cm +byr:2017 +iyr:2018 + +byr:1941 eyr:2029 pid:252436521 +hgt:170cm ecl:hzl + +hcl:#888785 +pid:378073052 +hgt:185cm +cid:343 byr:2001 +ecl:oth iyr:1988 eyr:2029 + +pid:286459107 byr:1973 eyr:2023 ecl:oth cid:273 +hgt:184cm + +pid:406853460 eyr:2028 hcl:#b6652a +hgt:179cm +iyr:2020 cid:346 +ecl:brn byr:1973 + +hcl:#ceb3a1 eyr:2026 pid:001798001 ecl:gry hgt:157cm +cid:235 +byr:1968 +iyr:2013 + +hcl:#b6652a hgt:151cm pid:504383643 iyr:2018 +ecl:brn byr:1990 +eyr:2021 + +hgt:164cm iyr:2015 hcl:#888785 byr:1998 pid:045813631 cid:237 +ecl:grn +eyr:2026 + +hcl:#733820 hgt:172cm +eyr:2030 iyr:2015 ecl:gry pid:507769390 byr:1979 cid:212 + +cid:138 hgt:176cm hcl:#efcc98 +eyr:2024 byr:1984 +ecl:brn iyr:2015 pid:968062470 + +hcl:#733820 iyr:2015 ecl:oth +eyr:2028 pid:431922630 hgt:160cm byr:1941 + +iyr:2017 +eyr:2023 ecl:grn cid:294 byr:1969 +hcl:#602927 pid:720065302 +hgt:67in + +ecl:gry byr:2002 eyr:2024 hcl:#7d3b0c +hgt:174cm +iyr:2012 pid:296913847 + +pid:42057861 hcl:bb7ace eyr:2023 byr:2013 hgt:188 ecl:#312118 iyr:2024 + +eyr:2021 +byr:1958 +hgt:170cm ecl:brn iyr:2012 +pid:064919306 cid:349 hcl:#602927 + +eyr:2022 +pid:248168906 +iyr:2013 byr:1996 hcl:#cfa07d +hgt:151cm ecl:hzl + +cid:301 ecl:brn hcl:#fffffd +hgt:183cm +pid:806659387 +eyr:2021 +byr:1970 iyr:2013 + +cid:192 +iyr:2013 +ecl:#5ad460 hgt:64cm +pid:001255475 byr:1984 eyr:2027 hcl:#cfa07d + +iyr:2012 pid:194936105 eyr:2028 byr:2000 ecl:oth hcl:#733820 hgt:158cm + +cid:323 +hcl:#a97842 eyr:2027 pid:625573908 +iyr:2019 byr:1987 ecl:grn +hgt:191cm + +pid:997956152 hgt:193cm ecl:hzl eyr:2024 byr:1983 +cid:113 hcl:#888785 +iyr:2013 + +iyr:2017 hgt:153cm hcl:#733820 byr:1984 eyr:2025 pid:138608494 ecl:blu + +ecl:brn +byr:1987 hgt:174cm +iyr:2013 pid:459148475 eyr:2023 hcl:#623a2f cid:266 + +byr:2000 iyr:2017 ecl:brn pid:469155516 hcl:#b6652a +eyr:2027 hgt:193cm + +byr:1967 eyr:2028 pid:064940030 +iyr:2016 +ecl:gry hcl:#18171d hgt:74in + +iyr:2020 hcl:#efcc98 +byr:1968 hgt:164cm ecl:hzl pid:834180009 eyr:2022 + +pid:021397352 +iyr:2018 hcl:#341e13 byr:1978 eyr:2022 ecl:oth hgt:67in + +hgt:160cm cid:213 ecl:#a46ef7 pid:157cm eyr:2020 iyr:2020 byr:1923 + +iyr:2016 +cid:235 pid:454188395 eyr:2022 hgt:73in ecl:hzl +hcl:#7d3b0c byr:1964 + +iyr:1930 eyr:2033 hgt:76cm pid:41117341 byr:2028 ecl:utc +hcl:#6b5442 + +pid:41316572 +hcl:#cfa07d byr:1965 eyr:2027 hgt:179cm iyr:2010 +ecl:grn + +hgt:152cm pid:886168412 iyr:2027 +eyr:1989 hcl:9993d6 byr:2005 ecl:zzz + +pid:661569613 hgt:166cm +hcl:#18171d iyr:2010 byr:1922 eyr:2030 ecl:brn + +byr:1958 +ecl:blu pid:978855125 +eyr:2020 iyr:2019 +hgt:190cm hcl:#18171d + +hgt:68in iyr:2012 hcl:#ceb3a1 eyr:2028 ecl:oth pid:067088299 +byr:1975 + +eyr:2020 +pid:507464869 hcl:#fffffd hgt:156cm iyr:2016 +byr:1957 ecl:blu + +cid:259 eyr:2025 byr:1954 +ecl:gry hgt:167cm pid:832017347 iyr:2020 hcl:#623a2f + +hgt:69in hcl:#a97842 +pid:426496916 byr:1947 eyr:2021 iyr:2015 ecl:oth + +eyr:2025 ecl:blu pid:543125976 cid:192 iyr:2017 +byr:1920 hgt:154cm hcl:#a7ecdc + +hgt:69in iyr:2017 +byr:1932 hcl:#6b5442 +ecl:hzl cid:349 pid:494399909 eyr:2029 + +eyr:2030 ecl:gry hcl:#6b5442 +iyr:2010 byr:1938 cid:100 pid:477259022 hgt:67in + +hgt:145 byr:2009 hcl:#b6652a iyr:2015 +pid:180cm ecl:dne cid:315 eyr:1920 + +byr:1930 hgt:65in +eyr:2022 ecl:blu +pid:671271699 +iyr:2010 +hcl:#b6652a + +byr:1989 eyr:2020 +ecl:hzl +hcl:#341e13 +pid:625435489 +hgt:189cm cid:72 +iyr:2013 + +hgt:184 +byr:2025 ecl:#a1368a eyr:2038 cid:111 +iyr:2025 hcl:z pid:7952164402 + +pid:165478949 +hcl:453b30 ecl:amb hgt:75cm eyr:1987 iyr:2015 +byr:1960 + +eyr:2022 ecl:blu +cid:100 +hcl:ead803 iyr:2025 byr:2018 + +eyr:2024 +ecl:gry hgt:167cm +hcl:#623a2f cid:259 +byr:1932 iyr:2014 pid:360279704 + +hgt:191cm +ecl:oth pid:070592110 cid:275 eyr:2027 +iyr:2011 hcl:#4a4252 byr:1937 + +ecl:blu cid:256 iyr:2017 eyr:2027 hcl:#341e13 hgt:150cm +pid:152140902 byr:1923 + +eyr:1972 iyr:2020 ecl:gry hcl:#888098 byr:1974 hgt:188cm +pid:586853292 + +iyr:2014 +ecl:brn hcl:#866857 eyr:2020 +hgt:184cm pid:422142863 byr:1999 + +iyr:2025 ecl:amb eyr:1928 hcl:#18171d byr:2008 hgt:62cm pid:42120034 + +byr:1923 cid:85 iyr:2017 +hcl:#602927 eyr:2026 pid:922322363 +hgt:68in ecl:amb + +cid:97 hcl:#602927 +pid:436567964 +eyr:2028 iyr:2016 +byr:1994 + +hcl:#9c166d +eyr:2025 pid:834335216 iyr:2011 ecl:blu byr:1946 hgt:174cm + +byr:2018 iyr:2027 hgt:187in +cid:118 eyr:2038 +ecl:lzr hcl:z + +ecl:blu +byr:1998 pid:186cm eyr:2026 hcl:z iyr:2027 hgt:70in + +hcl:#623a2f eyr:2020 ecl:amb iyr:2010 pid:743059641 cid:240 hgt:169cm byr:1957 + +ecl:oth pid:089778639 cid:305 eyr:2027 iyr:2012 byr:1935 +hcl:#efcc98 + +hgt:151cm hcl:#602927 cid:97 byr:1968 iyr:2014 pid:447599233 +ecl:oth +eyr:2030 + +pid:621084188 byr:1941 ecl:gry cid:188 iyr:2012 hgt:75in eyr:2028 hcl:#6b5442 + +hcl:#c0946f +ecl:amb +hgt:66cm +pid:185cm byr:2022 eyr:2039 iyr:2024 +cid:321 + +hgt:177cm byr:1954 ecl:amb pid:445374119 cid:137 hcl:#341e13 iyr:2010 +eyr:2020 + +hgt:160cm +byr:1923 +ecl:grn +eyr:2021 iyr:2012 +pid:286304911 +hcl:#18171d + +hgt:153cm byr:1933 +iyr:2015 +ecl:gry +pid:365430749 eyr:2029 + +cid:294 pid:817081355 byr:1969 +eyr:2030 ecl:oth iyr:2014 hgt:181cm hcl:#623a2f + +iyr:2011 +ecl:gry hgt:177cm eyr:2025 pid:446342686 hcl:#b6652a byr:1991 +cid:241 + +byr:1999 +iyr:2018 +cid:306 hcl:#18171d eyr:2021 +hgt:188cm ecl:gry pid:473752814 + +byr:2002 hcl:#733820 +pid:867697169 +ecl:gry hgt:165cm eyr:2020 +cid:316 + +eyr:2026 cid:59 hgt:175cm byr:1993 pid:531385722 +ecl:hzl hcl:#733820 + +eyr:2027 +cid:50 pid:433963708 +byr:1969 +iyr:2011 ecl:hzl hgt:164cm +hcl:#b6652a + +eyr:2020 ecl:gry hgt:186cm pid:917147781 hcl:#341e13 +iyr:2016 cid:68 + +pid:857547233 hgt:64in +cid:274 +eyr:2020 ecl:hzl iyr:2019 hcl:#866857 byr:1948 + +eyr:2022 hgt:183cm pid:557280094 +byr:1936 hcl:#602927 iyr:2019 ecl:oth + +byr:1933 eyr:2023 +iyr:2020 +ecl:blu hgt:72in + +pid:682285472 +ecl:blu hgt:166cm eyr:2021 +byr:1993 +hcl:#ceb3a1 iyr:2011 cid:266 + +iyr:2012 cid:172 ecl:#04ce29 eyr:2021 hgt:160cm byr:1926 pid:2235389773 + +eyr:2029 hcl:#cfa07d pid:387564370 cid:276 hgt:74in +ecl:amb +byr:1926 iyr:2019 + +eyr:2026 +hcl:#733820 +pid:230583200 byr:1997 +ecl:brn +iyr:2010 +hgt:179cm + +byr:1946 hcl:#866857 ecl:#87b6f4 hgt:150cm pid:298537901 +eyr:2024 iyr:2011 + +hcl:#cfa07d +byr:1961 +eyr:2022 +hgt:167cm +pid:230816154 ecl:oth iyr:2018 +cid:164 + +pid:167899852 hcl:#18171d eyr:2023 hgt:173cm ecl:amb byr:1960 iyr:2010 + +hcl:#866857 +hgt:165cm +ecl:hzl pid:325078465 byr:2002 +cid:61 eyr:2025 iyr:2020 + +cid:268 +hcl:#a97842 iyr:2011 byr:1966 pid:450468785 +eyr:2030 hgt:173cm +ecl:gry + +hgt:181cm +eyr:2026 cid:77 pid:229016136 ecl:grn byr:1929 + +ecl:#ad9ae9 hcl:z iyr:2012 +byr:2029 +cid:77 pid:#b1f685 eyr:2015 + +ecl:amb byr:1920 +eyr:2026 hcl:#92e796 iyr:2011 pid:503853254 hgt:186cm +cid:101 + +hcl:#7d3b0c eyr:2022 ecl:amb pid:536474715 hgt:64in +iyr:2026 byr:1924 + +hgt:72in ecl:hzl hcl:#888785 eyr:2030 pid:048654766 byr:1977 iyr:2016 + +hgt:171cm ecl:brn byr:1976 pid:844553043 +eyr:2024 +cid:241 + +cid:243 eyr:2023 pid:998276626 iyr:2011 hcl:#623a2f ecl:oth hgt:183cm byr:1920 + +eyr:2030 +ecl:amb pid:896953299 +hgt:157cm byr:1934 hcl:#9c12d8 iyr:2015 + +hcl:#cfa07d iyr:2011 byr:1974 pid:451819357 hgt:168cm ecl:grn eyr:2024 + +iyr:2018 +pid:908304519 hcl:#fffffd byr:1936 cid:203 +ecl:amb hgt:76in +eyr:2029 + +byr:1967 +hgt:186cm +eyr:2026 +hcl:#ceb3a1 ecl:grn +pid:594830518 iyr:2017 + +pid:20921789 iyr:2024 hcl:z byr:2026 ecl:zzz hgt:153cm eyr:2037 + +hcl:#888785 iyr:2016 cid:323 byr:1958 ecl:gry pid:118638859 eyr:2029 +hgt:163cm + +hgt:167cm ecl:brn eyr:2020 +pid:557999801 +byr:1988 +cid:273 iyr:2011 +hcl:#fffffd + +ecl:gry pid:206008517 eyr:2022 +hcl:#ceb3a1 +byr:1983 hgt:187cm + +eyr:2020 +byr:1931 cid:78 +hcl:#6b5442 ecl:oth hgt:170cm pid:039713280 iyr:2015 + +eyr:2024 ecl:amb +byr:2002 hgt:162cm hcl:#866857 +iyr:2012 pid:696390563 cid:184 + +hgt:189cm byr:1992 pid:712592503 iyr:2012 ecl:oth hcl:#602927 +eyr:2029 + +ecl:hzl +byr:1965 hgt:182cm eyr:2023 +iyr:2014 hcl:#a97842 + +byr:1927 ecl:gry +hcl:#d91aa0 pid:082227536 eyr:2021 +iyr:2011 + +eyr:2003 iyr:1953 byr:1954 +cid:327 hgt:62in ecl:utc +hcl:z pid:#97c11a + +cid:252 pid:98689392 +iyr:2020 hgt:103 +hcl:298df8 byr:1934 +ecl:oth eyr:2012 + +hcl:#fffffd eyr:2020 +byr:1993 ecl:brn +pid:338398225 iyr:2015 hgt:159cm + +iyr:2017 pid:624798709 hgt:151cm eyr:2029 +ecl:gry cid:111 +hcl:#866857 + +byr:2010 +ecl:hzl eyr:1975 hgt:150cm iyr:1930 hcl:159a9a + +iyr:2010 +hcl:#7d3b0c eyr:2024 cid:224 hgt:163cm byr:1971 pid:631469024 ecl:grn + +ecl:hzl iyr:2017 hgt:167cm +hcl:#623a2f pid:417970460 byr:1949 eyr:2020 + +eyr:2030 +hgt:84 byr:2007 ecl:xry cid:153 pid:9655548750 iyr:1957 + +ecl:oth hcl:#733820 cid:336 byr:1996 iyr:2014 pid:736143470 eyr:2025 hgt:182cm + +hgt:69in hcl:#623a2f +cid:126 iyr:2019 pid:638479310 eyr:2022 ecl:grn byr:1935 + +cid:240 +pid:804066884 byr:1987 hcl:#049f0e +eyr:2023 +hgt:174cm +ecl:brn +iyr:2020 + +ecl:amb iyr:2010 +pid:200411701 +cid:70 eyr:2023 +hcl:#341e13 byr:1974 hgt:61in + +eyr:2022 hgt:186cm hcl:#18171d ecl:hzl pid:613033358 +iyr:2014 + +hgt:189cm +iyr:2020 pid:874302209 byr:1928 ecl:blu +hcl:#1c52f4 +eyr:2029 + +byr:2026 +eyr:2007 pid:166cm iyr:2030 ecl:utc +hgt:137 hcl:8e8916 + +pid:781251989 +eyr:2029 hgt:178cm iyr:2010 byr:1942 hcl:#cfa07d + +pid:671017167 eyr:2030 ecl:amb byr:2002 hgt:166cm +iyr:2011 hcl:#7d3b0c + +pid:369327568 byr:1955 ecl:hzl iyr:2013 hcl:#341e13 eyr:2020 cid:90 hgt:154cm + +pid:169149205 iyr:1947 ecl:amb eyr:1977 +byr:2003 +hcl:z +hgt:75cm + +hcl:#cfa07d iyr:2016 +eyr:2022 pid:941218673 byr:1999 cid:186 +ecl:brn hgt:173cm + +hgt:159cm eyr:2021 byr:1962 hcl:#efcc98 +pid:792538993 iyr:2011 ecl:blu +cid:222 + +pid:#994231 byr:2024 iyr:1977 hcl:b98ff6 eyr:2010 hgt:71 +ecl:#875a67 + +byr:2007 +iyr:2023 hgt:141 +eyr:2021 ecl:grt pid:22002588 + +hgt:190cm +pid:524515058 +cid:217 +ecl:grn byr:1999 +eyr:2027 +iyr:2019 + +ecl:dne byr:2019 eyr:1942 hgt:62cm pid:5866040917 +iyr:2018 hcl:z + +pid:754032301 byr:1985 eyr:2029 hgt:185cm iyr:2016 +ecl:oth + +ecl:amb byr:1948 iyr:2010 hgt:157cm pid:153547581 eyr:2027 hcl:#cfa07d + +eyr:2026 byr:1942 pid:368975422 +hcl:#733820 +cid:322 hgt:188cm +iyr:2019 +ecl:blu + +ecl:brn +pid:535822939 byr:1994 +eyr:2027 iyr:2020 hcl:#18171d hgt:193cm + +pid:706755664 +hcl:#7d3b0c +ecl:grn cid:304 +hgt:152cm byr:1972 iyr:2013 eyr:2021 + +hgt:163cm +byr:1922 iyr:2014 eyr:2028 pid:852815945 cid:324 +ecl:brn hcl:53b08b + +hcl:#888785 +eyr:2023 +iyr:2020 byr:1962 ecl:blu +pid:407158186 +cid:269 + +ecl:blu +eyr:2027 pid:567155642 hcl:#a97842 hgt:74in byr:1995 +iyr:2016 + +iyr:2017 eyr:2020 +pid:782403650 +byr:1952 ecl:gry hgt:193cm cid:273 hcl:#efcc98 + +byr:1963 eyr:2021 +pid:639445576 hcl:#c0946f iyr:2013 +cid:306 ecl:blu hgt:154cm + +hgt:68in cid:191 +hcl:#7d3b0c +iyr:2017 byr:1935 ecl:gry + +ecl:brn iyr:2019 +eyr:2021 +hcl:#733820 +byr:2017 +pid:714110829 hgt:155cm cid:178 + +cid:203 pid:455383907 +ecl:grn byr:1965 +hcl:#866857 eyr:2024 hgt:172cm iyr:2012 + +iyr:2018 eyr:2033 +pid:462538213 byr:1974 hcl:#c0946f +ecl:amb hgt:160cm + +hcl:#623a2f +pid:116799148 cid:336 +ecl:grn eyr:2027 +iyr:2020 +byr:1976 + +pid:654088396 +ecl:utc eyr:2021 +byr:2016 +hcl:#866857 +iyr:2030 hgt:191cm + +byr:1939 +eyr:2023 +iyr:2011 hgt:168cm +cid:141 ecl:brn +hcl:#6b5442 + +eyr:2025 hgt:61in +byr:1977 +ecl:brn iyr:2016 cid:198 pid:401742648 + +ecl:brn +iyr:2012 eyr:2027 +byr:1990 hcl:#6b5442 +pid:476691172 +hgt:72in + +cid:176 ecl:oth iyr:2011 hcl:#c0946f +eyr:2028 +byr:1957 pid:959615191 + +byr:2027 +iyr:2021 hcl:#733820 hgt:165cm pid:6155507056 + +iyr:2012 ecl:blu +pid:397461435 eyr:2022 byr:1993 hgt:170cm +hcl:#b59662 cid:185 + +ecl:hzl byr:2015 +hcl:z hgt:185cm eyr:2036 iyr:2017 +pid:172cm + +ecl:oth +hgt:181cm iyr:2019 +cid:113 byr:2000 +hcl:#866857 pid:045077916 eyr:2029 + +iyr:2013 ecl:grn +pid:717028913 byr:1953 eyr:2025 +hgt:191cm hcl:#6b5442 + +pid:825834003 eyr:2027 byr:1941 +hgt:163cm iyr:2010 hcl:#6b5442 ecl:amb + +eyr:2026 hgt:59in +hcl:#e9ebf8 byr:1966 +iyr:2018 pid:677886127 ecl:grn + +hcl:#888785 pid:771218458 ecl:hzl eyr:2029 +cid:153 byr:1991 iyr:2011 +hgt:76in + +hgt:161cm hcl:#888785 +ecl:brn byr:1928 pid:913959218 eyr:2020 iyr:2013 + +hgt:188cm eyr:2026 +byr:1964 ecl:blu hcl:#733820 iyr:2017 pid:874400552 + +ecl:hzl iyr:2017 +cid:59 pid:130750853 byr:1964 eyr:2028 hgt:177cm hcl:#602927 + +pid:200888672 ecl:oth iyr:2016 eyr:2020 hcl:#efcc98 hgt:163cm + +eyr:2026 +ecl:gry +hgt:189cm +hcl:#c0946f iyr:2019 pid:741121671 byr:1971 + +ecl:amb eyr:2028 hcl:#888785 iyr:2017 pid:060053163 byr:1952 hgt:191cm + +hcl:#55c45a +eyr:2022 ecl:blu +iyr:2019 pid:326991534 +hgt:158cm +cid:149 + +hcl:#a97842 iyr:2013 ecl:hzl byr:1941 hgt:179cm + +hgt:68in hcl:#18171d +eyr:2021 byr:1938 ecl:oth iyr:2015 +pid:888616887 + +eyr:2026 iyr:2018 ecl:oth byr:1990 +hcl:#efcc98 +pid:472330538 +hgt:192cm + +byr:1933 ecl:grn hcl:#7d3b0c hgt:74in iyr:2011 +eyr:2028 cid:55 + +iyr:2014 hgt:165cm ecl:blu hcl:#18171d byr:1998 pid:601177268 cid:64 eyr:2027 + +iyr:2011 ecl:grn cid:188 pid:440822084 eyr:2028 +hcl:#c0946f byr:1987 hgt:154cm + +hcl:#f29c57 +cid:114 iyr:2010 +byr:1989 eyr:2023 hgt:61in +pid:166071094 + +hgt:71cm +iyr:2022 byr:1965 +ecl:#bb3dce pid:88829820 eyr:2040 hcl:z + +hgt:62in hcl:#7d3b0c pid:585528668 +eyr:2028 ecl:oth +byr:1941 + +ecl:oth eyr:2030 +byr:1952 +iyr:2018 pid:422437243 hgt:185cm + +pid:054717793 byr:1989 hcl:#18171d +iyr:2014 +ecl:grn +eyr:2025 hgt:151cm + +eyr:2027 +hcl:#cfa07d pid:071196833 +cid:297 byr:1932 hgt:173in +ecl:grn iyr:2016 + +hcl:#6b1c3d eyr:2026 pid:963034490 iyr:2011 +hgt:175cm byr:1961 ecl:oth + +hgt:69in +hcl:#b6652a ecl:oth +pid:771661551 iyr:2016 eyr:2023 byr:1960 + +cid:63 +pid:190cm byr:2021 ecl:#252d02 eyr:1931 +iyr:1966 hgt:101 hcl:dc9531 + +byr:1976 eyr:1925 +ecl:grt cid:203 +iyr:2019 +pid:170cm hgt:181in + +iyr:2014 ecl:amb +hgt:182cm cid:283 byr:1983 +pid:307867769 eyr:2024 hcl:#cfa07d + +hgt:157cm hcl:#ceb3a1 eyr:2026 pid:109243500 +byr:1926 +iyr:2015 ecl:oth cid:330 + +hcl:#602927 byr:1940 pid:389818848 +iyr:2016 ecl:brn +hgt:68in eyr:2023 + +ecl:brn pid:340990019 +eyr:2020 iyr:2011 +hcl:#fffffd hgt:175cm byr:2001 + +cid:264 +hgt:154cm pid:128094068 +hcl:#888785 iyr:2013 eyr:2027 +byr:1929 ecl:amb + +cid:270 hcl:#602927 hgt:156cm iyr:2018 +byr:1983 +eyr:2020 pid:621875145 +ecl:gry + +cid:345 pid:68093057 ecl:grt +iyr:2019 byr:1992 hgt:109 hcl:35d6e4 eyr:1976 + +pid:714839913 ecl:grn hcl:#733820 iyr:2020 hgt:153cm +byr:1996 eyr:2027 + +pid:820650878 eyr:2027 +hcl:#866857 byr:1957 +iyr:2015 ecl:grn hgt:167cm + +pid:600488426 +hcl:#ceb3a1 hgt:151cm +ecl:amb eyr:2021 byr:1936 iyr:2015 cid:326 + +cid:256 hgt:169cm +iyr:2014 +pid:261369952 eyr:2028 byr:1982 +ecl:brn +hcl:#733820 + +eyr:2021 iyr:2011 +pid:745066100 hcl:#3bbbd5 byr:1998 ecl:amb hgt:166cm +cid:257 + +ecl:#a38be3 cid:256 hgt:154 eyr:2033 +byr:2006 pid:5154675209 hcl:z + +hgt:160cm cid:103 ecl:gry byr:2000 hcl:#a97842 eyr:2026 pid:528503931 +iyr:2010 + +eyr:2025 cid:131 iyr:2011 +byr:2001 +pid:346722892 +hcl:#cc0362 +hgt:168cm +ecl:brn + +hcl:#ceb3a1 iyr:2012 +hgt:188cm pid:760916817 byr:1985 +eyr:2020 ecl:oth + +hgt:179cm +cid:317 +ecl:amb pid:411265118 iyr:2018 +byr:1982 hcl:#733820 eyr:2028 + +byr:1927 hcl:#7d3b0c iyr:2020 ecl:gry +hgt:155cm pid:937138356 eyr:2021 + +hcl:#efcc98 pid:793804751 eyr:2022 byr:1961 hgt:193cm iyr:2016 cid:222 + +pid:715207875 hcl:#18171d eyr:2030 byr:1974 hgt:157cm ecl:blu +iyr:2019 + +eyr:2022 pid:134624402 hgt:159cm cid:154 +byr:1938 hcl:#cfa07d +iyr:2018 ecl:gry + +ecl:oth eyr:2021 +cid:259 pid:0484880795 hcl:#cfa07d hgt:189cm iyr:2019 byr:1958 + +byr:1960 +pid:752967111 iyr:2010 hcl:#52a9af +hgt:151cm ecl:amb eyr:2025 + +eyr:2028 byr:1974 ecl:oth cid:348 +hcl:#b6652a hgt:164cm iyr:2018 + +eyr:2029 +byr:1942 cid:232 iyr:2016 hgt:193cm +hcl:#733820 pid:175cm ecl:oth + +byr:1990 hcl:#b6652a eyr:2028 iyr:2011 pid:054326137 hgt:153cm ecl:blu + +byr:1933 +pid:659875882 hgt:181cm +eyr:2023 iyr:2012 +ecl:grn hcl:#18171d + +ecl:grn iyr:2019 hcl:#866857 byr:1946 +eyr:2023 hgt:193cm pid:494553757 + +cid:331 +ecl:blu eyr:2021 hcl:#733820 hgt:174cm +iyr:2010 byr:1950 pid:405416908 + diff --git a/2020/day4.output b/2020/day4.output new file mode 100644 index 0000000..a08d9f1 --- /dev/null +++ b/2020/day4.output @@ -0,0 +1,9 @@ +1 +1 +1 +1 +0 +0 +0 +5: 0 +1, 0 diff --git a/2020/day5.cpp b/2020/day5.cpp new file mode 100644 index 0000000..04d1606 --- /dev/null +++ b/2020/day5.cpp @@ -0,0 +1,67 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include + +#include "types.hpp" + +auto main(i32 argc, char * argv[]) -> i32 { + auto seat = usize(0); + auto line = std::string(); + auto file = std::ifstream("day5.input"); + + auto seats = std::vector(); + + while (getline(file, line)) { + auto local_seat = usize(0); + for (auto i = usize(0); i < 7 + 3; ++i) { + local_seat <<= 1; + if (line[i] == 'B' || line[i] == 'R') { + local_seat |= 1; + } + } + if (local_seat > seat) { + seat = local_seat; + } + seats.push_back(local_seat); + } + std::cout << seat << std::endl; + + std::sort(seats.begin(), seats.end()); + + for (auto i = usize(0); i < seats.size() - 1; ++i) { + if (seats[i] + 2 == seats[i + 1]) { + std::cout << (seats[i] + 1) << std::endl; + break; + } + } + + return 0; +} diff --git a/2020/day5.input b/2020/day5.input new file mode 100644 index 0000000..4ed7747 --- /dev/null +++ b/2020/day5.input @@ -0,0 +1,817 @@ +FBFFFFBRLL +FFBFFFFRLR +BFBBFFBRLL +FBBBBFFLLR +BFFFBFFLRL +FBBFBFFLRR +FBBFBFBLLL +BFFBFFFLRL +FBFFBBBLRR +BFFFFFBRRR +BFBBFFBRRL +FFBFFFBLRL +BBBFFFFLRR +BBFFBFBLRR +FBFBFFBRRR +FFBFFBBLLL +BFBFFFBRLR +BFFFFBFLLL +FFBBFFBRRL +BFBBBFBLRL +BFFBBFBLRL +FFBBBFBRRL +BFBBBFBLLR +BBFBFBBRRL +FFBBFBFRLR +BFBBFBBLLR +FFBBBBBRLL +FBFBFFFRLR +FBFBBBFRRL +FBFFBFFRLR +FBFBFBFRRL +BFBFFFFLRL +BFBFBFBRRR +FFBBBBBRRR +BFFFFBFRRR +FBBFBFBRRL +FFBFFBBLLR +FBBFFFBRRR +BFBFFBFLLL +BFFBBBBLLR +BFBFBFFRRR +BFBBFFFRLR +FBBFFBFLRR +BBFBFBBLRR +BBBFFFFLLL +FFFBBBFRRL +FFFBBFFRRL +BFFFBFBLRR +FFBBFFFRRR +BFFFBFFLLR +BBFFBBFLLR +BFFFBBFLRL +BBFBBFBRRL +FFBFFBBRLL +BFFFBBBLLR +FBBFFFFLRL +BFBFBFBRLL +FFBBFBFRLL +FBFFBBFLLR +FBFBBBFRRR +BFFFBBFRRR +FBFFBFBRRL +FBFB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BBFFFFRLR +FFBFFBFRRR +FFBFFFBRRR +FFFBBFFRLL +BFFBBFFLRL +BBFBBBBLLL +BFBBBBFLLR +BFBBFFFLLR +FFBBBFBRLR +FBBBFBBLLR From 365cd3eaff0af5bfdaf7bfa08353840c2e67d5fc Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 4 Dec 2020 21:15:42 -0800 Subject: [PATCH 12/52] Completed day 4 & 5 --- 2020/Makefile | 22 +- 2020/day4.cpp | 114 +++++ 2020/day4.input | 1147 ++++++++++++++++++++++++++++++++++++++++++++++ 2020/day4.output | 9 + 2020/day5.cpp | 67 +++ 2020/day5.input | 817 +++++++++++++++++++++++++++++++++ 6 files changed, 2168 insertions(+), 8 deletions(-) create mode 100644 2020/day4.cpp create mode 100644 2020/day4.input create mode 100644 2020/day4.output create mode 100644 2020/day5.cpp create mode 100644 2020/day5.input diff --git a/2020/Makefile b/2020/Makefile index 4ee74ce..60c4544 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -1,16 +1,22 @@ -day1.out: out/types.o day1.cpp day1.input - g++ $(flags) day1.cpp out/types.o -o $@ +day1.out: out/types.o day1.cpp + g++-10 -std=c++2a $(flags) day1.cpp out/types.o -o $@ -day2.out: out/types.o day2.cpp day2.input - g++ $(flags) day2.cpp out/types.o -o $@ +day2.out: out/types.o day2.cpp + g++-10 -std=c++2a $(flags) day2.cpp out/types.o -o $@ -day3.out: out/types.o day3.cpp day3.input - g++ $(flags) day3.cpp out/types.o -o $@ +day3.out: out/types.o day3.cpp + g++-10 -std=c++2a $(flags) day3.cpp out/types.o -o $@ + +day4.out: out/types.o day4.cpp + g++-10 -std=c++2a $(flags) day4.cpp out/types.o -o $@ + +day5.out: out/types.o day5.cpp + g++-10 -std=c++2a $(flags) day5.cpp out/types.o -o $@ out/types.o: types.hpp types.cpp mkdir -p out/ - g++ $(flags) -c types.cpp -o $@ + g++-10 -std=c++2a $(flags) -c types.cpp -o $@ .PHONY: clean clean: - rm out/* day*.out + rm out/* day*.out day*.output diff --git a/2020/day4.cpp b/2020/day4.cpp new file mode 100644 index 0000000..f0c5b78 --- /dev/null +++ b/2020/day4.cpp @@ -0,0 +1,114 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +struct KeyValue { + std::string key; + bool (*func)(const std::string & passport, usize index); +}; + +template +auto try_num(const std::string & passport, usize index) -> bool { + auto num = usize(0); + --index; + while (++index < passport.size() && '0' <= passport[index] && passport[index] <= '9') { + num = (num * 10) + passport[index] - '0'; + } + return Min <= num && num <= Max; +}; + +auto main(i32 argc, char * argv[]) -> i32 { + auto valid_count1 = usize(0); + auto valid_count2 = usize(0); + + auto passport = std::string(); + auto line = std::string(); + auto file = std::ifstream("day4.input"); + while (getline(file, line)) { + if (line == "") { + auto elements = std::vector{ + { "byr", try_num<1920, 2002> }, + { "iyr", try_num<2010, 2020> }, + { "eyr", try_num<2020, 2030> }, + { "hgt", [](const std::string & passport, usize index) -> bool { + return (try_num<150, 193>(passport, index) && passport.find("cm", index + 3) == index + 3) + || (try_num<59, 76 >(passport, index) && passport.find("in", index + 2) == index + 2); + }}, + { "hcl", [](const std::string & passport, usize index) -> bool { + if (index < passport.size() && passport[index] == '#') { + auto length = usize(0); + auto true_index = usize(0); + while ((true_index = index + ++length) < passport.size() && ( + ('0' <= passport[true_index] && passport[true_index] <= '9') + || ('a' <= passport[true_index] && passport[true_index] <= 'f') + || ('A' <= passport[true_index] && passport[true_index] <= 'F') + )); + return length == 7; + } + return false; + }}, + { "ecl", [](const std::string & passport, usize index) -> bool { + const static auto eye_colors = std::vector{ "amb", "blu", "brn", "gry", "grn", "hzl", "oth" }; + auto i = usize(0); + for (; i < eye_colors.size() && passport.find(eye_colors[i], index) != index; ++i); + return i < eye_colors.size(); + }}, + { "pid", [](const std::string & passport, usize index) -> bool { + auto length = usize(-1); + auto true_index = usize( 0); + while ((true_index = index + ++length) < passport.size() + && ('0' <= passport[true_index] && passport[true_index] <= '9') + ); + return length == 9; + }}, + }; + auto valid1 = true; + auto valid2 = true; + for (auto i = usize(0); i < elements.size() && valid1; ++i) { + auto index = usize(0); + valid2 = + (valid1 = ((index = passport.find(elements[i].key)) != std::string::npos)) + && valid2 + && elements[i].func(passport, index + elements[i].key.size() + 1); + } + valid_count1 += valid1; + valid_count2 += valid2; + passport = ""; + } else { + passport += line + ' '; + } + } + + std::cout << valid_count1 << ", " << valid_count2 << std::endl; + + return 0; +} diff --git a/2020/day4.input b/2020/day4.input new file mode 100644 index 0000000..e703e66 --- /dev/null +++ b/2020/day4.input @@ -0,0 +1,1147 @@ +byr:1983 iyr:2017 +pid:796082981 cid:129 eyr:2030 +ecl:oth hgt:182cm + +iyr:2019 +cid:314 +eyr:2039 hcl:#cfa07d hgt:171cm ecl:#0180ce byr:2006 pid:8204115568 + +byr:1991 eyr:2022 hcl:#341e13 iyr:2016 pid:729933757 hgt:167cm ecl:gry + +hcl:231d64 cid:124 ecl:gmt eyr:2039 +hgt:189in +pid:#9c3ea1 + +ecl:#1f58f9 +pid:#758e59 +iyr:2022 +hcl:z +byr:2016 hgt:68 eyr:1933 + +hcl:#fffffd ecl:gry eyr:2022 +hgt:172cm pid:781914826 byr:1930 iyr:2018 + +hcl:#08df7e ecl:grn byr:1942 +eyr:2028 iyr:2011 cid:141 pid:319110455 +hgt:186cm + +pid:991343040 hgt:179cm +hcl:#a97842 iyr:2020 +eyr:2024 +byr:1984 cid:181 + +pid:188cm byr:2005 +hgt:170cm cid:163 ecl:#a08502 hcl:2964fb eyr:1994 +iyr:2005 + +ecl:grn hcl:#fffffd iyr:2013 +pid:705547886 +byr:1928 hgt:168cm eyr:2030 + +cid:219 +pid:016251942 hcl:#602927 hgt:163cm +byr:1943 eyr:2029 ecl:oth iyr:2019 + +ecl:gry hgt:184cm eyr:2026 +iyr:2010 +pid:117647952 hcl:#efcc98 +byr:1942 + +cid:243 hcl:#888785 ecl:blu eyr:2027 pid:362697676 +iyr:2011 byr:1962 hgt:154cm + +hgt:154cm byr:1965 ecl:blu eyr:2030 +pid:779104554 iyr:2016 hcl:#435634 + +hcl:z eyr:1996 iyr:1993 +pid:#50f768 +ecl:zzz hgt:62cm byr:2017 + +ecl:grn byr:1988 iyr:2016 +hgt:167cm +hcl:#cfa07d +eyr:2030 pid:951967790 + +pid:320348494 iyr:2018 cid:281 +byr:2004 +hcl:#06a58b +eyr:2033 +ecl:zzz +hgt:76cm + +cid:83 ecl:brn eyr:2028 +byr:1941 iyr:2016 +hcl:#341e13 pid:806979833 +hgt:179cm + +ecl:brn +byr:1982 iyr:2010 eyr:2029 pid:535752324 hcl:#efcc98 + +ecl:oth +hgt:70in hcl:#866857 eyr:2025 pid:203320330 iyr:2018 byr:2000 + +hgt:70cm byr:2015 pid:#218eb5 hcl:#0ec4fe iyr:2014 cid:228 ecl:#c8533a +eyr:2035 + +hcl:#6b5442 +eyr:2020 ecl:hzl iyr:2017 hgt:173cm +cid:330 byr:1988 pid:173148327 + +iyr:2011 byr:1964 hgt:83 ecl:grn hcl:#c0946f pid:931162400 eyr:2028 + +cid:239 +byr:1960 ecl:hzl +hgt:164cm +hcl:#51040b iyr:2018 eyr:2025 + +cid:163 hgt:154cm +iyr:2015 eyr:2027 pid:838964596 +byr:1972 ecl:oth hcl:#efcc98 + +hgt:181cm +eyr:2028 ecl:blu +pid:853714682 hcl:#623a2f byr:1976 iyr:2020 + +cid:225 byr:1957 +hcl:#a97842 iyr:2013 eyr:2025 +pid:511588647 hgt:173cm ecl:blu + +hcl:#efcc98 +byr:1993 +ecl:oth +pid:871652492 eyr:2028 hgt:177cm iyr:2016 +cid:220 + +ecl:hzl +hgt:165cm +hcl:#733820 eyr:2028 cid:57 byr:1973 iyr:2018 pid:018982018 + +pid:491710153 iyr:2012 ecl:#c85046 hcl:#b6652a +eyr:2040 hgt:175cm byr:1981 + +pid:917105765 eyr:2021 hgt:181cm iyr:2019 cid:159 byr:1995 +ecl:gry + +hcl:#9d2ec4 iyr:2011 +eyr:2028 pid:149288934 hgt:63in ecl:blu byr:1960 + +byr:1923 pid:705818464 eyr:2024 cid:221 ecl:oth hcl:#7d3b0c hgt:193cm iyr:2014 + +pid:117111015 eyr:2030 +byr:1967 hcl:#ceb3a1 ecl:blu +hgt:157cm +iyr:2011 + +iyr:2019 ecl:oth +hcl:#fffffd hgt:172cm pid:215010680 +eyr:2025 + +pid:157cm cid:277 +iyr:1976 hgt:159in hcl:#341e13 ecl:#6c7644 eyr:2029 byr:1965 + +pid:787186482 ecl:brn +byr:1980 hcl:#f5dfb9 eyr:2020 +iyr:2018 hgt:188cm + +cid:168 +eyr:2023 hcl:#07c809 +iyr:2013 +hgt:169cm pid:250679100 byr:1945 ecl:gry + +hcl:#6b5442 pid:683134187 iyr:2013 eyr:2023 byr:1965 hgt:171cm ecl:hzl + +eyr:2028 hgt:180cm ecl:blu byr:1952 cid:314 iyr:2016 +pid:720794393 hcl:#602927 + +byr:1982 iyr:2016 +ecl:brn eyr:2027 +hgt:156cm pid:185583837 hcl:#ddbf30 + +hcl:#ceb3a1 pid:987624973 +eyr:2026 +iyr:2013 byr:1988 hgt:175cm ecl:grn + +eyr:2028 byr:1974 pid:350988773 hcl:#a97842 iyr:2015 +ecl:oth +hgt:160cm + +hcl:#b6652a +eyr:2028 +pid:717504683 byr:1970 +iyr:2013 +ecl:gry +hgt:156cm + +pid:453874703 iyr:2015 hcl:#a97842 ecl:hzl byr:1986 hgt:175cm cid:132 eyr:2025 + +hcl:#7d3b0c +eyr:2026 +ecl:brn hgt:154cm +byr:1959 pid:580659686 iyr:2015 + +ecl:amb hgt:191cm iyr:2018 +pid:681417707 byr:1994 eyr:2023 hcl:#c0946f + +eyr:2022 pid:302326561 iyr:2018 ecl:blu byr:1987 cid:89 hcl:#a97842 hgt:184cm + +eyr:2020 pid:457081226 +ecl:blu hcl:#866857 iyr:2011 +hgt:159cm byr:1959 + +eyr:2024 cid:322 byr:1991 pid:210415503 +hgt:69in ecl:grn +hcl:#623a2f + +ecl:blu iyr:2012 pid:524745721 hcl:#c0946f eyr:2026 hgt:176cm byr:1964 + +hgt:189cm iyr:2014 pid:679155617 hcl:#efcc98 eyr:2027 +cid:88 byr:1974 +ecl:blu + +byr:1935 eyr:2029 +iyr:2020 +hcl:#733820 ecl:blu hgt:190cm pid:509009432 + +hcl:#fffffd pid:446558583 byr:1931 ecl:brn iyr:2019 +hgt:159cm cid:146 +eyr:2024 + +eyr:2028 hcl:#efcc98 pid:330588516 hgt:65cm +byr:1972 iyr:2014 ecl:oth + +ecl:blu hgt:175cm cid:197 pid:068138358 eyr:2023 iyr:2017 hcl:#0441c6 byr:1999 + +byr:1992 hgt:193cm +ecl:brn iyr:2018 hcl:#866857 pid:905992465 +eyr:2022 + +hgt:95 byr:1965 +pid:810311252 eyr:2034 hcl:z iyr:1985 cid:254 + +hcl:#c0946f byr:1985 eyr:2030 hgt:161cm iyr:2010 ecl:gry pid:616639221 + +iyr:2011 eyr:2023 hgt:172cm cid:260 ecl:hzl +pid:594747312 +hcl:#a97842 byr:1937 + +eyr:2028 pid:134536806 cid:83 +ecl:brn byr:1928 +iyr:2015 +hcl:#fffffd hgt:157cm + +iyr:2016 +pid:035433923 hgt:180cm ecl:amb eyr:2027 byr:1934 +cid:195 hcl:#583d02 + +eyr:1936 cid:130 byr:1969 hgt:74cm hcl:50e1a7 ecl:gmt iyr:2010 pid:82008848 + +hcl:#733820 +eyr:2020 +hgt:174cm iyr:2018 ecl:hzl byr:1983 pid:087167304 + +byr:1972 hcl:#888785 eyr:2020 pid:593301831 iyr:2013 ecl:hzl hgt:188cm + +cid:282 hcl:#888785 hgt:170cm ecl:oth eyr:2029 +byr:1942 pid:014356555 iyr:2020 + +byr:1966 hcl:#623a2f ecl:oth hgt:165cm +eyr:2028 iyr:2012 pid:558908746 + +pid:#4f5b92 +hcl:#6b5442 hgt:188cm +byr:1994 iyr:2014 cid:127 eyr:2020 +ecl:oth + +hgt:153cm +ecl:brn iyr:2020 +eyr:2026 hcl:#18171d +pid:101990935 +byr:1932 + +iyr:2011 byr:1981 hgt:157cm hcl:#c0946f +eyr:2029 pid:545992967 +ecl:utc + +byr:1929 hcl:#602927 iyr:2018 ecl:grn +eyr:2027 +pid:256056759 +hgt:178cm + +iyr:2016 pid:813526512 eyr:2027 hcl:#20799c +ecl:blu +byr:1971 hgt:185cm + +iyr:2021 eyr:2040 +pid:5135078781 byr:2013 hcl:#7d3b0c hgt:62cm ecl:#dedf53 + +iyr:2013 +byr:1979 cid:269 hgt:179cm pid:871628606 eyr:2026 hcl:#53b66c +ecl:grn + +eyr:2020 +hcl:#ceb3a1 byr:1988 ecl:oth iyr:2012 +pid:558371571 + +pid:908462345 byr:1972 hgt:183cm ecl:gry cid:51 hcl:#af82df eyr:2023 iyr:2019 + +pid:106942710 ecl:hzl +hgt:157cm hcl:z eyr:2025 iyr:2016 +byr:1998 cid:271 + +iyr:2011 ecl:oth pid:191542220 +byr:1951 eyr:2027 hcl:#c0946f hgt:190cm + +eyr:2028 hgt:193cm pid:235913726 iyr:2012 hcl:#325350 +ecl:amb + +iyr:2018 hcl:#a97842 ecl:hzl byr:1988 pid:481250123 +cid:328 hgt:165cm eyr:2028 + +ecl:#a51d9c hcl:91236c pid:2538922220 byr:2017 eyr:2004 +iyr:2026 hgt:174 + +pid:959660262 eyr:2022 cid:339 hgt:170cm iyr:2012 +hcl:#cfa07d ecl:brn + +hcl:#866857 +ecl:dne hgt:70cm eyr:2013 iyr:1980 pid:780067045 +byr:1950 + +iyr:2011 +byr:1981 +pid:902964474 ecl:gry eyr:2021 +hgt:154cm +hcl:#602927 cid:156 + +iyr:2016 +hgt:156cm ecl:brn cid:315 eyr:2023 byr:1997 +hcl:#623a2f pid:339892714 + +ecl:brn hgt:73in cid:184 byr:1960 eyr:2024 iyr:2014 hcl:#888785 +pid:561655785 + +pid:579663338 +eyr:1977 +hcl:#ceb3a1 ecl:grt hgt:188cm +byr:2017 +iyr:2018 + +byr:1941 eyr:2029 pid:252436521 +hgt:170cm ecl:hzl + +hcl:#888785 +pid:378073052 +hgt:185cm +cid:343 byr:2001 +ecl:oth iyr:1988 eyr:2029 + +pid:286459107 byr:1973 eyr:2023 ecl:oth cid:273 +hgt:184cm + +pid:406853460 eyr:2028 hcl:#b6652a +hgt:179cm +iyr:2020 cid:346 +ecl:brn byr:1973 + +hcl:#ceb3a1 eyr:2026 pid:001798001 ecl:gry hgt:157cm +cid:235 +byr:1968 +iyr:2013 + +hcl:#b6652a hgt:151cm pid:504383643 iyr:2018 +ecl:brn byr:1990 +eyr:2021 + +hgt:164cm iyr:2015 hcl:#888785 byr:1998 pid:045813631 cid:237 +ecl:grn +eyr:2026 + +hcl:#733820 hgt:172cm +eyr:2030 iyr:2015 ecl:gry pid:507769390 byr:1979 cid:212 + +cid:138 hgt:176cm hcl:#efcc98 +eyr:2024 byr:1984 +ecl:brn iyr:2015 pid:968062470 + +hcl:#733820 iyr:2015 ecl:oth +eyr:2028 pid:431922630 hgt:160cm byr:1941 + +iyr:2017 +eyr:2023 ecl:grn cid:294 byr:1969 +hcl:#602927 pid:720065302 +hgt:67in + +ecl:gry byr:2002 eyr:2024 hcl:#7d3b0c +hgt:174cm +iyr:2012 pid:296913847 + +pid:42057861 hcl:bb7ace eyr:2023 byr:2013 hgt:188 ecl:#312118 iyr:2024 + +eyr:2021 +byr:1958 +hgt:170cm ecl:brn iyr:2012 +pid:064919306 cid:349 hcl:#602927 + +eyr:2022 +pid:248168906 +iyr:2013 byr:1996 hcl:#cfa07d +hgt:151cm ecl:hzl + +cid:301 ecl:brn hcl:#fffffd +hgt:183cm +pid:806659387 +eyr:2021 +byr:1970 iyr:2013 + +cid:192 +iyr:2013 +ecl:#5ad460 hgt:64cm +pid:001255475 byr:1984 eyr:2027 hcl:#cfa07d + +iyr:2012 pid:194936105 eyr:2028 byr:2000 ecl:oth hcl:#733820 hgt:158cm + +cid:323 +hcl:#a97842 eyr:2027 pid:625573908 +iyr:2019 byr:1987 ecl:grn +hgt:191cm + +pid:997956152 hgt:193cm ecl:hzl eyr:2024 byr:1983 +cid:113 hcl:#888785 +iyr:2013 + +iyr:2017 hgt:153cm hcl:#733820 byr:1984 eyr:2025 pid:138608494 ecl:blu + +ecl:brn +byr:1987 hgt:174cm +iyr:2013 pid:459148475 eyr:2023 hcl:#623a2f cid:266 + +byr:2000 iyr:2017 ecl:brn pid:469155516 hcl:#b6652a +eyr:2027 hgt:193cm + +byr:1967 eyr:2028 pid:064940030 +iyr:2016 +ecl:gry hcl:#18171d hgt:74in + +iyr:2020 hcl:#efcc98 +byr:1968 hgt:164cm ecl:hzl pid:834180009 eyr:2022 + +pid:021397352 +iyr:2018 hcl:#341e13 byr:1978 eyr:2022 ecl:oth hgt:67in + +hgt:160cm cid:213 ecl:#a46ef7 pid:157cm eyr:2020 iyr:2020 byr:1923 + +iyr:2016 +cid:235 pid:454188395 eyr:2022 hgt:73in ecl:hzl +hcl:#7d3b0c byr:1964 + +iyr:1930 eyr:2033 hgt:76cm pid:41117341 byr:2028 ecl:utc +hcl:#6b5442 + +pid:41316572 +hcl:#cfa07d byr:1965 eyr:2027 hgt:179cm iyr:2010 +ecl:grn + +hgt:152cm pid:886168412 iyr:2027 +eyr:1989 hcl:9993d6 byr:2005 ecl:zzz + +pid:661569613 hgt:166cm +hcl:#18171d iyr:2010 byr:1922 eyr:2030 ecl:brn + +byr:1958 +ecl:blu pid:978855125 +eyr:2020 iyr:2019 +hgt:190cm hcl:#18171d + +hgt:68in iyr:2012 hcl:#ceb3a1 eyr:2028 ecl:oth pid:067088299 +byr:1975 + +eyr:2020 +pid:507464869 hcl:#fffffd hgt:156cm iyr:2016 +byr:1957 ecl:blu + +cid:259 eyr:2025 byr:1954 +ecl:gry hgt:167cm pid:832017347 iyr:2020 hcl:#623a2f + +hgt:69in hcl:#a97842 +pid:426496916 byr:1947 eyr:2021 iyr:2015 ecl:oth + +eyr:2025 ecl:blu pid:543125976 cid:192 iyr:2017 +byr:1920 hgt:154cm hcl:#a7ecdc + +hgt:69in iyr:2017 +byr:1932 hcl:#6b5442 +ecl:hzl cid:349 pid:494399909 eyr:2029 + +eyr:2030 ecl:gry hcl:#6b5442 +iyr:2010 byr:1938 cid:100 pid:477259022 hgt:67in + +hgt:145 byr:2009 hcl:#b6652a iyr:2015 +pid:180cm ecl:dne cid:315 eyr:1920 + +byr:1930 hgt:65in +eyr:2022 ecl:blu +pid:671271699 +iyr:2010 +hcl:#b6652a + +byr:1989 eyr:2020 +ecl:hzl +hcl:#341e13 +pid:625435489 +hgt:189cm cid:72 +iyr:2013 + +hgt:184 +byr:2025 ecl:#a1368a eyr:2038 cid:111 +iyr:2025 hcl:z pid:7952164402 + +pid:165478949 +hcl:453b30 ecl:amb hgt:75cm eyr:1987 iyr:2015 +byr:1960 + +eyr:2022 ecl:blu +cid:100 +hcl:ead803 iyr:2025 byr:2018 + +eyr:2024 +ecl:gry hgt:167cm +hcl:#623a2f cid:259 +byr:1932 iyr:2014 pid:360279704 + +hgt:191cm +ecl:oth pid:070592110 cid:275 eyr:2027 +iyr:2011 hcl:#4a4252 byr:1937 + +ecl:blu cid:256 iyr:2017 eyr:2027 hcl:#341e13 hgt:150cm +pid:152140902 byr:1923 + +eyr:1972 iyr:2020 ecl:gry hcl:#888098 byr:1974 hgt:188cm +pid:586853292 + +iyr:2014 +ecl:brn hcl:#866857 eyr:2020 +hgt:184cm pid:422142863 byr:1999 + +iyr:2025 ecl:amb eyr:1928 hcl:#18171d byr:2008 hgt:62cm pid:42120034 + +byr:1923 cid:85 iyr:2017 +hcl:#602927 eyr:2026 pid:922322363 +hgt:68in ecl:amb + +cid:97 hcl:#602927 +pid:436567964 +eyr:2028 iyr:2016 +byr:1994 + +hcl:#9c166d +eyr:2025 pid:834335216 iyr:2011 ecl:blu byr:1946 hgt:174cm + +byr:2018 iyr:2027 hgt:187in +cid:118 eyr:2038 +ecl:lzr hcl:z + +ecl:blu +byr:1998 pid:186cm eyr:2026 hcl:z iyr:2027 hgt:70in + +hcl:#623a2f eyr:2020 ecl:amb iyr:2010 pid:743059641 cid:240 hgt:169cm byr:1957 + +ecl:oth pid:089778639 cid:305 eyr:2027 iyr:2012 byr:1935 +hcl:#efcc98 + +hgt:151cm hcl:#602927 cid:97 byr:1968 iyr:2014 pid:447599233 +ecl:oth +eyr:2030 + +pid:621084188 byr:1941 ecl:gry cid:188 iyr:2012 hgt:75in eyr:2028 hcl:#6b5442 + +hcl:#c0946f +ecl:amb +hgt:66cm +pid:185cm byr:2022 eyr:2039 iyr:2024 +cid:321 + +hgt:177cm byr:1954 ecl:amb pid:445374119 cid:137 hcl:#341e13 iyr:2010 +eyr:2020 + +hgt:160cm +byr:1923 +ecl:grn +eyr:2021 iyr:2012 +pid:286304911 +hcl:#18171d + +hgt:153cm byr:1933 +iyr:2015 +ecl:gry +pid:365430749 eyr:2029 + +cid:294 pid:817081355 byr:1969 +eyr:2030 ecl:oth iyr:2014 hgt:181cm hcl:#623a2f + +iyr:2011 +ecl:gry hgt:177cm eyr:2025 pid:446342686 hcl:#b6652a byr:1991 +cid:241 + +byr:1999 +iyr:2018 +cid:306 hcl:#18171d eyr:2021 +hgt:188cm ecl:gry pid:473752814 + +byr:2002 hcl:#733820 +pid:867697169 +ecl:gry hgt:165cm eyr:2020 +cid:316 + +eyr:2026 cid:59 hgt:175cm byr:1993 pid:531385722 +ecl:hzl hcl:#733820 + +eyr:2027 +cid:50 pid:433963708 +byr:1969 +iyr:2011 ecl:hzl hgt:164cm +hcl:#b6652a + +eyr:2020 ecl:gry hgt:186cm pid:917147781 hcl:#341e13 +iyr:2016 cid:68 + +pid:857547233 hgt:64in +cid:274 +eyr:2020 ecl:hzl iyr:2019 hcl:#866857 byr:1948 + +eyr:2022 hgt:183cm pid:557280094 +byr:1936 hcl:#602927 iyr:2019 ecl:oth + +byr:1933 eyr:2023 +iyr:2020 +ecl:blu hgt:72in + +pid:682285472 +ecl:blu hgt:166cm eyr:2021 +byr:1993 +hcl:#ceb3a1 iyr:2011 cid:266 + +iyr:2012 cid:172 ecl:#04ce29 eyr:2021 hgt:160cm byr:1926 pid:2235389773 + +eyr:2029 hcl:#cfa07d pid:387564370 cid:276 hgt:74in +ecl:amb +byr:1926 iyr:2019 + +eyr:2026 +hcl:#733820 +pid:230583200 byr:1997 +ecl:brn +iyr:2010 +hgt:179cm + +byr:1946 hcl:#866857 ecl:#87b6f4 hgt:150cm pid:298537901 +eyr:2024 iyr:2011 + +hcl:#cfa07d +byr:1961 +eyr:2022 +hgt:167cm +pid:230816154 ecl:oth iyr:2018 +cid:164 + +pid:167899852 hcl:#18171d eyr:2023 hgt:173cm ecl:amb byr:1960 iyr:2010 + +hcl:#866857 +hgt:165cm +ecl:hzl pid:325078465 byr:2002 +cid:61 eyr:2025 iyr:2020 + +cid:268 +hcl:#a97842 iyr:2011 byr:1966 pid:450468785 +eyr:2030 hgt:173cm +ecl:gry + +hgt:181cm +eyr:2026 cid:77 pid:229016136 ecl:grn byr:1929 + +ecl:#ad9ae9 hcl:z iyr:2012 +byr:2029 +cid:77 pid:#b1f685 eyr:2015 + +ecl:amb byr:1920 +eyr:2026 hcl:#92e796 iyr:2011 pid:503853254 hgt:186cm +cid:101 + +hcl:#7d3b0c eyr:2022 ecl:amb pid:536474715 hgt:64in +iyr:2026 byr:1924 + +hgt:72in ecl:hzl hcl:#888785 eyr:2030 pid:048654766 byr:1977 iyr:2016 + +hgt:171cm ecl:brn byr:1976 pid:844553043 +eyr:2024 +cid:241 + +cid:243 eyr:2023 pid:998276626 iyr:2011 hcl:#623a2f ecl:oth hgt:183cm byr:1920 + +eyr:2030 +ecl:amb pid:896953299 +hgt:157cm byr:1934 hcl:#9c12d8 iyr:2015 + +hcl:#cfa07d iyr:2011 byr:1974 pid:451819357 hgt:168cm ecl:grn eyr:2024 + +iyr:2018 +pid:908304519 hcl:#fffffd byr:1936 cid:203 +ecl:amb hgt:76in +eyr:2029 + +byr:1967 +hgt:186cm +eyr:2026 +hcl:#ceb3a1 ecl:grn +pid:594830518 iyr:2017 + +pid:20921789 iyr:2024 hcl:z byr:2026 ecl:zzz hgt:153cm eyr:2037 + +hcl:#888785 iyr:2016 cid:323 byr:1958 ecl:gry pid:118638859 eyr:2029 +hgt:163cm + +hgt:167cm ecl:brn eyr:2020 +pid:557999801 +byr:1988 +cid:273 iyr:2011 +hcl:#fffffd + +ecl:gry pid:206008517 eyr:2022 +hcl:#ceb3a1 +byr:1983 hgt:187cm + +eyr:2020 +byr:1931 cid:78 +hcl:#6b5442 ecl:oth hgt:170cm pid:039713280 iyr:2015 + +eyr:2024 ecl:amb +byr:2002 hgt:162cm hcl:#866857 +iyr:2012 pid:696390563 cid:184 + +hgt:189cm byr:1992 pid:712592503 iyr:2012 ecl:oth hcl:#602927 +eyr:2029 + +ecl:hzl +byr:1965 hgt:182cm eyr:2023 +iyr:2014 hcl:#a97842 + +byr:1927 ecl:gry +hcl:#d91aa0 pid:082227536 eyr:2021 +iyr:2011 + +eyr:2003 iyr:1953 byr:1954 +cid:327 hgt:62in ecl:utc +hcl:z pid:#97c11a + +cid:252 pid:98689392 +iyr:2020 hgt:103 +hcl:298df8 byr:1934 +ecl:oth eyr:2012 + +hcl:#fffffd eyr:2020 +byr:1993 ecl:brn +pid:338398225 iyr:2015 hgt:159cm + +iyr:2017 pid:624798709 hgt:151cm eyr:2029 +ecl:gry cid:111 +hcl:#866857 + +byr:2010 +ecl:hzl eyr:1975 hgt:150cm iyr:1930 hcl:159a9a + +iyr:2010 +hcl:#7d3b0c eyr:2024 cid:224 hgt:163cm byr:1971 pid:631469024 ecl:grn + +ecl:hzl iyr:2017 hgt:167cm +hcl:#623a2f pid:417970460 byr:1949 eyr:2020 + +eyr:2030 +hgt:84 byr:2007 ecl:xry cid:153 pid:9655548750 iyr:1957 + +ecl:oth hcl:#733820 cid:336 byr:1996 iyr:2014 pid:736143470 eyr:2025 hgt:182cm + +hgt:69in hcl:#623a2f +cid:126 iyr:2019 pid:638479310 eyr:2022 ecl:grn byr:1935 + +cid:240 +pid:804066884 byr:1987 hcl:#049f0e +eyr:2023 +hgt:174cm +ecl:brn +iyr:2020 + +ecl:amb iyr:2010 +pid:200411701 +cid:70 eyr:2023 +hcl:#341e13 byr:1974 hgt:61in + +eyr:2022 hgt:186cm hcl:#18171d ecl:hzl pid:613033358 +iyr:2014 + +hgt:189cm +iyr:2020 pid:874302209 byr:1928 ecl:blu +hcl:#1c52f4 +eyr:2029 + +byr:2026 +eyr:2007 pid:166cm iyr:2030 ecl:utc +hgt:137 hcl:8e8916 + +pid:781251989 +eyr:2029 hgt:178cm iyr:2010 byr:1942 hcl:#cfa07d + +pid:671017167 eyr:2030 ecl:amb byr:2002 hgt:166cm +iyr:2011 hcl:#7d3b0c + +pid:369327568 byr:1955 ecl:hzl iyr:2013 hcl:#341e13 eyr:2020 cid:90 hgt:154cm + +pid:169149205 iyr:1947 ecl:amb eyr:1977 +byr:2003 +hcl:z +hgt:75cm + +hcl:#cfa07d iyr:2016 +eyr:2022 pid:941218673 byr:1999 cid:186 +ecl:brn hgt:173cm + +hgt:159cm eyr:2021 byr:1962 hcl:#efcc98 +pid:792538993 iyr:2011 ecl:blu +cid:222 + +pid:#994231 byr:2024 iyr:1977 hcl:b98ff6 eyr:2010 hgt:71 +ecl:#875a67 + +byr:2007 +iyr:2023 hgt:141 +eyr:2021 ecl:grt pid:22002588 + +hgt:190cm +pid:524515058 +cid:217 +ecl:grn byr:1999 +eyr:2027 +iyr:2019 + +ecl:dne byr:2019 eyr:1942 hgt:62cm pid:5866040917 +iyr:2018 hcl:z + +pid:754032301 byr:1985 eyr:2029 hgt:185cm iyr:2016 +ecl:oth + +ecl:amb byr:1948 iyr:2010 hgt:157cm pid:153547581 eyr:2027 hcl:#cfa07d + +eyr:2026 byr:1942 pid:368975422 +hcl:#733820 +cid:322 hgt:188cm +iyr:2019 +ecl:blu + +ecl:brn +pid:535822939 byr:1994 +eyr:2027 iyr:2020 hcl:#18171d hgt:193cm + +pid:706755664 +hcl:#7d3b0c +ecl:grn cid:304 +hgt:152cm byr:1972 iyr:2013 eyr:2021 + +hgt:163cm +byr:1922 iyr:2014 eyr:2028 pid:852815945 cid:324 +ecl:brn hcl:53b08b + +hcl:#888785 +eyr:2023 +iyr:2020 byr:1962 ecl:blu +pid:407158186 +cid:269 + +ecl:blu +eyr:2027 pid:567155642 hcl:#a97842 hgt:74in byr:1995 +iyr:2016 + +iyr:2017 eyr:2020 +pid:782403650 +byr:1952 ecl:gry hgt:193cm cid:273 hcl:#efcc98 + +byr:1963 eyr:2021 +pid:639445576 hcl:#c0946f iyr:2013 +cid:306 ecl:blu hgt:154cm + +hgt:68in cid:191 +hcl:#7d3b0c +iyr:2017 byr:1935 ecl:gry + +ecl:brn iyr:2019 +eyr:2021 +hcl:#733820 +byr:2017 +pid:714110829 hgt:155cm cid:178 + +cid:203 pid:455383907 +ecl:grn byr:1965 +hcl:#866857 eyr:2024 hgt:172cm iyr:2012 + +iyr:2018 eyr:2033 +pid:462538213 byr:1974 hcl:#c0946f +ecl:amb hgt:160cm + +hcl:#623a2f +pid:116799148 cid:336 +ecl:grn eyr:2027 +iyr:2020 +byr:1976 + +pid:654088396 +ecl:utc eyr:2021 +byr:2016 +hcl:#866857 +iyr:2030 hgt:191cm + +byr:1939 +eyr:2023 +iyr:2011 hgt:168cm +cid:141 ecl:brn +hcl:#6b5442 + +eyr:2025 hgt:61in +byr:1977 +ecl:brn iyr:2016 cid:198 pid:401742648 + +ecl:brn +iyr:2012 eyr:2027 +byr:1990 hcl:#6b5442 +pid:476691172 +hgt:72in + +cid:176 ecl:oth iyr:2011 hcl:#c0946f +eyr:2028 +byr:1957 pid:959615191 + +byr:2027 +iyr:2021 hcl:#733820 hgt:165cm pid:6155507056 + +iyr:2012 ecl:blu +pid:397461435 eyr:2022 byr:1993 hgt:170cm +hcl:#b59662 cid:185 + +ecl:hzl byr:2015 +hcl:z hgt:185cm eyr:2036 iyr:2017 +pid:172cm + +ecl:oth +hgt:181cm iyr:2019 +cid:113 byr:2000 +hcl:#866857 pid:045077916 eyr:2029 + +iyr:2013 ecl:grn +pid:717028913 byr:1953 eyr:2025 +hgt:191cm hcl:#6b5442 + +pid:825834003 eyr:2027 byr:1941 +hgt:163cm iyr:2010 hcl:#6b5442 ecl:amb + +eyr:2026 hgt:59in +hcl:#e9ebf8 byr:1966 +iyr:2018 pid:677886127 ecl:grn + +hcl:#888785 pid:771218458 ecl:hzl eyr:2029 +cid:153 byr:1991 iyr:2011 +hgt:76in + +hgt:161cm hcl:#888785 +ecl:brn byr:1928 pid:913959218 eyr:2020 iyr:2013 + +hgt:188cm eyr:2026 +byr:1964 ecl:blu hcl:#733820 iyr:2017 pid:874400552 + +ecl:hzl iyr:2017 +cid:59 pid:130750853 byr:1964 eyr:2028 hgt:177cm hcl:#602927 + +pid:200888672 ecl:oth iyr:2016 eyr:2020 hcl:#efcc98 hgt:163cm + +eyr:2026 +ecl:gry +hgt:189cm +hcl:#c0946f iyr:2019 pid:741121671 byr:1971 + +ecl:amb eyr:2028 hcl:#888785 iyr:2017 pid:060053163 byr:1952 hgt:191cm + +hcl:#55c45a +eyr:2022 ecl:blu +iyr:2019 pid:326991534 +hgt:158cm +cid:149 + +hcl:#a97842 iyr:2013 ecl:hzl byr:1941 hgt:179cm + +hgt:68in hcl:#18171d +eyr:2021 byr:1938 ecl:oth iyr:2015 +pid:888616887 + +eyr:2026 iyr:2018 ecl:oth byr:1990 +hcl:#efcc98 +pid:472330538 +hgt:192cm + +byr:1933 ecl:grn hcl:#7d3b0c hgt:74in iyr:2011 +eyr:2028 cid:55 + +iyr:2014 hgt:165cm ecl:blu hcl:#18171d byr:1998 pid:601177268 cid:64 eyr:2027 + +iyr:2011 ecl:grn cid:188 pid:440822084 eyr:2028 +hcl:#c0946f byr:1987 hgt:154cm + +hcl:#f29c57 +cid:114 iyr:2010 +byr:1989 eyr:2023 hgt:61in +pid:166071094 + +hgt:71cm +iyr:2022 byr:1965 +ecl:#bb3dce pid:88829820 eyr:2040 hcl:z + +hgt:62in hcl:#7d3b0c pid:585528668 +eyr:2028 ecl:oth +byr:1941 + +ecl:oth eyr:2030 +byr:1952 +iyr:2018 pid:422437243 hgt:185cm + +pid:054717793 byr:1989 hcl:#18171d +iyr:2014 +ecl:grn +eyr:2025 hgt:151cm + +eyr:2027 +hcl:#cfa07d pid:071196833 +cid:297 byr:1932 hgt:173in +ecl:grn iyr:2016 + +hcl:#6b1c3d eyr:2026 pid:963034490 iyr:2011 +hgt:175cm byr:1961 ecl:oth + +hgt:69in +hcl:#b6652a ecl:oth +pid:771661551 iyr:2016 eyr:2023 byr:1960 + +cid:63 +pid:190cm byr:2021 ecl:#252d02 eyr:1931 +iyr:1966 hgt:101 hcl:dc9531 + +byr:1976 eyr:1925 +ecl:grt cid:203 +iyr:2019 +pid:170cm hgt:181in + +iyr:2014 ecl:amb +hgt:182cm cid:283 byr:1983 +pid:307867769 eyr:2024 hcl:#cfa07d + +hgt:157cm hcl:#ceb3a1 eyr:2026 pid:109243500 +byr:1926 +iyr:2015 ecl:oth cid:330 + +hcl:#602927 byr:1940 pid:389818848 +iyr:2016 ecl:brn +hgt:68in eyr:2023 + +ecl:brn pid:340990019 +eyr:2020 iyr:2011 +hcl:#fffffd hgt:175cm byr:2001 + +cid:264 +hgt:154cm pid:128094068 +hcl:#888785 iyr:2013 eyr:2027 +byr:1929 ecl:amb + +cid:270 hcl:#602927 hgt:156cm iyr:2018 +byr:1983 +eyr:2020 pid:621875145 +ecl:gry + +cid:345 pid:68093057 ecl:grt +iyr:2019 byr:1992 hgt:109 hcl:35d6e4 eyr:1976 + +pid:714839913 ecl:grn hcl:#733820 iyr:2020 hgt:153cm +byr:1996 eyr:2027 + +pid:820650878 eyr:2027 +hcl:#866857 byr:1957 +iyr:2015 ecl:grn hgt:167cm + +pid:600488426 +hcl:#ceb3a1 hgt:151cm +ecl:amb eyr:2021 byr:1936 iyr:2015 cid:326 + +cid:256 hgt:169cm +iyr:2014 +pid:261369952 eyr:2028 byr:1982 +ecl:brn +hcl:#733820 + +eyr:2021 iyr:2011 +pid:745066100 hcl:#3bbbd5 byr:1998 ecl:amb hgt:166cm +cid:257 + +ecl:#a38be3 cid:256 hgt:154 eyr:2033 +byr:2006 pid:5154675209 hcl:z + +hgt:160cm cid:103 ecl:gry byr:2000 hcl:#a97842 eyr:2026 pid:528503931 +iyr:2010 + +eyr:2025 cid:131 iyr:2011 +byr:2001 +pid:346722892 +hcl:#cc0362 +hgt:168cm +ecl:brn + +hcl:#ceb3a1 iyr:2012 +hgt:188cm pid:760916817 byr:1985 +eyr:2020 ecl:oth + +hgt:179cm +cid:317 +ecl:amb pid:411265118 iyr:2018 +byr:1982 hcl:#733820 eyr:2028 + +byr:1927 hcl:#7d3b0c iyr:2020 ecl:gry +hgt:155cm pid:937138356 eyr:2021 + +hcl:#efcc98 pid:793804751 eyr:2022 byr:1961 hgt:193cm iyr:2016 cid:222 + +pid:715207875 hcl:#18171d eyr:2030 byr:1974 hgt:157cm ecl:blu +iyr:2019 + +eyr:2022 pid:134624402 hgt:159cm cid:154 +byr:1938 hcl:#cfa07d +iyr:2018 ecl:gry + +ecl:oth eyr:2021 +cid:259 pid:0484880795 hcl:#cfa07d hgt:189cm iyr:2019 byr:1958 + +byr:1960 +pid:752967111 iyr:2010 hcl:#52a9af +hgt:151cm ecl:amb eyr:2025 + +eyr:2028 byr:1974 ecl:oth cid:348 +hcl:#b6652a hgt:164cm iyr:2018 + +eyr:2029 +byr:1942 cid:232 iyr:2016 hgt:193cm +hcl:#733820 pid:175cm ecl:oth + +byr:1990 hcl:#b6652a eyr:2028 iyr:2011 pid:054326137 hgt:153cm ecl:blu + +byr:1933 +pid:659875882 hgt:181cm +eyr:2023 iyr:2012 +ecl:grn hcl:#18171d + +ecl:grn iyr:2019 hcl:#866857 byr:1946 +eyr:2023 hgt:193cm pid:494553757 + +cid:331 +ecl:blu eyr:2021 hcl:#733820 hgt:174cm +iyr:2010 byr:1950 pid:405416908 + diff --git a/2020/day4.output b/2020/day4.output new file mode 100644 index 0000000..a08d9f1 --- /dev/null +++ b/2020/day4.output @@ -0,0 +1,9 @@ +1 +1 +1 +1 +0 +0 +0 +5: 0 +1, 0 diff --git a/2020/day5.cpp b/2020/day5.cpp new file mode 100644 index 0000000..04d1606 --- /dev/null +++ b/2020/day5.cpp @@ -0,0 +1,67 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include + +#include "types.hpp" + +auto main(i32 argc, char * argv[]) -> i32 { + auto seat = usize(0); + auto line = std::string(); + auto file = std::ifstream("day5.input"); + + auto seats = std::vector(); + + while (getline(file, line)) { + auto local_seat = usize(0); + for (auto i = usize(0); i < 7 + 3; ++i) { + local_seat <<= 1; + if (line[i] == 'B' || line[i] == 'R') { + local_seat |= 1; + } + } + if (local_seat > seat) { + seat = local_seat; + } + seats.push_back(local_seat); + } + std::cout << seat << std::endl; + + std::sort(seats.begin(), seats.end()); + + for (auto i = usize(0); i < seats.size() - 1; ++i) { + if (seats[i] + 2 == seats[i + 1]) { + std::cout << (seats[i] + 1) << std::endl; + break; + } + } + + return 0; +} diff --git a/2020/day5.input b/2020/day5.input new file mode 100644 index 0000000..4ed7747 --- /dev/null +++ b/2020/day5.input @@ -0,0 +1,817 @@ +FBFFFFBRLL +FFBFFFFRLR +BFBBFFBRLL +FBBBBFFLLR +BFFFBFFLRL +FBBFBFFLRR +FBBFBFBLLL +BFFBFFFLRL +FBFFBBBLRR +BFFFFFBRRR +BFBBFFBRRL +FFBFFFBLRL +BBBFFFFLRR +BBFFBFBLRR +FBFBFFBRRR +FFBFFBBLLL +BFBFFFBRLR +BFFFFBFLLL +FFBBFFBRRL +BFBBBFBLRL +BFFBBFBLRL +FFBBBFBRRL +BFBBBFBLLR +BBFBFBBRRL +FFBBFBFRLR +BFBBFBBLLR +FFBBBBBRLL +FBFBFFFRLR +FBFBBBFRRL +FBFFBFFRLR +FBFBFBFRRL +BFBFFFFLRL +BFBFBFBRRR +FFBBBBBRR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FRRR +BBFBBFFLRL +FFBFFFBLLR +FBFFFBFRLR +FBFFBBBLLL +FBBBBFBLLR +BFBBFBBRRR +BFBBBBFRRR +FBFFBBBRLR +BFBFFBBRLR +FFBBBBFLRL +BBFFFFBRRL +BFFFBBBLRR +BBFBBBBLRR +FBBFBFFRRR +FBFFBFFLRR +BFFBFBFRRL +FFBFFBFRLL +BBFBFFBLRR +FFFBFBBLLR +BFBFFBFLLR +BFFFFFFRLR +BBFBBFBLLL +BBFFBFBRRR +BFBFBBFLLL +FBFFBFFLLR +FFBBBBFRRL +FFFBFBFRLR +BBFBFBFLLR +FBBFFFFRLR +FFBFFBFRRR +FFBFFFBRRR +FFFBBFFRLL +BFFBBFFLRL +BBFBBBBLLL +BFBBBBFLLR +BFBBFFFLLR +FFBBBFBRLR +FBBBFBBLLR From c0587c664c9714911304c21e53258d5091d44086 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 4 Dec 2020 21:16:43 -0800 Subject: [PATCH 13/52] Removed day4 output file --- .gitignore | 2 ++ 2020/day4.output | 9 --------- 2 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 2020/day4.output diff --git a/.gitignore b/.gitignore index 1a8f3a8..991ac0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ out/ *.out +*.output + diff --git a/2020/day4.output b/2020/day4.output deleted file mode 100644 index a08d9f1..0000000 --- a/2020/day4.output +++ /dev/null @@ -1,9 +0,0 @@ -1 -1 -1 -1 -0 -0 -0 -5: 0 -1, 0 From 55d7ba4aeb7a71c83bf5a99bb224273e45d7c0be Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 4 Dec 2020 21:16:43 -0800 Subject: [PATCH 14/52] Removed day4 output file --- .gitignore | 2 ++ 2020/day4.output | 9 --------- 2 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 2020/day4.output diff --git a/.gitignore b/.gitignore index 1a8f3a8..991ac0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ out/ *.out +*.output + diff --git a/2020/day4.output b/2020/day4.output deleted file mode 100644 index a08d9f1..0000000 --- a/2020/day4.output +++ /dev/null @@ -1,9 +0,0 @@ -1 -1 -1 -1 -0 -0 -0 -5: 0 -1, 0 From d875b7426e8ddf446efeec8c7e6fb6eb4dc505ce Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 4 Dec 2020 21:19:51 -0800 Subject: [PATCH 15/52] Reduced readability in the name of cool factor :sunglasses: --- 2020/day5.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/2020/day5.cpp b/2020/day5.cpp index 04d1606..70d3d35 100644 --- a/2020/day5.cpp +++ b/2020/day5.cpp @@ -42,10 +42,7 @@ auto main(i32 argc, char * argv[]) -> i32 { while (getline(file, line)) { auto local_seat = usize(0); for (auto i = usize(0); i < 7 + 3; ++i) { - local_seat <<= 1; - if (line[i] == 'B' || line[i] == 'R') { - local_seat |= 1; - } + local_seat = (local_seat << 1) | (line[i] == 'B' || line[i] == 'R'); } if (local_seat > seat) { seat = local_seat; From 915ec2116f28903c148bf97e62d4f05dc0612fcf Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 4 Dec 2020 21:19:51 -0800 Subject: [PATCH 16/52] Reduced readability in the name of cool factor :sunglasses: --- 2020/day5.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/2020/day5.cpp b/2020/day5.cpp index 04d1606..70d3d35 100644 --- a/2020/day5.cpp +++ b/2020/day5.cpp @@ -42,10 +42,7 @@ auto main(i32 argc, char * argv[]) -> i32 { while (getline(file, line)) { auto local_seat = usize(0); for (auto i = usize(0); i < 7 + 3; ++i) { - local_seat <<= 1; - if (line[i] == 'B' || line[i] == 'R') { - local_seat |= 1; - } + local_seat = (local_seat << 1) | (line[i] == 'B' || line[i] == 'R'); } if (local_seat > seat) { seat = local_seat; From c33e83e373f74ad53c07d4e1a24cd5781493509d Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 4 Dec 2020 21:46:42 -0800 Subject: [PATCH 17/52] Added template to avoid writing boilerplate code every day --- 2020/Makefile | 3 +++ 2020/template.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 2020/template.cpp diff --git a/2020/Makefile b/2020/Makefile index 60c4544..fbee5e7 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -13,6 +13,9 @@ day4.out: out/types.o day4.cpp day5.out: out/types.o day5.cpp g++-10 -std=c++2a $(flags) day5.cpp out/types.o -o $@ +day%.cpp: + cp template.cpp $@ + out/types.o: types.hpp types.cpp mkdir -p out/ g++-10 -std=c++2a $(flags) -c types.cpp -o $@ diff --git a/2020/template.cpp b/2020/template.cpp new file mode 100644 index 0000000..eab58ce --- /dev/null +++ b/2020/template.cpp @@ -0,0 +1,44 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +auto main(i32 argc, char * argv[]) -> i32 { + { + auto line = std::string(); + auto file = std::ifstream("day$NUM.input"); + while (getline(file, line)) { + + } + } + + return 0; +} From b00e294fca0754e9fdbcc8ca7a5fb00c11d4379b Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 4 Dec 2020 21:46:42 -0800 Subject: [PATCH 18/52] Added template to avoid writing boilerplate code every day --- 2020/Makefile | 3 +++ 2020/template.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 2020/template.cpp diff --git a/2020/Makefile b/2020/Makefile index 60c4544..fbee5e7 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -13,6 +13,9 @@ day4.out: out/types.o day4.cpp day5.out: out/types.o day5.cpp g++-10 -std=c++2a $(flags) day5.cpp out/types.o -o $@ +day%.cpp: + cp template.cpp $@ + out/types.o: types.hpp types.cpp mkdir -p out/ g++-10 -std=c++2a $(flags) -c types.cpp -o $@ diff --git a/2020/template.cpp b/2020/template.cpp new file mode 100644 index 0000000..eab58ce --- /dev/null +++ b/2020/template.cpp @@ -0,0 +1,44 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +auto main(i32 argc, char * argv[]) -> i32 { + { + auto line = std::string(); + auto file = std::ifstream("day$NUM.input"); + while (getline(file, line)) { + + } + } + + return 0; +} From 22a1663d28bc8aa8705d4b4e33524fdd87554652 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Tue, 8 Dec 2020 10:00:51 -0800 Subject: [PATCH 19/52] Completed days 6, 7, & 8 --- 2020/Makefile | 16 +- 2020/day6.cpp | 64 ++ 2020/day6.input | 2249 +++++++++++++++++++++++++++++++++++++++++++++++ 2020/day7.cpp | 104 +++ 2020/day7.input | 594 +++++++++++++ 2020/day8.cpp | 113 +++ 2020/day8.input | 610 +++++++++++++ 7 files changed, 3736 insertions(+), 14 deletions(-) create mode 100644 2020/day6.cpp create mode 100644 2020/day6.input create mode 100644 2020/day7.cpp create mode 100644 2020/day7.input create mode 100644 2020/day8.cpp create mode 100644 2020/day8.input diff --git a/2020/Makefile b/2020/Makefile index fbee5e7..ede9575 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -1,17 +1,5 @@ -day1.out: out/types.o day1.cpp - g++-10 -std=c++2a $(flags) day1.cpp out/types.o -o $@ - -day2.out: out/types.o day2.cpp - g++-10 -std=c++2a $(flags) day2.cpp out/types.o -o $@ - -day3.out: out/types.o day3.cpp - g++-10 -std=c++2a $(flags) day3.cpp out/types.o -o $@ - -day4.out: out/types.o day4.cpp - g++-10 -std=c++2a $(flags) day4.cpp out/types.o -o $@ - -day5.out: out/types.o day5.cpp - g++-10 -std=c++2a $(flags) day5.cpp out/types.o -o $@ +day%.out: out/types.o day%.cpp + g++-10 -std=c++2a $(flags) $(@:out=cpp) out/types.o -o $@ day%.cpp: cp template.cpp $@ diff --git a/2020/day6.cpp b/2020/day6.cpp new file mode 100644 index 0000000..ae1035b --- /dev/null +++ b/2020/day6.cpp @@ -0,0 +1,64 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +auto main(i32 argc, char * argv[]) -> i32 { + { + auto line = std::string(); + auto file = std::ifstream("day6.input"); + + auto answers = std::vector(26); + + auto sum_1 = usize(0); + + auto group_size = usize(0); + auto sum_2 = usize(0); + while (getline(file, line)) { + if (line == "") { + for (auto i = usize(0); i < answers.size(); ++i) { + sum_1 += (answers[i] > 0); + sum_2 += (answers[i] == group_size); + answers[i] = 0; + } + group_size = 0; + } else { + ++group_size; + for (char c : line) { + ++answers[c - 'a']; + } + } + } + std::cout << sum_1 << ", " << sum_2 << std::endl; + } + + return 0; +} diff --git a/2020/day6.input b/2020/day6.input new file mode 100644 index 0000000..f8efe7a --- /dev/null +++ b/2020/day6.input @@ -0,0 +1,2249 @@ +fekdcbayqxnwvh +fycwqktvxandeb +kqbafvcxyewrdn +akwqcvenxfydbs +ewbaxdcvnkyfq + +timjneyhbvxkfagdpzrous +gsumijvxoheptbafnkyzrd +yxtbnupramvdezhkfojsig +soaruhxnpiemjvytzbfdkg +vfanlgjoiskzmubtxhceyprd + +dhgabzfspkltq +pflzsbtaxhqdkg +kzpbfgasthldq + +xeu +uoe +tnpeox +e +vrdzwglecbk + +nucwl +hnmx +fqv + +kfubtzpovrdlw +vdjmblrztpkosfg +kavpdbgfzreol +qpdzfrvokibcy + +yhknrqpubeolzixtvsj +tlysdjzovxhnuqreimk + +bclpmatw +btqmcw +cvwtbm +bmwct +ctmwb + +qmo +oqm + +su +s +s +s +s + +ztfmocgiesxdq +fpjmthksidlbo + +smzbn +bmnzes +skzmnb +mbszn + +kibmrznqcyladupv +umnbkdpievlqcyar +idavpbmnrklqucy + +favynhqocijkmtbzsrulp +ycbzrmkuvlhnpfqsitjao +ujbomprktafvliqhycnzs +nymjkczihqbpfvutosalr + +tdev +vh +wva +va +gzv + +d +d +d + +ejrmqwg +merjguw +jmreugw +mjrgwtie + +wxiqgpu +guxqiwp +puigxqw +pugqwxi + +ealugrzsvhpxfmjdbqknoy +doyhvplkjqarnbeutxsgfmz +uhvxjaklmzoyqdbegrpfsn + +iv +os + +o +amtle +n +npz + +vbfxystq +knsxyqubtvf + +t +p +p +o + +xtz +ptz +ftx +ujt +tp + +rs +qdfan +mkpz + +idewynukmzac +yacfmdwuizke +ieuamdczkywf +iczwymuekad +adwekumyciz + +agnq +gn +gno +gni +vkmnxug + +ftlyhuvaj +xsribwknlgmt + +a +nay +a +a + +leq +q +qj + +sxrwi +isrwx +wrsix +iwsvxjr +rixwbs + +p +p +p +p +p + +unvlyxripzbmaedwjsfqth +uvefyibspxrzjdlwtqhnam +hnbapqzflsvxreiutmydwj +nwdefhtzrxuqpsvljabyim +razbwymsdfpnlutqxveijh + +zfihqcvwdbsm +sufwpahczlbvd + +tqjanyicszeodpmk +ljmtwvkrcfghdqbu + +ydxnthpazbskufcq +txymsjdfhwuqbz +vhyuqsfjbxdrtzg + +smyvegtwiu +imyqtuesv +idrluzhjatkvpc + +pzacglju +pzulcagj +jcalgupz + +rgzbvefacsw +vafbrezcw +wegjvrczfqba +zwrvabpfce +rlhekwzyfbacovm + +hfqu +fq + +kywvrsxgiojp +xosvigpkwyjr +irwkjfvmxpsyog +pvxyrwiksjgo + +ynebghqmrkcjlpiuftdoaz +reaqjoyngdbiltkmuphcf +ynobfdgluriphskejcqtam + +uac +ca + +fmxawgkrin +xfrnbigok +sfighjeckrux +girxkfl +gaxirnfk + +smoyaxbku +uobkxysam +kyszxumojba + +uocvgjr +hjponwcuzg + +fobhkeascqluwrzm +hzcolfipysnrjaguwkeq +ezwlhkcfsoxqrua + +blnosjgezuqcrvxwm +cmeznoglqxubwjrsv +zxnqvwoubpremsjcgl +umxrlsgqoczwbvnej +cuxanesjkivzrmlboqgw + +dewtyuqjlv +ucvazfm + +kbm +imltbj + +ydqnxlmbouvaztcg +vhrkwxjzfnpisye + +jqeadkcibtgflsz +ltbxqifjedsawkzcg +zdfqgkijestcl +jczfqdektlsig +scdgufyjeizlkqt + +w +w +w +w +s + +wygptc +ygctpw +gcptyw +tpycgw + +xaqicwhtdpvk +aixdcpkzhvqwt +qkcdhxpwaivt + +wt +xtrowm +wt +wt +tw + +sncq +cus + +zehxb +txe +exuma +exz + +epjgfknhvuwmr +nkwrmfhjegp +rjkpynefgmwh +ehfprjkgndmw +mewkfdnrgjhp + +hgyc +kgc +ghc +cgxjzl + +evsloum +leosvmu +mejvuzoxdsl +evmolsu + +fugckqhymrxbtvdpnose +beyorulcqxgdkzafh + +s +s +sq + +wtjfgezdhsxckibrqyunvpo +uaonrpkmidbgftwlsjz + +mrylewxsgvfodhu +sfdxoyghwlrvmu +dungfohvlwrxsym +ulmsoghvxfrwdy +uoifgdlwrsvymhx + +tbg +btdg +tbg +tgb +btg + +pukht +huk +fhkqu +hykcfu +hedvmgubsk + +dxycvosnr +xcsdyrgmapf +qoyrsxdc +uedsxtyrc +ucdrsbxy + +m +xz +m + +gcjsybuhrotm +dojcsubhprt + +opmgsudhej +mjceogdsuhp +djpgmoushe +jgeptsluhfomakdvyq + +jugocetyrzwfbhp +ipvqwcozxbsdu +gybprkmznowultcaj + +ipcau +n + +juzmidp +iudjp +digjups +pajiud + +zxnugrosjvlcphwmqbdyt +bvtlmqnudzrjwysxcohagp +tdxhyuwemcvbrpzgnoqfjls + +hoefmguvxyiazwcpbrjk +umlbagzxeowthjfpik +hmxeziglfbwjup +jgxbspifzwqhneum + +mgvupsk +ezwcui + +adczjnguyq +ygnujdacqz + +ohricgqjfu +rqgucfhoji + +vygwkszidxqa +onxkejczsguywqv +stvzbqypwmxkg + +ydjm +fpbustykx +yrq +ry + +vjphn +npvhj +phvnj + +bryndzmekui +oathqpcv + +yczewurklaxnfdhoqbt +rlyhawcdunqeofxkzbt +lhbsqfkxctyonwrdzuea +zltnhdkqybaxufoerwc + +cjwarkog +joawgrkc +wcjgkrao +wrcjogak +coerwgsajk + +umwjqsetdg +sjwmet +jbteyhownvsaxm +dmuspcztjrew + +xtswpc +eahncvzqxkgmo +lcixybdrsuft + +pcrfwszodmqnj +vrcylgb +iruc + +bqigzouxryndpa +jaixybnro +oabixhnjry + +pbznr +xrb +bdntx +qecbyi + +zbvhxyfm +vxmbyfpz +vbxzmyfh + +nfcqwuhsrxojk +jrqvokfscnxuh +nxqiaulkrojszchyf + +dkwqfb +wd +hwd +nhwd +dnw + +vjtpxorsdyzbwhqi +kirdlmofpnectxqwuz + +ynzxtvqogrdhwl +yhdjomktn + +hqwn +hnwq +hnqw +hwnq + +gosxz +xog +gfomxa +ogxd + +wctesuhxonyl +oxwhtecynusl +cslwxehupyton + +pr +spr +pr +pr + +maqfseovdhzj +sqodparevimfzjl +dxosqmafejvz +dqzojehfasvm + +awsicurgfmxeqjylnvktbd +dywmreaitvjgcnbklxs + +wmvbnqtxuriz +hbuwefypzlkadq + +asjcpwml +lcasmjpw +ajspcmwl +cmslwjap + +unkrl +n +ny +yan +nv + +zrjwsxduie +jswxrziunde +xrujwhsidze + +qnl +unc +xhtdjbvf +omauis + +wxvoqihatseg +setwqgi +ewgstqci +fetwqgis +wqtfgkiesd + +vmpikgfsarbnxqudwjtoh +bdovpatjgnxkqufsihmrw +bjhnrtaokxudmfqpigwvsc +kaqbvihwmsnxjpgrtoufd +fmabtdgkuhxpwrivsoqnj + +eazsitkjronml +otmrenjakzsi +samrojenitzfk +tkzenmrjoais +tszkioaejrnm + +r +rbq +r +r + +lwbrfsuahoq +yjawifugdtrvs +rfbaswu +cfsarlknupw + +ist +ay +kc +cu +kd + +mbku +bkva + +sxktwmyfaldbn +ymkbnfpdltx +xbyftnmkdl +dlkfetbimxycn + +cjru +rcju +rjucl +kcjrum +auzcjrtn + +vkinfzqbrled +rinldvbqfze +rqizebfvldn +aciqrfbsnelvxdz + +ig +ig +gi +gi + +rskzxocuq +kcovqsnztur +skzocrnyuq +vourxysqzkc +opescqukrhjz + +i +u + +xqfviycpuzjbwkn +lnxbfkpcyqdawm +xofypnwkbcqv +wbvxcfkqtnpry +bnoixpfqgkcwy + +ziwlofkdgpc +qzayrwjvks + +krybec +ryk +yrk +kyr +yrk + +xkhdreqfbyipmzalco +wiepqtyhxflvcomabjdsz + +jpgankzcvbtw +kxzugtvnbjp +gknqpjxzvtb +kbtjpvzgmn +bptzvmjkng + +hdaxwiypslz +ndbylw +xdkwtflpyqsz +wlrvcdyjg +mlfewsqodyu + +c +c +o +c + +mah +a +gwa + +heczudoqwmvtyab +acevwozyqtdumhb + +v +e + +rom +mor +romi +rom + +uxdj +d + +p +p +m +db +t + +dtpzeykh +pkdhryzetu +zdkhtpyac + +qanetkhrc +ndlhkceqof + +khbfjlnacvz +cmavfjlkn +aynljofvqkgc +tlkjcnavfm + +ejcbnl +mbgcoiuhsfl +qblyc +blyjevc + +vgqlcfhnx +xwgonuc +pystigbca +cnqlgmdk +rlfcwg + +nazyhitgcjr +nytgizahwprjc +zjcgrinmahyt +nrcdhzgjyati + +xtljebqpg +bpjewtgn +gjtpebx +gmoipkebtcsj +ptwejlbng + +e +exa + +h +nohegc +h + +ivbgpd +isfglyvbdo +dgvbi +bdivug +gvikbd + +wyjmpxghiqfeoctdnbuar +qetnaimxlgsfcbrpj +kbcrhxgjnqpadefzimwt + +kindbwqlusyh +tpzryjgehaucfmov + +wzgou +ugo +guo +voug + +ndwhzsrugpjmltxiqofvkbyc +lgirqyotwjbmvuspfnxhdzck +jbqzgwcvhxofkrmsdlytpuni +xrqzfjolsywtcghdbmukpivn +oqryngdmhljvctxwkbfusipz + +saw +as +sa +msajv +sfa + +oxtrnhvfqyswldb +tmzwgrakc + +coqyrbzjhsmwivanep +xkshzgft +hsz +slzh + +z +glh + +dtusogw +fmpkzvbxnjwh +eaqdciyw + +bgcyqhrztvdxwn +vqtanbyurxczowdg +kmjxyvnbqztfgcrwd + +vospejybinm +fiosvkbnjep +johqpznbeisv +iysbokmjvepn + +nxsrfohagwb +agblosrxwnhf +xgircuhsaobfw +hfxpgosarnbw + +bgqurk +eumkrnvxqg +gkrqhspafuoc +qtogubkr + +bxlapnm +nptix +oqxpn +npx + +rytbpswaezlufdqxo +imazhtjqnglc + +encpqudzigamorv +vamkeznqirdcgp +opvrglqsmcindzae +mpvncrisdezaqg + +ikxqemun +zadbkqjtxney +kenmpxuoq + +vjdqxfyhckrpton +hmngcfpytkdxqvo +ohdvuywpstzkcaqf + +tepj +te +ecvty + +jqotiphkmsexvfugd +gwpyfuhlevkdiotjqx +tjkfvghibocaqxeudp +onexjzpgthuidfkvqs + +ltfq +lqts +oqtl + +nqsyglepwzhmtiojbuvxf +wihkgaoydpzvfxclsenqjmt + +fqxmt +bsgtmxqyrjfdv +tfqmx +itmhqwfx +qtmxf + +rgv +vjwo +nlekpa + +ldytkguwhazeqpb +pqzaytglhbmfuedki +dqbatkpyezhglu +ztgyqjebhkdvpual +kpalzeytqghudb + +xsynhr +hsnury + +qyjukdtmnwhrczvolsb +ymsutqrchdblznowvj + +mpw +wmq +tdwm +wmd + +n +n +n +no + +vnutqbxrygmjwhks +rhoalixstfyuq + +jeyfhsotc +setchyoj +hcyoejst + +ylhpvfiawoekjbq +pkroabqvljiyefhw + +akqbyjpziglmfedw +wjdbyeaqpzligmkf +lfikyqwzbmadjegp +aswgkzdyfrqpmnlibje +fqpmyedjklgzibaw + +qe +eqo + +jbxoe +qoikde + +c +n +j +j +j + +rfh +rhf +rfyh +rhbf +qfrh + +hokvgpxyunam +bmpyogvhunlw +morevjuznhydgit + +ohns +nhos +ohns +hons +hsno + +kxclzyqpan +aexnyqzkpc +pakcqnxzy + +gkytw +mgtw +gptmw + +fixsozjwykhupqmvtbrc +syimxhzbpwcktrofuvjq +xuiwfjvzcpykqhbrosmt +mwrbvqjtkcsipxfolyhzu + +bzhxpyfmk +yfzxmakphb +mkzpxbhyof +hbmzfkxpwyu +pxzhkoybmf + +osdyp +dbsroy +sydoj + +yterzphvxdm +vtxrmyhzedp +vymperdhxtz +mpxrvyhedzt + +esakn +cseak +hxasge +enksta + +u +gfzua + +jsymd +dmxjy +jmdy +xymjd + +sezfhlvxmaqtd +ajvtmqsecyghfixzwl +ksbhxzvafqpmuet +zfeqytxhadmsvc +nextsvazhmyfq + +rucla +auclyr +uticrapl + +akizsuwdmnhpxbgyceft +gwxpfeoyihcklbndasz +zwhsbigdynkpxceaf + +zag +vmisa +yphkcant +jdma +bia + +nplydbkoq +oasptkqgldnbey +doypnqklbc +yblkodncpuq +lqkynpdob + +hmj +jm + +gniearxpdbjlkfm +qdvjlute + +omsihqlnwzbt +blzmhisnqoftw +onqlmwsetzbphi + +jzoxcwdf +wdcjzifxq + +ykdshgzwjfecimnp +jhipmsaftezkoc +ziaspcjfmkhve + +t +t +t +f + +zmevcjhbsainxoquwpftkydlr +cygwbtvxemnzfjhrqkdspaolu +efdtnrlwczymxqvpsoukjbah + +oujkhnlzydsirva +dxgzjsuptaohqvnkic +aoiujdlnkzehvs +uriadhksjyoznv +iydmovnzakhfusj + +ycajzrtie +zctyriesap +pxiacrztehby +qaenyxtzirc +saecrytzi + +xrnjkgdpuzqvcm +ndqkvuxczjpgrm +ucgmzjpqrnxkvd +npqxkumdcezvgrj + +thymlxwaoz +ylhowtmazx + +nwaisrejbtqfmh +mbwhqnrfjesa +hfnrqebjasmw +jecwhfgrsqodanmb +qasbhnjwferm + +ny +ny +yne + +lgkmfbthwaouscxpznvyrdi +nhlmtpwyrojfvbuaczxkgds +askbuvdozmnxhfygrlwctp +fytznqhlbmxgrwcdoupavks +wcplxyvsrdjnfgkmuzbtaho + +fklceui +kclfiue +klefiuc +clfekiu +iklcufe + +yavcmhwbp +capvymhbw +whypmabcv +pbzmcywvhja + +lbevjz +gnvefbu +webvd + +ewzcqndmjhvy +jevrqnym +guqpiotaevsbmynlj +vqmekjynf +nefqmjxvy + +akgwyjfi +giwfyljak + +pdejr +jerd +redj + +liwtk +kiwl +wikl + +rbwvox +bxvnor +vbwxro +vkrxob +xbvirwo + +ntsbkwqefjphro +nqdvgxihopwc + +dn +nd +nd + +j +f +g +k +j + +tfsul +usftl + +ov +v +w +tj +sl + +gdlufaesv +uagvd +vudag + +cbegxmuiwkzo +okrmgbfwvnecp +uybxehawmgqkoc +yloqmbwgtczke + +jms +ymsfjo +lmsuiwhe +ydsmk + +wgckujsd +irp + +zgeulsjvimptdaxrqnk +zbxtefdmvganulqprikjs +ptslznrjqkxemagiudv + +fqtb +qp +aq +q +q + +hrkzci +bhwkpidxtflcue +hkic +chki +kcjhiv + +gi +s + +rakewmostbfvjzgi +begtioavfrkzjm +zoeikjtbfagrvm + +xnbhdlctm +bgfhwlxsaqnkov +pelmnhuxryb + +e +qr +jh + +vhtwuokdqpa +jfaniksczbeymr + +ngedtljsvybxkmhfuzw +tbzedwsjgknvhlmfu +lzbgdsuhkjtvermwfn +smizqluwdetfavbnhjg +blwtngusvdjzhefm + +lxaiqvkoh +feioxvwbsrl + +fy +yfbqlm +fy +yf +yf + +cuygpzd +kv +k +v + +antp +nat + +uk +ku +uk + +tdjbri +rdwezgjtlck +stvfhapyx + +psu +spy +ps +pksy +bpsq + +db +o +o + +yi +iq +pmxi +i + +oxt +atox +txo + +wn +sgzth +b +m +ynq + +ayxvhzu +vhyzxu +hvzuyx + +cxoygklt +toky +ovkpyt +voystpk + +yqtjwifbvsn +vstyfbxjqwin +vsjtinqfwby +qxysnitjwfvb +bjfynsthqiwv + +zobny +zynob +ozbyn +noybz +onyzb + +inpdmtkblgqrvaowzxu +zhrbpuwiqdomgvlnt +topveguwzrcbndmqli + +eapmtqrski +islukrmpe +sevcbzfngx + +pcbl +vxqwe + +ky +t +p +qzfo + +bkhdlpnrxezivu +lztsfxpgknho +knwlxmzjhpy + +t +ita +oqt +sbt + +omwk +eowm +wmo +wmo +osbtmxwd + +dwgpvjemitbcnuhr +vyjlitenkbpmuhqwxd +iedvbwjczstunpmhg + +yfakujntsriwgxm +rfatigyjkxusnm +uyxitmkagnjfs +isjafytxumgnek +tiknjmugxsyaf + +pahkyfojrv +enxmd + +sehnkcr +shkrc +hcwxilkru +skgchrfpjt + +zdcvpant +nizclpmtgbv +jtcpnzv +phtnscvza +azcntrowvpd + +ativhgmyedozw +nvztmiahewg +uhaimgzventw +txiqfmzglphvwae +ehmgiwtzav + +qdpreikohtyjc +ihtydekrocpqj +djkoticqhpery +jcorkdepqyiht + +kgwunqm +qgjunwk +oinqruwzyk + +wtkqceimludr +mkhpwdcqleurzt +mqweldutkcr +kdtmwceulrq +rqlutcidwmke + +k +h +k +k +k + +irb +arbi +bri +irb +fbxvri + +umpkng +qmnugpk + +sbdxmlzacj +sbzlcamjxd +cajmslzxdb + +fwndcxr +xbmusn + +t +t +gh +p +t + +zovqiwdhuaslkjxrbcnt +flhnkoxvadiqrwpzbjs +gqkisrxodznabjwvlhp +koqlswdahnzjvbrmyxie + +apecofvgshiyqbj +icegjhasytobfpvq +ocsheqagjfpyivb +pewjncobqiysgzrfahv + +wzomnlgyxj +thazprgi + +rywgaemsubhvkqcozpnxl +avehbwolxnzmqyprgu +qyrgpxhazluvenobmw +jhtrzywlnmbeoxvgpiaqu +gavmwzrponyxhduqble + +tw +wt +tw + +qpzxrctf + +iqpunlsawtcykmxbdvgfzjr +vnwdruyptakbgqxjimlzcfs +fgizdmcblparnsvtuqwxkjy +pxwylavndgqtjbicfksmzru +xtpdfrbkcglzvqjuminaysw + +xkyvhtdwpjnulig +hvegnyitdwxjz +vthsnxjaywdig +whdagyqvxjtni +wjvgytdaxnhi + +ygduev +clqoa +qxc +xaz +fc + +rzeqvofasyhjgxwkmtcudn +vkuogexmwhznrycdqft +zupwcondeklthrbvxgmyfqi + +mtredzn +xcnozebtrmd +elzrmwtund +emtdnrz +tedmzorn + +tlbunpqygz +xmehasrifvwj + +hoskgitlw +owrailhtfkg +wigbjvhtolk +tbhivwgsuklo + +fxnachtsdmiwvuzkg +hacwldskfgvuixmtzn +xghufdizawvnmsctk + +gnauvfizjdortq +rinjautyqdzvg +giunqazvtdrjmc +wndhjzuqviatgr + +vtpsy +sptvy +svpty +ptksyv + +yaskce +xdtvyjnqma +faoyb +psyfa + +lbxounj +lijrmoxnb +mioybjnx +afbjnvopxsch +bjlzoknx + +vqmsgwjfkzdbthal +jszvlwthkmqfgdba +akmfjzgldswvqth +tuswfahjmdqkgvlcz +jvatqgfmnwzhdksl + +uqyfkzdwta +hctzeiywabpgvlqonmuf +zyurtaqwsxf +wyruzjaqft + +rwltyhqdecxagbov +azthexlkoqmvrdngcwfs +corjvwqhutexadlg +lecogwrhavqdtx +qpdvrgctyaohwlex + +egsilhd +hxmijg + +tzdmnvsyiwjrhakbgp +wmzhsctpdrbnagvyei +bvwtaylgdnzhsmipr +rhmlswzvpandgtybi + +qriopbacexhnlwfvsmdk +wblaondrszhcfpei +pdnahlrjseiwfcob +cerwaoshjldbfnipzu +oalsrdienwcfhpb + +xcpe +pcx +cxpl +nbpyzixc +lpecx + +xyfcgdaew +jdlcopnaixqbv +ehkcdrax +dcytarmuhgxews + +bqozpsd +pqzosd +zgqdop +ocqzdfp + +uxy +szj +jzl +fhvk + +muz +m +omycvi +im + +t +u + +xslkmbzarnfeo +axmndjpsqzelrbkfo +eykroszbaxlmhfn + +rsz +rzq +kzrit + +hkmqiydpzlosuanvwj +czsjklbvwaidhnxpu +ejvwqmatlkziundhps +udgjnfoepkwilrhsvaz + +czlnqtdy +bcv +cvga +hvcb +ac + +lcmytwdeqifzakjhuon +mdqxhfgpzykvteajn +emfpxqnhbykzdatj + +rtgmujlen +eguclrkmtnj +npjgemtrlu +untmegrjl + +olykiz +orxyswdtka + +qelnh +yijmfxtvbs +gweh +wrc + +vjcediawtnrmoh +lvnhmabrxcjwet +ajmkbntrvchlegw + +yicrxeztbdpjuqlfgnvksmah +rayjtgdsfhexiqvpcznlkubm +crxijflabsgkhtqmdeunpvyz + +gpbklvxy +pybxg +ypwgxbd +gpxyb + +vos +sv +vs + +hqiktnmezpvacby +uekhv +egskvh +kvehog + +myhoetiwlqrpdk +pgfkbqleywmhtic +tezpslhymwkiq + +t +vxh +g +t + +gjimn +ijugmn +njmgi + +drojlynvs +nrysdjvlo +lydosnjvr +sjylnrodv +nyjrdvols + +vjrclek +vuljbckqfteds +cihklevgj + +rqbvni +flxuv + +gpywjntefcm +cnoaetmyjpgd +mpeynjcg +rbnpymcgexzhqji +cjumnegpwy + +h +c +h +h +h + +hzrqoybi +wynqkcmlduae +zqybh + +itnoq +rtinoq +tqhlin +imtbq + +moetialxhyqkznjwscgdpv +qwcagyzjvtoednmixlsphk +kxqajsiotvnlhcgwdzympe +ynejvlhsopakcmzdtxgiqw +yaxdpiqktjsozmgvncewlh + +qyrlgevbzsutwmxjhindcaokp +vtdjrqaocngwehspylbukmz + +aev +ve +a +byqg + +ycfvpamkhliot +wmckyrthxusfqiedjlaz +atcmhkboiylf + +sfqkmlhdc +mlhkscqdf +fcqsdhmlk +kqfhcdmsl +kqslzfdmhoc + +dgveoupsmhabyfkrztclj +vedwkmptusfhzaygqolcr + +tfoaevgbi +yfu +sfwqh +kpfxlj +dufl + +mlwhb +jvgtzp + +jzp +szwipyj + +larkxcqsbpeuiv +fharycntpzi + +lsympnqboj +nlpjmobqys +njoslbqpym +qsnodjtlmbyp +lnosbmpjyq + +jpovmflgikracyqunwthe +hawgrlcyvpnmkjeofuit +pltojwgrcfkhaneuivmy +klaoumwtfgejnhcripvy + +hmvxakwrtundglz +mkacvnhwrlxbzdug + +asvoizlprxjefycmthugnqw +zohmwpxdaiyvrfnulecgjtq + +natmhjdg +zctmdalg +vbiamufq + +vhxbajdokyn +dkvxonyhmab +hnexvbdaoyk + +gyjfnm +gmfnyj +jfygmn + +bjqn +bnqj +nqbj +qbnj + +hawjpsxeolr +rwlqenjhpsobgamx + +tovhgbwjdckpqn +ifzl +mleysuzrax + +sky +ky +mgfpwk + +zx +h +ict +gz + +zsjitm +lijor +jmwabyit + +nbzmj +abvfwrdn +csnbm + +hdqyski +ywvclhdsq +hsqbyxd + +jmt +mtsuhxjzkla + +fijlt +psjbtfieg +zqcohan + +gwnfpqb +pnwf +wpnf +wfnp +nwpf + +irgkabh +khgibar +akgirhb + +emonkbuycsz +noyzscmuk + +ejsqzftblax +scomdrxgibw + +afdjtiyvgqorsmnhubweplkxzc +fmznscjliqbyevhxwoktdugrap + +cgyxhiubmptdokesrjzlafq +pmdqvjuygbeslzatokxfr + +hyawt +wh +wh +wh + +vojux +ei +nq + +pvnjgmxksluctq +zfrdoa + +d +z +x +xd +d + +dwpscgknx +kwxc +xcwk +wxkci + +qipb +ildp +ziacpr +pbdi + +x +xb +x +x +x + +fenqcuwi +niczkhxeq +mcejqnxit +iycrngpqel + +uyj +yju +yuj +ujy + +b +bd + +e +e +e +e +fei + +tncbizahupsdwlog +oclbqdskwnaymx +atloswndebjcriv + +msojaeqnphzylgdbc +ebmzlphcgyjoadq + +apehlz +tozlmeba +ekyflaz + +qpnhfgjdzymlctkrb +slmbhkqpfyngzj +mlpqjyzbghnkf +nmzghjyblkfpq +bngqfhymkzpjl + +apgvczsfuybdiklq +gmhxdubftesavzlpjcqyi +aswyzugkicpfvqldb +oylsvgbcnuqzdafpi + +ncrkh +nhkrc +kncrh +hkrnc +hcknr + +nvrjtzamfuhqxp +ebdigavktsywflmco + +evrabhcmxkonl +vlcxmbnkrheo +cxloknrmeb +pkclmerbonx +lbkoryunexmc + +zdmhgatfpqcwrsu +beravdksgly + +wfo +fw +bfwh + +kpzlhbtjfiw +fjwpzhkbli +bfhpkjzwil +pjwoikhzlbf + +yworad +adsyr + +atqhenzlswmufgkojrb +lfoanzusbhgtjkyeqwm +nsgajlhqeobkfztwmu +mlcisaozwkhetnqfjgbdu + +xhqkmdutfzasylbw +hqubgdwxlztkmsyfae +pfhuacyitsqxmbwlzkd + +tqbpnosumlj +jdtpqbyoli +ulobptqjn +tfqlvwzopbajc +jxpeobqtulis + +awg +wag +awgk + +czbledy +avgwqu + +kf +f + +bh +gm +tj + +l +dm +lspg +zfeauxn +qt + +zwep +pwze +wpze +ewzp + +jptngbzhk +tgnkrpzxdjh +ghjznktp + +ofrbuieszcakqt +snomauqcerdpbt + +nbjxhyvtpl +tbxzgovhjy +yhbtxjovizk +bytvxhj + +pibogfjn +fogbinjl +bonqgfji +banjisugcmwfvoe +iobghfjn + +tz +t +ta + +qnraf +qrxf +qfr +ezroqf + +iachtzfemxwbs +gzsfycehaqwkm +twmhzcsbrafe +zmafhcewxs + +gqoznmrlxvudwehf +uvzrohmlgdnwqxef +frgvqedxohmlnuwz +fqledmnvwghruzxo + +rxcvnyjbqgm +cjygxmrvbqn +vuybxmkcrnqg +ipgrxvnobcmeyq +yvqnbmrgcx + +ay +ay +ay +ya +ay + +np +xa +ba + +ibrcmtxqvyaed +vycdaeitmbxqr +dvqiytmcxabre +dvbaicqeyxrtm + +hgzd +zdlho +zhd +zdh +zdh + +hcipn +zchnipb + +rwptzv +ymoedzaltsc + +ubdwmjecyqxltipzfn +mvfulhydqewjtzpnci + +najhotpuyrsxdlqbk +wxetrjaobduqpznklsyc + +jwcgbxoipeyfmkvhr +cmblwpoudxteyfvnhkrg +qzseparbjxvykfocghwm +eqvwroycibpxmfghk + +xwedaqgiznj +khubyeatir +avgncxeljzmsoif + +zf +f +f +htbcr + +st +kmr +rm +tvebzs +cig + +gdij +gvi +jhgies + +fduipkhlz +izdplfu + +pdculaojmwsqebvgh +zmhjsdwlefgoucrpvy + +bzwagcde +uhsqpmloni + +mf +f +ltfn + +xlhmpdyieob +mlxpyhideo +mixkldhpoye + +lwthjcvgnmxuypos +vixqojmy +evrxmoyj +ymkajoxv +zfvjdymaxo + +voh +h + +onqdyf +qmnf +wiktfqsajgn + +poaheifqcl +plqcoifaeh +paegritwhnvlofzucjd +ipeohaflc +oielhpafcs + +tzvenpcqxisbjhmgkrw +xvnckipbhszegfwm +pkchgoxbavsmewizn +csvzekmhyngipxbaw + +wgim +ixaw +wixka +iyownrps +iwk + +caofbkuznsiqrtvpjyg +pyroglzcjtfub +pcfjryzgtubmo + +junoecpfwmhtxkayziqvgrl +zqigynpcvufwohjlemtkxar +oeavkrhizljumtgfpxwcqny +tyizfjnoqcbgxarepklvwsudmh + +itvqcxburwo +idtvacoqbex +btvifjxcqyo +ojikvqcltbx + +bromkxwdfq +dkfrbwqamxo +korxywiqfdmb + +smyfvkg +xmkgvsf +kgnsfvem +mkfvgs + +pdxa +mqgx +lxsezkbjic +xy +wfprx + +ynhepftgslro +wytlefgosarn +ysgtndocwlrf +lrgnfoswtya +zlibfutmrkxsvjnqgyo + +kht +tkh +htk +hkt + +pcdxhjnovlusitq +dbtrjizv + +bjhnkitaegvrsx +nxghvbestra +bwetgsarvhxdn + +oleswygxbnfmtzkjuar +xuaezbtcwlgmnrofsjy + +hdrgyowbfktavjuqlzm +gtkvfdulwqjzhymabro +rzojgmltbyhafvwdqku + +uxpwqbyr +xpquwyrb +rwxyqubp +rwbyquxp +qxrbyuwp + +kqlwz +rkve +klnf +ucqk + +irqgpjmdk +ctqmvnkfbgj + +dv +dv +dv + +fariyqplzoetb +zykjphxcg + +pytmwqvx +txvpqmdwy +xtyqvwmp +wvqmxypt + +oekfrmuatwl +axsvpcjkgqdzhiby + +fnyuqsihvmatgwxlr +ufjmioapebxnqydhtk + +tpskxdqc +kxsqcdtp +ytqsdkxcp +cxpqdtks +tcxpsdqk + +soivtnhezljymw +mhcyptneuvob +nfetymhgdavo +vnbhmxetaoy + +sqruavzncixgbpof +vioanzfgreuxqc +acetqngfrxoziuv +gqcfmxvrnzaoliju + +earxh +gmizfq + +tejlcvwgxpdbhsorufmiz +oftmijdscxlvzbuwpehgry +cvnksdzamhgbporwtufiljxe + +wdmgbxyihk +khmxyidwg +hikxwdlpygm + +nzcf +cz + +vhfecblgmowtqxpaskyi +xwgztblrjiacpfmheksvy + +pemi +e +e +ze +e + +fxwy +xyfw +yzxfw + +kshfqrlmyea +xsqboukan + +vknp +levn +pknv + +vqsdyhzwei +poijeyhscazl + +ryf +ofit +txw +jqvlhmbgeuznps + +qhzycdugf +cuhqdzfg +fghuqzcd + +emqngdv +meaqh +ezqmax +exqm +qmaze + +jgrnahfyvotupkxziqsdmceblw +ntughqlksexifdraozvmbcpwy + +imt +tim + +pthzw +tpnwhz +piztlw +tzpw + +xpuh +xbqrvys +lxw + +cpidsmqk +rkpcdmisq +pcdkqsmi +pmskqdic + +thxqby +bqxohty +qybhxt +yqtbxh +yqbxth + +qkplixrshe +jndbsraivm +zrgelsyit +lfsri + +zqr +zrtc +rz + +deabt +ueatgs +hwiqknj +ulxb +tdm + +sfpwq +phsqw +kpsqw + +guhmbl +gmuhb +mhndpub +yuihmgcb +uismhby + +qioblnp +olnqbip +loqbinp + +rqc +qcr +crqay +rqc + +z +z +z +z +zp + +ljo +lcbajeorg +jlox +oljx + +loasmqxdy +mqld +lvmdqb + +iq +qi + +filjwt +fwitlj +fliwtj +wtljif +tjwfil + +dx +xd +dx +xnd +xd + +vzo +zov + +ogbwntefukpch +ebwnsfkgupocht +noctepwgfhkub +wfqkugnpodjthbce + +genbzqkvspy +brkwjevpqsczn +fdxnvtzsobqiekau + +nxwb +wnj + +imfvncxbhlrdzgok +vbfdakgnhlcrixmo +cnzbholrkvdifmxg +ucoklqmbdxnvigrhf +blndpvmhkirgcxfo + +hquykcmexvza +evnayxkchmzq +jfyxamhqpiwzeokgcvs +ekzdruqamhlbtvxyc + +nk +knwct +pbykwan +dzsegnfqrom +linuwk + +tbc +tqbe +tcub + +lzxybkftrhis +ylrxhdasutjzncipgbfw +xktyhfizlrobqsmv + +sjb +pdkaowvu + +bnhcaqjprkx +ncdrqxbolaijkt +zaxrnksqchybj +cbnaxejqrk + +bteqziwsumofxpvchr +choiepzjxuwtvfrsm +irtuwcsemlpvfzhox +twhximepcsfzorlvgu + +ta +at + +xjdybasehgpm +edaosjpgxhmby +xybgpdjemsha +dmexjpbaslhywg +xpmedyahjbsg + +cbjxvynghstrfluoempdk +idhbtapleufcsrgywnvmox +xohdljfecvupmsgrbytkn +rvleksucfbdymxgotqpnh + +klfewtsaihpxnmogudy +seqdufxypnlikwtogah +ewpohdiknstxugayfl +xwenydkuhfasotlgpij +fignpyousdtkwexalh + +oudzygfimh +xvj + +qbpviwoadmfr +dimbswlpqnh +yzgxbqidwuj + +ismkdvnyzajbuowlpqfr +vjqwufylscopgmkrdabi +rhbwefvqiykupsajolmd +msdqtukoipvfxlyjrabw + +lho +hol +jfolhv + diff --git a/2020/day7.cpp b/2020/day7.cpp new file mode 100644 index 0000000..97991ea --- /dev/null +++ b/2020/day7.cpp @@ -0,0 +1,104 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include "types.hpp" + +struct SubBag { std::string type; u32 count; }; + +auto find_bag(const std::string & line, usize & index, SubBag & new_bag) -> bool { + while (++index <= line.size() && (line[index] < '0' || line[index] > '9')); + if (index >= line.size()) { + return false; + } + auto end = line.find(" ", index); + auto count = std::stoi(line.substr(index, end - index)); + index = end + 1; + end = line.find("bag", index); + new_bag = SubBag{ line.substr(index, end - index - 1), u32(count) }; + index = end; + return true; +} + +struct Edges{ std::vector from; std::vector to; }; + +auto count_to(const std::string & search, std::map & map) -> usize { + auto counted = 1; + for (auto & bag : map[search].to) { + counted += bag.count * count_to(bag.type, map); + } + return counted; +} + +auto main(i32 argc, char * argv[]) -> i32 { + auto bag_graph = std::map(); + { + auto line = std::string(); + auto file = std::ifstream("day7.input"); + while (getline(file, line)) { + auto find = line.find("bag") - 1; + auto bag_type = line.substr(0, line.find("bag") - 1); + if (!bag_graph.contains(bag_type)) { + bag_graph.insert_or_assign(bag_type, Edges()); + } + + auto new_bag = SubBag(); + while (find_bag(line, find, new_bag)) { + if (!bag_graph.contains(new_bag.type)) { + bag_graph.insert_or_assign(new_bag.type, Edges()); + } + bag_graph[new_bag.type].from.push_back(bag_type); + bag_graph[bag_type].to.push_back(new_bag); + } + } + } + + auto seen = std::set(); + auto search = std::stack(); + search.push("shiny gold"); + while (search.size() > 0) { + auto current = search.top(); + search.pop(); + for (const auto & bag_type : bag_graph[current].from) { + if (!seen.contains(bag_type)) { + search.push(bag_type); + seen.insert(bag_type); + } + } + } + std::cout << seen.size() << std::endl; + + std::cout << (count_to("shiny gold", bag_graph) - 1) << std::endl; + + return 0; +} diff --git a/2020/day7.input b/2020/day7.input new file mode 100644 index 0000000..4a770f4 --- /dev/null +++ b/2020/day7.input @@ -0,0 +1,594 @@ +faded plum bags contain 5 wavy cyan bags. +dull aqua bags contain 4 dark fuchsia bags, 1 shiny purple bag. +dotted olive bags contain 1 striped gray bag. +vibrant brown bags contain 4 dark tan bags, 4 mirrored gray bags. +shiny black bags contain 3 mirrored black bags. +dull bronze bags contain 2 plaid aqua bags, 4 shiny magenta bags, 2 faded green bags, 3 dotted gold bags. +wavy plum bags contain 5 dim indigo bags. +drab brown bags contain 5 clear fuchsia bags. +vibrant maroon bags contain 3 shiny coral bags, 1 dim indigo bag, 4 muted crimson bags, 5 clear black bags. +posh magenta bags contain no other bags. +dull brown bags contain 3 dim violet bags, 3 striped silver bags, 1 shiny purple bag. +pale gray bags contain 3 plaid magenta bags, 3 clear teal bags, 3 pale white bags. +plaid turquoise bags contain 4 bright orange bags, 5 drab white bags, 4 dotted coral bags. +dotted silver bags contain 2 pale silver bags, 4 dark teal bags, 5 posh gold bags, 1 bright orange bag. +light red bags contain 1 dark violet bag, 1 mirrored coral bag, 3 drab tan bags, 4 muted olive bags. +shiny brown bags contain 5 vibrant lavender bags, 4 dark lavender bags. +plaid plum bags contain 1 faded green bag. +vibrant lavender bags contain 4 bright chartreuse bags, 3 dark teal bags, 4 muted aqua bags. +muted yellow bags contain 5 posh yellow bags, 3 dim olive bags, 1 light cyan bag, 1 plaid gray bag. +light beige bags contain 2 wavy orange bags, 5 vibrant salmon bags, 2 dim brown bags. +muted indigo bags contain 3 dim brown bags, 3 drab brown bags. +dim bronze bags contain 4 dim black bags, 5 wavy turquoise bags, 5 bright violet bags, 2 dark bronze bags. +shiny teal bags contain 5 plaid chartreuse bags. +pale aqua bags contain 2 striped lime bags, 4 dark turquoise bags, 3 dull tomato bags, 2 mirrored lavender bags. +plaid violet bags contain 2 light olive bags. +dotted maroon bags contain 5 striped maroon bags, 2 shiny turquoise bags, 2 dull gold bags, 4 pale olive bags. +dim chartreuse bags contain 5 striped plum bags. +plaid gold bags contain 1 striped green bag, 3 plaid coral bags, 4 dotted violet bags. +faded tomato bags contain 2 dark indigo bags. +posh plum bags contain 1 wavy chartreuse bag, 4 vibrant blue bags. +drab bronze bags contain 2 mirrored gray bags, 3 vibrant plum bags. +muted blue bags contain 1 bright brown bag, 2 pale coral bags, 5 plaid purple bags, 4 dim lavender bags. +striped indigo bags contain 5 dark salmon bags. +shiny tan bags contain 2 faded bronze bags, 3 mirrored lavender bags, 2 mirrored cyan bags. +dim red bags contain 5 dull salmon bags, 3 dim purple bags, 2 striped crimson bags. +plaid gray bags contain 5 bright violet bags, 4 vibrant aqua bags, 4 dull tomato bags. +dotted white bags contain 1 drab brown bag, 5 light brown bags. +plaid tan bags contain 3 striped teal bags, 2 dotted brown bags. +vibrant black bags contain 3 plaid tan bags, 4 muted white bags, 4 drab orange bags, 5 muted aqua bags. +drab purple bags contain 5 muted violet bags, 2 vibrant blue bags, 4 pale olive bags. +mirrored beige bags contain 1 plaid gray bag, 2 mirrored lime bags, 3 dark brown bags. +vibrant olive bags contain 5 shiny indigo bags. +drab green bags contain 1 muted violet bag. +faded turquoise bags contain 2 striped brown bags, 3 vibrant white bags, 1 dull lavender bag, 5 bright olive bags. +shiny maroon bags contain 1 dim bronze bag. +dull white bags contain 1 muted salmon bag, 4 dim olive bags, 5 drab white bags, 1 dotted teal bag. +dim white bags contain 3 mirrored lavender bags. +clear beige bags contain 5 shiny cyan bags, 3 clear chartreuse bags. +plaid tomato bags contain 5 muted beige bags. +bright teal bags contain 5 shiny gold bags, 4 clear beige bags, 5 vibrant chartreuse bags. +dotted salmon bags contain 1 clear fuchsia bag, 2 muted maroon bags, 4 posh yellow bags, 1 drab chartreuse bag. +light gold bags contain 4 light maroon bags. +faded cyan bags contain 2 posh magenta bags, 2 dark violet bags. +drab cyan bags contain 5 faded purple bags, 4 striped crimson bags, 1 shiny maroon bag, 4 drab tomato bags. +dotted black bags contain 3 striped turquoise bags, 4 dark tan bags, 4 vibrant lavender bags. +faded purple bags contain 4 dull purple bags. +dim violet bags contain 2 clear blue bags. +wavy gray bags contain 4 muted crimson bags, 2 mirrored silver bags, 5 vibrant chartreuse bags. +posh tan bags contain 4 drab tan bags, 3 muted crimson bags, 2 striped crimson bags, 2 plaid fuchsia bags. +mirrored magenta bags contain 5 pale bronze bags. +plaid brown bags contain 1 bright chartreuse bag. +drab orange bags contain 4 drab teal bags, 1 dark bronze bag, 2 clear purple bags. +dim green bags contain 5 dull maroon bags, 1 dull green bag. +faded teal bags contain 2 bright yellow bags, 2 posh red bags, 2 posh indigo bags. +dim gray bags contain 4 wavy blue bags, 2 shiny maroon bags, 1 pale cyan bag. +light crimson bags contain 1 wavy plum bag, 3 muted magenta bags, 3 plaid aqua bags, 2 striped chartreuse bags. +clear white bags contain 2 posh magenta bags, 5 bright white bags, 5 drab bronze bags, 3 vibrant beige bags. +drab magenta bags contain 4 pale olive bags. +plaid silver bags contain 4 bright violet bags, 3 dim brown bags, 1 dark teal bag. +bright bronze bags contain 4 posh white bags, 3 dull salmon bags. +drab maroon bags contain 3 clear black bags, 2 dotted orange bags. +dark fuchsia bags contain 3 faded chartreuse bags, 5 clear green bags, 4 bright brown bags. +vibrant salmon bags contain 1 bright red bag, 5 clear black bags, 2 clear green bags. +shiny crimson bags contain 4 muted fuchsia bags, 2 plaid red bags, 3 clear green bags. +plaid crimson bags contain 4 bright gold bags, 2 clear turquoise bags, 3 faded magenta bags. +dim turquoise bags contain 3 drab brown bags, 5 plaid cyan bags, 3 plaid teal bags, 5 shiny silver bags. +clear crimson bags contain 3 plaid blue bags, 2 drab tomato bags, 2 dull cyan bags, 3 mirrored fuchsia bags. +pale tomato bags contain 1 dull yellow bag, 3 muted aqua bags. +dim orange bags contain 1 posh magenta bag, 2 wavy gray bags, 5 faded indigo bags. +mirrored orange bags contain 1 posh bronze bag, 2 faded white bags, 1 light orange bag, 2 posh red bags. +striped turquoise bags contain 5 muted salmon bags, 5 dark white bags, 1 mirrored purple bag, 3 pale chartreuse bags. +dotted coral bags contain 3 bright brown bags, 2 posh yellow bags, 3 drab maroon bags. +wavy maroon bags contain 2 clear lime bags. +mirrored indigo bags contain 1 mirrored cyan bag, 1 posh plum bag, 2 plaid silver bags. +wavy indigo bags contain 5 dark violet bags, 5 drab black bags, 4 dark orange bags, 5 muted green bags. +striped tomato bags contain 4 dark indigo bags, 5 light lavender bags. +pale lime bags contain 2 bright orange bags. +muted maroon bags contain 2 bright violet bags, 1 shiny coral bag, 1 posh gray bag. +drab lavender bags contain 1 muted magenta bag. +bright fuchsia bags contain 1 striped lime bag. +wavy beige bags contain 2 bright brown bags, 1 pale black bag, 1 drab tomato bag, 4 vibrant blue bags. +shiny olive bags contain 2 dim teal bags, 1 mirrored cyan bag, 4 dim yellow bags, 4 muted aqua bags. +posh coral bags contain no other bags. +dark green bags contain 2 posh brown bags, 2 muted white bags, 4 bright fuchsia bags. +shiny green bags contain 1 faded crimson bag, 3 striped purple bags, 4 shiny salmon bags, 2 dark bronze bags. +clear coral bags contain no other bags. +dull salmon bags contain 1 muted white bag. +dark lavender bags contain 2 plaid gray bags, 4 muted olive bags. +bright silver bags contain 5 pale black bags. +posh green bags contain 5 muted olive bags, 4 dotted crimson bags, 4 dotted brown bags. +dotted fuchsia bags contain 5 shiny chartreuse bags, 1 dotted coral bag, 1 shiny cyan bag. +dim fuchsia bags contain 1 striped orange bag, 1 clear crimson bag. +dotted cyan bags contain 5 muted olive bags, 3 shiny white bags. +dark beige bags contain 4 light teal bags, 4 drab teal bags, 5 wavy beige bags. +striped magenta bags contain 5 plaid purple bags, 3 dotted crimson bags, 2 dull tomato bags. +striped blue bags contain 3 dim aqua bags. +light silver bags contain 3 shiny green bags, 2 vibrant black bags, 1 wavy turquoise bag, 3 faded bronze bags. +pale indigo bags contain 4 pale silver bags, 3 dotted tomato bags, 1 dark violet bag, 3 clear lime bags. +mirrored turquoise bags contain 1 pale salmon bag, 2 dotted crimson bags, 1 drab tomato bag, 2 muted green bags. +striped beige bags contain 3 dotted tomato bags, 4 vibrant purple bags, 2 plaid tomato bags, 4 dark salmon bags. +pale silver bags contain 5 dark lavender bags, 4 drab tan bags, 5 clear yellow bags. +dark lime bags contain 3 pale aqua bags, 5 posh green bags. +faded coral bags contain 3 dull tomato bags, 4 dark bronze bags, 3 drab tomato bags, 2 bright white bags. +mirrored lavender bags contain 3 mirrored cyan bags. +bright crimson bags contain 2 mirrored silver bags. +striped gray bags contain 3 dotted coral bags, 4 muted maroon bags, 4 dark teal bags, 5 pale bronze bags. +dotted magenta bags contain 2 dim teal bags, 2 wavy turquoise bags, 5 dull turquoise bags. +posh white bags contain 4 drab tomato bags, 2 muted aqua bags. +striped red bags contain 2 plaid blue bags, 1 light plum bag, 3 bright white bags. +pale white bags contain 1 light purple bag. +shiny coral bags contain no other bags. +dark magenta bags contain 4 pale tan bags, 1 posh chartreuse bag, 2 pale yellow bags, 2 pale indigo bags. +light gray bags contain 4 pale green bags, 5 dotted green bags, 4 shiny gray bags. +dim gold bags contain 3 clear violet bags, 5 plaid aqua bags, 2 bright tomato bags, 2 wavy teal bags. +dim crimson bags contain 4 muted blue bags, 2 light tan bags. +wavy tan bags contain 1 posh plum bag, 3 mirrored gray bags, 1 muted purple bag. +posh brown bags contain 4 mirrored black bags. +bright plum bags contain 3 vibrant plum bags, 3 mirrored crimson bags. +faded black bags contain 1 pale lime bag, 2 pale tomato bags. +mirrored yellow bags contain 1 pale aqua bag, 4 dull aqua bags, 4 shiny white bags, 3 clear lime bags. +muted tan bags contain 2 clear brown bags. +drab white bags contain 5 dull coral bags, 2 drab green bags, 4 wavy tomato bags, 5 mirrored cyan bags. +dull black bags contain 4 vibrant tan bags, 1 shiny chartreuse bag, 5 pale gold bags. +posh maroon bags contain 5 dark coral bags, 5 faded yellow bags, 2 light lavender bags, 2 wavy teal bags. +drab coral bags contain 4 posh chartreuse bags, 2 dim red bags. +posh indigo bags contain 2 plaid brown bags, 4 muted green bags. +drab aqua bags contain 2 pale magenta bags, 2 posh orange bags. +drab crimson bags contain 2 pale bronze bags, 4 dotted blue bags, 2 dim silver bags. +drab silver bags contain 5 clear blue bags, 4 pale bronze bags. +clear salmon bags contain 2 pale aqua bags, 1 plaid gray bag, 1 clear coral bag. +wavy chartreuse bags contain no other bags. +dull plum bags contain 3 plaid gray bags, 3 plaid aqua bags, 2 mirrored beige bags, 2 wavy magenta bags. +faded gray bags contain 2 dull cyan bags, 3 light lime bags, 3 bright lavender bags, 5 wavy plum bags. +striped teal bags contain 4 drab maroon bags. +clear lavender bags contain 3 clear coral bags, 5 bright crimson bags, 5 drab brown bags, 2 dim indigo bags. +mirrored maroon bags contain 1 clear gray bag, 3 shiny salmon bags, 3 mirrored violet bags. +muted turquoise bags contain 2 drab teal bags, 2 plaid plum bags, 4 plaid coral bags, 2 wavy chartreuse bags. +dark white bags contain 4 bright fuchsia bags, 1 dull white bag, 3 shiny indigo bags, 3 dim white bags. +drab red bags contain 3 dotted teal bags, 2 striped purple bags. +muted teal bags contain 3 dark violet bags, 4 plaid chartreuse bags, 2 pale crimson bags. +wavy red bags contain 2 clear crimson bags. +striped olive bags contain 2 mirrored lavender bags. +dull teal bags contain 4 pale teal bags, 5 pale violet bags, 2 drab white bags. +light black bags contain 1 dark red bag, 2 plaid tan bags. +clear orange bags contain 5 bright cyan bags. +pale yellow bags contain 2 bright lavender bags. +posh cyan bags contain 4 clear coral bags. +drab tomato bags contain 4 vibrant blue bags, 5 faded beige bags, 3 clear coral bags, 2 mirrored white bags. +pale orange bags contain 2 light aqua bags. +dull tomato bags contain 5 plaid aqua bags, 2 posh magenta bags, 3 vibrant aqua bags. +pale turquoise bags contain 1 pale coral bag, 3 dim teal bags. +plaid maroon bags contain 5 posh maroon bags. +vibrant beige bags contain 5 dull coral bags. +bright purple bags contain 2 vibrant salmon bags, 5 dotted purple bags, 5 clear silver bags. +dull coral bags contain 4 vibrant aqua bags, 3 dotted brown bags, 4 shiny coral bags. +drab gray bags contain 4 vibrant lavender bags. +dull lavender bags contain 3 vibrant lavender bags, 1 posh red bag, 4 drab tan bags, 3 light purple bags. +striped maroon bags contain 3 bright silver bags. +mirrored silver bags contain 5 clear blue bags, 3 posh magenta bags, 2 bright brown bags. +faded yellow bags contain 2 muted maroon bags. +striped purple bags contain 2 dotted yellow bags, 1 clear cyan bag, 2 dark teal bags. +clear gray bags contain 5 dim black bags, 1 faded green bag, 5 muted crimson bags. +plaid cyan bags contain 2 dark teal bags, 1 pale lime bag, 1 wavy beige bag. +bright orange bags contain 5 mirrored brown bags, 2 dotted gold bags. +dotted turquoise bags contain 3 plaid gray bags, 3 clear chartreuse bags. +vibrant turquoise bags contain 1 muted brown bag, 3 dim purple bags, 1 posh gray bag, 5 pale bronze bags. +striped lime bags contain 1 shiny gold bag. +light violet bags contain 4 mirrored purple bags, 5 clear blue bags. +striped orange bags contain 3 light gold bags, 3 light olive bags, 3 muted crimson bags, 2 pale cyan bags. +drab turquoise bags contain 3 dim magenta bags, 4 pale black bags. +pale salmon bags contain 2 mirrored cyan bags, 4 vibrant blue bags. +shiny yellow bags contain 5 vibrant tomato bags, 3 muted salmon bags, 5 wavy tomato bags. +plaid lime bags contain 2 pale yellow bags, 2 shiny red bags, 3 muted crimson bags, 4 dull green bags. +muted cyan bags contain 4 bright green bags, 5 striped bronze bags, 1 vibrant lavender bag, 4 posh violet bags. +dull cyan bags contain 5 dark lavender bags, 5 drab green bags, 1 bright crimson bag, 4 mirrored silver bags. +pale beige bags contain 3 posh coral bags. +shiny chartreuse bags contain 4 mirrored silver bags. +dark silver bags contain 2 dull turquoise bags, 1 muted maroon bag, 5 vibrant magenta bags. +mirrored violet bags contain 4 dark brown bags. +clear aqua bags contain 2 striped beige bags, 1 dotted indigo bag, 5 faded violet bags, 5 vibrant violet bags. +plaid teal bags contain 3 mirrored lavender bags, 4 posh gray bags. +wavy olive bags contain 3 dull blue bags, 5 bright salmon bags, 5 shiny purple bags. +pale lavender bags contain 4 light purple bags, 2 dotted gray bags, 2 pale plum bags, 3 shiny silver bags. +shiny blue bags contain 2 vibrant white bags, 3 light gold bags, 3 mirrored lavender bags, 1 drab plum bag. +light coral bags contain 4 light teal bags, 1 striped chartreuse bag, 5 dotted chartreuse bags. +pale brown bags contain 2 dim gold bags, 2 clear turquoise bags, 3 bright cyan bags, 4 clear maroon bags. +vibrant tomato bags contain 3 dark brown bags, 1 vibrant blue bag. +dull olive bags contain 5 mirrored yellow bags, 2 shiny cyan bags. +light chartreuse bags contain 2 dull aqua bags, 4 dull brown bags, 1 clear fuchsia bag, 4 bright yellow bags. +posh gray bags contain 4 posh green bags, 1 mirrored gray bag. +bright yellow bags contain 4 pale aqua bags. +bright gold bags contain 3 pale indigo bags, 3 dull crimson bags. +dotted red bags contain 4 pale turquoise bags, 4 muted blue bags, 1 bright bronze bag, 2 light blue bags. +clear brown bags contain 1 mirrored yellow bag. +light plum bags contain 2 bright violet bags. +dim purple bags contain 3 faded chartreuse bags, 5 light teal bags. +dull yellow bags contain 5 muted aqua bags, 3 dotted coral bags, 2 drab maroon bags. +shiny gold bags contain 4 pale black bags, 4 dim violet bags, 3 muted yellow bags. +mirrored crimson bags contain 1 striped teal bag, 5 mirrored cyan bags. +shiny lavender bags contain 4 bright brown bags, 3 bright tan bags, 5 dotted crimson bags, 4 pale black bags. +vibrant cyan bags contain 1 dim yellow bag, 5 bright tan bags. +wavy gold bags contain 2 dark brown bags, 1 dull yellow bag. +dark cyan bags contain 4 dim white bags, 2 mirrored indigo bags, 4 muted white bags, 2 bright white bags. +posh lime bags contain 4 shiny plum bags, 3 plaid fuchsia bags. +posh purple bags contain 3 muted salmon bags. +pale magenta bags contain 1 drab gold bag, 1 dark white bag, 3 posh silver bags. +dim plum bags contain 4 dark chartreuse bags, 4 mirrored lavender bags. +plaid indigo bags contain 2 clear lime bags, 5 dull tomato bags. +dark blue bags contain 1 bright olive bag, 1 dull bronze bag, 1 shiny gold bag. +dull red bags contain 2 wavy teal bags, 3 wavy crimson bags, 1 faded olive bag. +striped yellow bags contain 4 drab salmon bags. +vibrant magenta bags contain 4 light beige bags, 2 dark red bags, 1 plaid magenta bag, 5 dim magenta bags. +plaid red bags contain 2 striped red bags, 4 light plum bags, 3 mirrored silver bags. +wavy orange bags contain 5 vibrant white bags, 1 posh coral bag, 5 muted purple bags, 2 light coral bags. +pale green bags contain 5 pale aqua bags, 1 clear gray bag. +dotted chartreuse bags contain 4 muted violet bags, 5 striped teal bags. +light turquoise bags contain 5 dull turquoise bags, 2 dark aqua bags, 1 dull teal bag. +shiny violet bags contain 2 pale indigo bags. +light white bags contain 3 mirrored indigo bags, 1 faded blue bag, 1 plaid white bag, 1 posh plum bag. +muted beige bags contain 4 drab gold bags. +faded silver bags contain 2 drab white bags, 5 pale white bags, 3 clear lime bags. +faded red bags contain 1 bright turquoise bag, 5 faded coral bags, 2 drab purple bags, 5 bright olive bags. +shiny bronze bags contain 4 plaid purple bags, 5 bright red bags, 1 muted white bag, 2 dull fuchsia bags. +dull gold bags contain 1 dotted orange bag. +muted olive bags contain 1 clear coral bag, 1 posh magenta bag, 2 bright violet bags, 1 wavy chartreuse bag. +dotted bronze bags contain 1 plaid beige bag, 3 clear olive bags, 2 light lime bags, 5 dull beige bags. +shiny orange bags contain 5 pale brown bags, 5 clear tomato bags. +wavy salmon bags contain 2 shiny maroon bags. +wavy crimson bags contain 5 bright violet bags, 3 plaid violet bags. +bright coral bags contain 1 dull bronze bag, 5 dotted gold bags, 1 posh gray bag. +dotted crimson bags contain 2 posh magenta bags, 4 mirrored white bags. +bright violet bags contain no other bags. +drab blue bags contain 5 shiny gold bags, 1 shiny brown bag, 4 dark silver bags. +posh salmon bags contain 4 dim purple bags, 1 striped lime bag, 1 muted gray bag, 2 drab gold bags. +dim coral bags contain 3 dark red bags, 2 faded crimson bags. +dark aqua bags contain 3 dotted salmon bags, 4 pale olive bags, 1 vibrant aqua bag, 5 dull lavender bags. +dark orange bags contain 4 mirrored teal bags, 5 clear salmon bags. +vibrant red bags contain 3 vibrant blue bags. +muted lime bags contain 1 dull silver bag. +clear tan bags contain 2 striped beige bags, 1 posh coral bag, 1 wavy teal bag, 2 faded plum bags. +vibrant coral bags contain 2 faded blue bags, 4 bright turquoise bags. +dark olive bags contain 2 dark indigo bags. +dotted blue bags contain 5 faded cyan bags, 4 striped aqua bags, 4 dotted gold bags. +bright maroon bags contain 1 dark bronze bag, 3 vibrant aqua bags, 4 dim magenta bags, 3 clear crimson bags. +bright cyan bags contain 2 wavy tomato bags. +plaid olive bags contain 3 striped indigo bags, 5 dim purple bags, 3 striped bronze bags, 2 light teal bags. +plaid chartreuse bags contain 3 plaid yellow bags, 1 faded brown bag, 1 vibrant tan bag, 4 wavy fuchsia bags. +dull maroon bags contain 3 muted yellow bags. +light fuchsia bags contain 5 drab maroon bags, 5 muted silver bags. +dull orange bags contain 4 dim indigo bags, 4 posh beige bags, 1 bright red bag. +dull blue bags contain 5 wavy yellow bags, 4 posh gray bags. +plaid yellow bags contain 1 bright fuchsia bag, 1 faded beige bag, 1 wavy beige bag, 4 light green bags. +clear black bags contain 1 dull tomato bag. +muted coral bags contain 5 drab indigo bags. +plaid magenta bags contain 3 posh salmon bags. +clear tomato bags contain 5 dotted brown bags, 3 dim tomato bags, 3 drab brown bags. +clear yellow bags contain 3 clear black bags, 2 mirrored black bags. +dark gray bags contain 5 light bronze bags, 4 dotted coral bags, 4 dim chartreuse bags. +light magenta bags contain 4 wavy turquoise bags, 1 mirrored green bag, 2 plaid chartreuse bags. +shiny indigo bags contain 1 bright silver bag, 2 pale tomato bags, 4 light teal bags, 4 posh coral bags. +muted gray bags contain 3 faded beige bags, 1 dark teal bag, 3 muted violet bags, 3 muted white bags. +wavy lavender bags contain 1 clear chartreuse bag, 2 clear maroon bags, 5 dull plum bags. +faded olive bags contain 4 mirrored yellow bags, 4 vibrant tomato bags, 5 muted olive bags. +muted crimson bags contain 1 mirrored gray bag, 4 dim violet bags. +drab chartreuse bags contain 1 pale olive bag, 1 vibrant plum bag. +wavy cyan bags contain 2 mirrored coral bags. +mirrored plum bags contain 3 bright turquoise bags, 3 dark beige bags, 4 mirrored beige bags. +plaid lavender bags contain 1 drab white bag. +muted gold bags contain 1 clear black bag, 2 light orange bags, 4 dotted red bags, 4 dull silver bags. +faded bronze bags contain 4 posh plum bags. +clear turquoise bags contain 1 light gold bag, 1 clear beige bag, 2 striped chartreuse bags. +vibrant gray bags contain 1 plaid white bag. +bright tan bags contain 3 drab silver bags, 2 faded yellow bags, 2 bright green bags. +pale bronze bags contain 5 posh coral bags, 4 clear coral bags, 1 dotted orange bag, 4 wavy chartreuse bags. +clear plum bags contain 1 dim plum bag, 4 light gold bags. +posh turquoise bags contain 3 wavy bronze bags, 4 shiny purple bags. +posh teal bags contain 2 striped magenta bags, 3 dark magenta bags, 5 faded silver bags, 5 mirrored chartreuse bags. +dim yellow bags contain 4 pale bronze bags, 3 shiny tan bags. +faded lavender bags contain 3 dull white bags, 3 striped teal bags. +wavy magenta bags contain 2 pale aqua bags, 4 shiny indigo bags. +dim brown bags contain 2 bright brown bags, 3 striped chartreuse bags, 5 dull purple bags, 1 light cyan bag. +light lime bags contain 5 clear crimson bags, 4 plaid indigo bags, 1 pale silver bag. +striped silver bags contain 3 posh green bags, 3 muted violet bags, 1 drab green bag. +bright brown bags contain no other bags. +vibrant fuchsia bags contain 4 dull olive bags, 2 mirrored gold bags, 3 mirrored bronze bags, 1 posh crimson bag. +plaid purple bags contain 3 faded beige bags, 1 drab green bag, 2 striped chartreuse bags. +wavy violet bags contain 2 vibrant gray bags, 5 wavy fuchsia bags. +dark maroon bags contain 5 pale chartreuse bags, 5 striped brown bags. +pale coral bags contain 3 vibrant plum bags. +dark black bags contain 4 striped salmon bags, 4 dim bronze bags. +plaid bronze bags contain 2 mirrored black bags, 1 drab bronze bag, 4 plaid purple bags, 5 dull tomato bags. +faded orange bags contain 5 plaid indigo bags. +light lavender bags contain 2 shiny magenta bags, 5 dim lavender bags, 1 dotted crimson bag. +dull chartreuse bags contain 4 clear lime bags. +dark gold bags contain 4 light magenta bags. +dim black bags contain 4 shiny silver bags, 1 dull tomato bag. +plaid salmon bags contain 3 light magenta bags, 4 dull fuchsia bags, 2 striped salmon bags. +vibrant bronze bags contain 5 mirrored white bags, 1 dull coral bag. +wavy brown bags contain 1 light gold bag, 4 drab purple bags, 3 muted violet bags, 4 muted fuchsia bags. +dotted lavender bags contain 4 dotted indigo bags, 2 dull lavender bags. +dotted gold bags contain 1 posh magenta bag, 2 posh yellow bags. +faded brown bags contain 4 muted blue bags, 3 wavy teal bags. +light yellow bags contain 3 clear black bags, 1 dotted crimson bag. +striped salmon bags contain 1 dull yellow bag, 5 mirrored gray bags, 5 light lavender bags, 5 mirrored brown bags. +light blue bags contain 5 mirrored purple bags, 3 dim violet bags, 2 pale tomato bags. +faded gold bags contain 3 plaid gray bags. +shiny aqua bags contain 1 striped crimson bag, 5 pale black bags. +shiny lime bags contain 4 dark green bags. +vibrant tan bags contain 3 clear silver bags, 3 pale white bags. +vibrant aqua bags contain no other bags. +vibrant teal bags contain 3 wavy tan bags. +light maroon bags contain 3 vibrant silver bags. +faded crimson bags contain 3 plaid red bags. +light teal bags contain 2 dark teal bags, 1 faded beige bag, 4 dull cyan bags. +mirrored coral bags contain 2 vibrant plum bags. +muted black bags contain 2 drab magenta bags, 1 mirrored gray bag, 4 drab tan bags, 1 dim indigo bag. +striped gold bags contain 1 dark lavender bag, 4 drab brown bags, 2 bright silver bags, 2 striped teal bags. +light purple bags contain 3 posh gray bags. +dull silver bags contain 2 clear chartreuse bags, 3 plaid silver bags, 1 drab salmon bag, 2 wavy teal bags. +clear bronze bags contain 4 dull red bags. +wavy yellow bags contain 3 dull tomato bags, 2 posh green bags, 4 plaid aqua bags, 2 faded purple bags. +muted purple bags contain 5 pale black bags, 2 muted salmon bags, 2 muted yellow bags. +plaid aqua bags contain no other bags. +drab plum bags contain 3 drab turquoise bags. +muted orange bags contain 1 faded blue bag, 5 plaid brown bags, 4 mirrored chartreuse bags. +dim silver bags contain 4 dark fuchsia bags, 2 clear cyan bags, 2 dark green bags, 4 dotted silver bags. +pale tan bags contain 5 shiny silver bags, 5 drab indigo bags. +wavy tomato bags contain 4 clear black bags, 4 plaid gray bags. +posh bronze bags contain 4 drab green bags. +clear blue bags contain 3 bright brown bags, 5 dull tomato bags, 1 clear black bag, 5 bright violet bags. +striped plum bags contain 4 plaid yellow bags, 3 dark teal bags, 2 mirrored lavender bags, 1 dotted salmon bag. +muted salmon bags contain 1 dull cyan bag, 2 clear coral bags, 1 posh coral bag. +light aqua bags contain 4 clear maroon bags, 4 striped black bags. +bright blue bags contain 4 drab violet bags, 4 light indigo bags, 3 muted indigo bags. +light brown bags contain 5 striped lavender bags. +light salmon bags contain 1 drab beige bag, 5 faded orange bags, 4 plaid coral bags, 5 light chartreuse bags. +posh beige bags contain 1 shiny red bag. +dotted orange bags contain 2 dotted brown bags, 3 mirrored silver bags, 1 dull tomato bag. +wavy purple bags contain 1 mirrored green bag, 1 clear maroon bag. +dark coral bags contain 5 bright chartreuse bags, 4 clear lime bags. +dim lime bags contain 3 bright olive bags, 3 dull gold bags. +pale plum bags contain 1 light orange bag, 3 drab orange bags, 5 mirrored purple bags. +dim beige bags contain 5 pale fuchsia bags, 4 mirrored fuchsia bags, 4 plaid teal bags, 1 shiny orange bag. +drab tan bags contain 5 plaid silver bags, 3 muted crimson bags, 1 clear salmon bag. +posh blue bags contain 4 plaid aqua bags, 2 drab salmon bags, 4 pale teal bags, 2 drab gold bags. +drab violet bags contain 3 shiny white bags. +shiny plum bags contain 3 mirrored green bags, 2 dark yellow bags, 3 pale salmon bags. +pale fuchsia bags contain 5 faded violet bags. +clear fuchsia bags contain 2 dark lavender bags, 3 posh green bags. +mirrored lime bags contain 3 light bronze bags. +plaid white bags contain 1 dim lavender bag, 4 dim olive bags, 3 clear yellow bags. +striped violet bags contain 4 plaid plum bags, 3 plaid black bags, 4 pale teal bags, 5 wavy magenta bags. +dark purple bags contain 2 shiny gold bags, 3 faded blue bags. +mirrored blue bags contain 1 drab fuchsia bag, 4 posh white bags, 3 wavy red bags. +pale black bags contain 2 dim olive bags, 5 bright brown bags. +dark brown bags contain 5 dotted purple bags, 2 striped silver bags. +muted lavender bags contain 3 posh brown bags, 2 clear yellow bags, 3 posh coral bags, 1 shiny tan bag. +muted bronze bags contain 1 drab teal bag, 5 drab tomato bags, 1 drab magenta bag, 5 posh maroon bags. +posh violet bags contain 5 bright white bags, 5 vibrant tan bags. +clear green bags contain 3 mirrored silver bags, 2 dotted orange bags. +dotted plum bags contain 3 plaid yellow bags, 1 wavy yellow bag, 1 drab cyan bag. +drab olive bags contain 1 shiny indigo bag. +wavy turquoise bags contain 3 muted yellow bags. +dark violet bags contain 2 bright crimson bags, 4 bright fuchsia bags, 2 dull blue bags. +posh gold bags contain 3 drab teal bags. +dim cyan bags contain 5 clear olive bags, 4 bright turquoise bags, 1 pale gray bag. +posh red bags contain 1 bright salmon bag. +dull tan bags contain 4 plaid cyan bags. +faded indigo bags contain 3 light gold bags, 5 dotted brown bags, 3 dotted cyan bags, 2 drab teal bags. +clear violet bags contain 1 wavy turquoise bag, 1 vibrant chartreuse bag, 1 dark violet bag, 3 bright bronze bags. +clear indigo bags contain 1 mirrored tan bag, 4 faded indigo bags. +bright turquoise bags contain 1 drab teal bag, 4 dull salmon bags, 4 pale olive bags, 2 faded chartreuse bags. +muted tomato bags contain 1 dark purple bag, 3 striped tan bags. +posh silver bags contain 4 muted gray bags. +mirrored olive bags contain 5 bright lavender bags, 2 clear blue bags, 5 dotted crimson bags, 5 pale black bags. +shiny tomato bags contain 1 mirrored purple bag, 4 posh gold bags, 3 vibrant plum bags. +striped coral bags contain 5 clear orange bags, 3 muted coral bags, 4 bright green bags, 1 clear chartreuse bag. +mirrored chartreuse bags contain 4 clear blue bags. +pale maroon bags contain 1 muted indigo bag. +striped black bags contain 3 striped gray bags, 1 striped lime bag, 4 bright cyan bags, 4 light orange bags. +dim maroon bags contain 4 dull cyan bags. +bright beige bags contain 2 pale fuchsia bags, 5 vibrant beige bags, 1 light lavender bag. +shiny gray bags contain 2 striped lime bags, 1 pale black bag, 4 wavy tomato bags, 2 vibrant brown bags. +drab lime bags contain 5 muted bronze bags, 2 posh indigo bags. +dull gray bags contain 2 dull plum bags, 4 dim white bags, 2 shiny purple bags. +light olive bags contain 4 clear salmon bags, 1 dim indigo bag. +vibrant violet bags contain 5 striped tan bags, 1 pale lime bag, 4 posh plum bags, 4 mirrored black bags. +posh lavender bags contain 4 pale tomato bags. +plaid coral bags contain 3 mirrored olive bags, 2 muted black bags, 3 light plum bags. +vibrant blue bags contain 4 mirrored silver bags. +dim aqua bags contain 5 dim maroon bags. +wavy bronze bags contain 5 wavy plum bags, 1 bright cyan bag, 2 drab chartreuse bags. +muted plum bags contain 3 plaid silver bags, 5 faded black bags, 3 drab maroon bags. +dull turquoise bags contain 4 plaid silver bags. +plaid blue bags contain 3 plaid purple bags. +dotted tan bags contain 5 plaid chartreuse bags, 4 dotted coral bags, 4 posh green bags, 1 striped turquoise bag. +plaid black bags contain 2 drab salmon bags, 5 posh maroon bags. +light cyan bags contain 2 dotted orange bags, 5 drab green bags, 1 bright lavender bag. +dull fuchsia bags contain 2 posh red bags, 4 mirrored beige bags, 2 dull salmon bags, 4 striped purple bags. +dark turquoise bags contain 4 drab tomato bags, 3 dotted chartreuse bags, 5 muted salmon bags, 4 posh magenta bags. +vibrant silver bags contain 3 dark brown bags, 2 wavy beige bags, 5 dull turquoise bags, 2 drab tan bags. +dotted tomato bags contain 3 drab tan bags, 2 striped magenta bags, 5 dim violet bags, 4 wavy tomato bags. +vibrant white bags contain 5 bright crimson bags, 2 mirrored white bags, 5 mirrored indigo bags, 4 wavy teal bags. +shiny fuchsia bags contain 1 pale lime bag. +wavy fuchsia bags contain 4 clear cyan bags. +dotted gray bags contain 3 striped chartreuse bags, 1 dark fuchsia bag. +bright tomato bags contain 4 wavy orange bags, 2 dotted salmon bags, 1 striped gray bag, 3 pale tomato bags. +clear chartreuse bags contain 3 clear purple bags. +dim teal bags contain 3 faded silver bags, 5 vibrant silver bags, 2 wavy fuchsia bags. +dotted yellow bags contain 5 bright bronze bags, 4 drab teal bags. +dark indigo bags contain 5 plaid red bags, 5 dim purple bags. +wavy black bags contain 5 shiny tomato bags, 2 clear gray bags, 4 dim lavender bags, 3 clear blue bags. +striped green bags contain 3 light crimson bags, 5 mirrored cyan bags, 2 mirrored maroon bags, 2 faded yellow bags. +dull lime bags contain 3 pale yellow bags. +faded chartreuse bags contain 2 wavy teal bags, 3 dim olive bags, 2 dull purple bags, 5 vibrant plum bags. +dark yellow bags contain 2 muted brown bags. +plaid beige bags contain 3 pale green bags, 3 bright purple bags, 5 faded black bags, 1 drab brown bag. +faded maroon bags contain 5 drab tomato bags. +muted silver bags contain 3 striped lime bags, 3 dim orange bags, 3 muted aqua bags, 1 plaid black bag. +pale violet bags contain 1 mirrored gray bag, 1 dull gold bag, 1 wavy crimson bag, 1 pale magenta bag. +dim olive bags contain no other bags. +mirrored bronze bags contain 2 drab white bags. +dull green bags contain 1 striped silver bag, 2 bright orange bags, 4 dull yellow bags, 4 dotted chartreuse bags. +bright gray bags contain 1 striped gray bag, 5 dull teal bags, 4 light beige bags, 2 vibrant orange bags. +light indigo bags contain 1 dim maroon bag, 4 dark indigo bags, 1 dark brown bag, 2 muted beige bags. +bright magenta bags contain 2 muted lime bags. +posh crimson bags contain 4 pale indigo bags, 2 faded green bags. +vibrant plum bags contain 1 posh gray bag, 3 mirrored silver bags, 4 bright brown bags, 2 posh magenta bags. +wavy lime bags contain 4 wavy black bags, 4 shiny cyan bags, 5 striped aqua bags, 4 plaid gray bags. +shiny silver bags contain 5 dotted crimson bags, 2 wavy turquoise bags, 1 shiny coral bag. +dark tan bags contain 5 clear silver bags. +mirrored brown bags contain 1 dotted brown bag, 2 plaid gray bags, 5 dull tomato bags, 5 clear black bags. +muted brown bags contain 3 drab magenta bags, 4 plaid aqua bags, 5 dim black bags. +posh black bags contain 2 bright turquoise bags, 3 mirrored maroon bags, 1 dull white bag. +wavy aqua bags contain 3 drab green bags, 3 clear magenta bags. +vibrant chartreuse bags contain 3 muted violet bags. +wavy silver bags contain 2 muted yellow bags, 4 plaid violet bags. +shiny salmon bags contain 1 clear yellow bag. +clear purple bags contain 2 posh green bags, 2 muted gray bags. +clear cyan bags contain 5 posh gray bags, 5 plaid aqua bags, 1 wavy tomato bag, 1 dim lavender bag. +wavy coral bags contain 5 dim yellow bags, 3 clear yellow bags. +wavy green bags contain 4 plaid bronze bags, 4 dull coral bags. +mirrored gold bags contain 5 bright lavender bags. +muted fuchsia bags contain 1 dotted purple bag. +clear maroon bags contain 3 muted gray bags, 2 bright chartreuse bags, 3 dotted gold bags. +faded salmon bags contain 5 clear green bags. +striped aqua bags contain 5 pale yellow bags, 1 dotted salmon bag, 1 wavy teal bag, 1 muted yellow bag. +plaid fuchsia bags contain 2 dim olive bags. +pale chartreuse bags contain 3 posh magenta bags, 3 mirrored yellow bags. +shiny beige bags contain 1 mirrored indigo bag. +posh aqua bags contain 3 pale silver bags, 3 shiny tan bags, 5 striped blue bags, 5 dull salmon bags. +dull magenta bags contain 5 dotted lime bags, 4 bright plum bags, 5 vibrant turquoise bags. +posh tomato bags contain 5 shiny tan bags, 1 wavy salmon bag. +clear red bags contain 5 clear black bags. +dotted aqua bags contain 1 clear black bag. +clear olive bags contain 1 plaid gray bag, 3 clear cyan bags. +dotted green bags contain 3 light red bags. +clear teal bags contain 5 faded coral bags, 3 wavy plum bags, 5 bright orange bags, 1 clear purple bag. +plaid orange bags contain 4 pale chartreuse bags, 1 dark silver bag, 2 drab tomato bags. +pale teal bags contain 1 drab black bag. +posh chartreuse bags contain 1 dotted gold bag, 4 bright salmon bags. +pale red bags contain 2 vibrant plum bags, 4 wavy cyan bags, 2 dotted white bags, 1 posh silver bag. +faded violet bags contain 1 mirrored white bag, 4 muted green bags, 5 mirrored olive bags, 1 dim brown bag. +faded fuchsia bags contain 2 dark brown bags. +dotted brown bags contain 4 clear blue bags. +dark teal bags contain 5 dull cyan bags. +bright salmon bags contain 2 pale black bags, 5 dotted chartreuse bags, 2 striped chartreuse bags. +pale blue bags contain 4 shiny gold bags, 2 clear white bags, 1 dotted coral bag. +dim tan bags contain 3 plaid yellow bags, 5 clear blue bags, 2 clear cyan bags. +dull beige bags contain 5 shiny maroon bags, 4 mirrored bronze bags, 4 dark plum bags. +clear magenta bags contain 5 dim bronze bags, 5 wavy olive bags. +bright black bags contain 2 bright bronze bags, 5 mirrored gold bags, 4 dark yellow bags. +muted aqua bags contain 2 dark teal bags. +faded blue bags contain 4 clear salmon bags, 1 light cyan bag, 5 wavy tomato bags. +dotted indigo bags contain 2 shiny maroon bags, 2 wavy tan bags, 4 dim tomato bags, 1 posh plum bag. +striped chartreuse bags contain 2 dotted orange bags, 3 bright lavender bags. +dim indigo bags contain 4 shiny coral bags, 4 mirrored olive bags. +dotted purple bags contain 4 mirrored white bags, 1 posh yellow bag, 5 drab maroon bags. +muted chartreuse bags contain 5 bright silver bags, 2 bright brown bags. +shiny purple bags contain 3 dim maroon bags, 2 mirrored lime bags, 2 light lavender bags, 3 dotted salmon bags. +faded white bags contain 3 vibrant white bags, 5 muted gray bags. +muted red bags contain 3 posh coral bags. +mirrored tan bags contain 1 dotted gold bag, 2 dark coral bags, 3 light purple bags. +dim blue bags contain 3 dull blue bags, 4 posh plum bags. +bright indigo bags contain 1 muted white bag, 1 wavy fuchsia bag. +striped crimson bags contain 3 dotted coral bags. +light orange bags contain 3 striped chartreuse bags, 4 bright silver bags, 5 clear cyan bags. +posh yellow bags contain 3 bright brown bags. +dotted beige bags contain 1 plaid red bag. +faded aqua bags contain 3 drab tan bags. +shiny red bags contain 3 striped lime bags, 5 wavy teal bags, 2 muted olive bags, 1 shiny chartreuse bag. +light tomato bags contain 4 muted green bags. +bright olive bags contain 4 shiny maroon bags, 1 striped tan bag, 2 drab teal bags, 3 mirrored chartreuse bags. +mirrored white bags contain 4 vibrant aqua bags, 4 clear blue bags, 4 bright violet bags, 1 muted olive bag. +posh olive bags contain 2 shiny maroon bags, 3 faded coral bags, 1 dark turquoise bag. +vibrant lime bags contain 1 light lime bag, 5 bright lime bags, 4 vibrant olive bags. +striped brown bags contain 3 clear chartreuse bags, 4 drab magenta bags. +striped lavender bags contain 1 wavy plum bag. +wavy white bags contain 4 dotted red bags. +dark bronze bags contain 2 posh green bags, 1 dotted crimson bag, 5 bright lavender bags, 1 shiny coral bag. +mirrored black bags contain 3 muted salmon bags. +shiny magenta bags contain 4 dotted orange bags, 4 bright silver bags, 3 posh coral bags. +light bronze bags contain 3 dotted coral bags. +mirrored gray bags contain 1 muted olive bag, 1 bright violet bag. +bright lavender bags contain 1 dull tomato bag, 2 clear blue bags. +drab yellow bags contain 3 dim tomato bags, 3 striped green bags. +dark chartreuse bags contain 5 vibrant violet bags, 4 shiny tan bags, 4 dark orange bags, 1 dull tan bag. +vibrant indigo bags contain 3 mirrored violet bags, 3 light teal bags, 2 dim red bags. +plaid green bags contain 3 wavy blue bags, 4 wavy yellow bags, 1 dull lavender bag. +mirrored purple bags contain 5 vibrant silver bags. +vibrant yellow bags contain 4 plaid brown bags, 3 drab bronze bags, 5 posh bronze bags, 3 mirrored lime bags. +pale gold bags contain 4 shiny indigo bags, 4 clear maroon bags. +shiny cyan bags contain 3 dim olive bags. +dim salmon bags contain 5 faded beige bags, 2 faded orange bags, 2 shiny purple bags. +dark crimson bags contain 3 dull aqua bags, 1 wavy olive bag, 3 posh plum bags, 3 bright brown bags. +vibrant gold bags contain 3 wavy gray bags, 4 clear white bags, 1 faded salmon bag, 3 drab aqua bags. +faded magenta bags contain 5 plaid aqua bags, 4 faded purple bags, 5 wavy bronze bags. +drab black bags contain 3 pale aqua bags, 2 clear coral bags, 2 mirrored silver bags, 5 dark cyan bags. +bright green bags contain 1 shiny aqua bag, 5 drab salmon bags, 5 wavy tomato bags, 4 faded beige bags. +bright aqua bags contain 2 vibrant magenta bags, 3 dim indigo bags, 5 dark fuchsia bags. +pale olive bags contain 1 dotted brown bag. +mirrored fuchsia bags contain 1 dull brown bag, 3 light cyan bags. +mirrored red bags contain 3 plaid lavender bags. +wavy blue bags contain 5 wavy turquoise bags, 3 light green bags, 4 dim indigo bags, 3 posh coral bags. +clear silver bags contain 4 plaid gray bags. +muted white bags contain 2 dotted salmon bags, 4 mirrored white bags, 3 clear cyan bags, 2 muted chartreuse bags. +dim tomato bags contain 3 drab white bags, 1 posh gray bag, 3 dark cyan bags, 5 posh green bags. +drab beige bags contain 1 light orange bag, 3 bright salmon bags, 3 pale silver bags. +clear gold bags contain 2 vibrant white bags, 2 plaid yellow bags. +vibrant orange bags contain 5 muted chartreuse bags. +striped tan bags contain 1 wavy gold bag, 3 mirrored black bags, 1 shiny aqua bag, 5 vibrant red bags. +bright lime bags contain 4 dim indigo bags, 3 dull tomato bags. +bright red bags contain 5 drab magenta bags, 1 clear salmon bag. +vibrant green bags contain 4 plaid tomato bags. +light tan bags contain 5 muted green bags. +striped white bags contain 1 faded silver bag, 2 vibrant red bags. +dull violet bags contain 5 dull turquoise bags. +drab salmon bags contain 3 posh magenta bags, 1 dark teal bag. +mirrored cyan bags contain 2 dim violet bags, 1 plaid aqua bag, 1 vibrant blue bag, 1 posh magenta bag. +wavy teal bags contain 1 bright crimson bag, 2 light cyan bags, 4 striped silver bags. +vibrant purple bags contain 5 shiny magenta bags, 1 dotted orange bag, 2 wavy teal bags. +faded beige bags contain 1 posh green bag, 5 clear coral bags. +faded lime bags contain 1 wavy gray bag, 1 light orange bag, 5 clear bronze bags. +mirrored green bags contain 5 drab bronze bags, 3 muted violet bags, 1 clear blue bag. +light green bags contain 5 mirrored lavender bags, 3 drab gold bags. +pale crimson bags contain 3 pale chartreuse bags. +mirrored aqua bags contain 4 drab plum bags. +dull crimson bags contain 2 bright white bags, 5 drab olive bags, 5 pale salmon bags. +dull purple bags contain 1 posh magenta bag, 3 mirrored brown bags. +bright white bags contain 4 vibrant blue bags, 3 dull brown bags, 4 drab green bags. +drab indigo bags contain 2 bright salmon bags, 2 muted maroon bags, 2 clear gray bags. +striped fuchsia bags contain 2 drab gold bags, 4 mirrored white bags, 3 muted black bags, 1 dark teal bag. +dark tomato bags contain 3 muted fuchsia bags, 1 dotted lavender bag, 4 drab turquoise bags. +mirrored tomato bags contain 5 dark olive bags, 4 light black bags, 4 dark magenta bags. +dark plum bags contain 4 wavy yellow bags, 4 shiny salmon bags. +dark salmon bags contain 1 dim bronze bag, 4 pale indigo bags, 5 dotted chartreuse bags. +dotted lime bags contain 1 shiny brown bag, 3 faded lavender bags. +dark red bags contain 3 posh green bags, 1 vibrant bronze bag, 2 dull maroon bags. +dim lavender bags contain 2 dark turquoise bags. +striped cyan bags contain 1 clear chartreuse bag. +dull indigo bags contain 5 shiny brown bags. +faded green bags contain 1 drab maroon bag. +drab fuchsia bags contain 2 clear olive bags, 1 bright cyan bag. +drab gold bags contain 2 dull turquoise bags, 5 dim lavender bags, 4 light teal bags. +dotted violet bags contain 3 drab tomato bags, 5 dark lavender bags, 4 bright fuchsia bags. +shiny turquoise bags contain 4 light black bags. +muted green bags contain 3 vibrant bronze bags, 4 dim olive bags, 2 posh yellow bags, 2 dull cyan bags. +pale purple bags contain 2 drab yellow bags, 3 bright crimson bags. +posh fuchsia bags contain 1 dull tan bag, 2 dim orange bags. +drab teal bags contain 1 dim violet bag, 2 drab green bags, 5 mirrored lavender bags, 2 faded purple bags. +mirrored teal bags contain 4 vibrant aqua bags, 2 dull turquoise bags, 4 vibrant bronze bags, 3 mirrored olive bags. +muted violet bags contain 3 wavy chartreuse bags. +mirrored salmon bags contain 3 clear cyan bags, 5 posh plum bags, 1 shiny coral bag. +vibrant crimson bags contain 4 dotted chartreuse bags, 2 wavy yellow bags, 3 drab green bags. +dotted teal bags contain 3 clear black bags, 1 faded blue bag, 1 clear beige bag, 4 striped brown bags. +posh orange bags contain 1 dim olive bag. +striped bronze bags contain 1 dull salmon bag, 4 wavy teal bags, 1 pale salmon bag, 2 dim aqua bags. +clear lime bags contain 1 dim lavender bag, 1 drab magenta bag. +muted magenta bags contain 1 shiny indigo bag, 4 mirrored cyan bags, 4 shiny cyan bags, 2 posh bronze bags. +bright chartreuse bags contain 5 drab white bags, 3 dotted purple bags. +dim magenta bags contain 2 dull turquoise bags, 1 dull coral bag, 3 dark violet bags, 4 muted crimson bags. +pale cyan bags contain 5 dotted coral bags, 4 drab chartreuse bags, 4 dull plum bags. +shiny white bags contain 2 drab salmon bags, 3 shiny silver bags. +faded tan bags contain 4 posh magenta bags, 1 pale teal bag. diff --git a/2020/day8.cpp b/2020/day8.cpp new file mode 100644 index 0000000..ad82b0f --- /dev/null +++ b/2020/day8.cpp @@ -0,0 +1,113 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +enum OpCode { Acc, Jmp, Nop }; +struct Op{ OpCode code; i32 num; }; +auto extract_op(const std::string & string) -> Op { + auto op = Op{ Nop, 0 }; + auto op_code_str = string.substr(0, 3); + if (string.substr(0, 3) == "acc") { op.code = Acc; } + else if (string.substr(0, 3) == "jmp") { op.code = Jmp; } + else if (string.substr(0, 3) == "nop") { op.code = Nop; } + + op.num = std::stoi(string.substr(4, string.size() - 4)); + + return op; +} + +struct State{ u32 isp; i32 acc; }; + +auto execute(State & state, const std::vector & ops) -> void { + switch (ops[state.isp].code) { + case Acc: state.acc += ops[state.isp].num; ++state.isp; break; + case Jmp: state.isp += ops[state.isp].num; break; + case Nop: ++state.isp; break; + } +} + +auto attempt_swap(State & state, std::vector & ops) -> bool { + if (ops[state.isp].code == Jmp) { + ops[state.isp].code = Nop; + } else if (ops[state.isp].code == Nop) { + ops[state.isp].code = Jmp; + } else { + return false; + } + + auto local_state = state; + auto executed = std::vector(ops.size()); + while (local_state.isp < ops.size() && !executed[local_state.isp]) { + executed[local_state.isp] = true; + execute(local_state, ops); + } + if (local_state.isp >= ops.size()) { + state = local_state; + return true; + } else if (ops[state.isp].code == Jmp) { + ops[state.isp].code = Nop; + } else if (ops[state.isp].code == Nop) { + ops[state.isp].code = Jmp; + } + + return false; +} + +auto main(i32 argc, char * argv[]) -> i32 { + auto ops = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("day8.input"); + while (getline(file, line)) { + ops.push_back(extract_op(line)); + } + } + + auto state = State{ 0, 0 }; + auto executed = std::vector(ops.size()); + while (!executed[state.isp]) { + executed[state.isp] = true; + execute(state, ops); + } + std::cout << state.acc << std::endl; + + state = State{ 0, 0 }; + while (state.isp < ops.size()) { + if (attempt_swap(state, ops)) { + std::cout << state.acc << std::endl; + break; + } + execute(state, ops); + } + + return 0; +} diff --git a/2020/day8.input b/2020/day8.input new file mode 100644 index 0000000..a348b44 --- /dev/null +++ b/2020/day8.input @@ -0,0 +1,610 @@ +acc +0 +jmp +516 +acc -16 +nop +326 +jmp +366 +jmp +400 +jmp +494 +acc -5 +jmp +475 +acc +29 +nop +24 +jmp +186 +jmp -5 +acc +50 +acc +49 +acc +49 +nop +507 +jmp +236 +acc -4 +acc +50 +acc +48 +jmp +293 +jmp +461 +acc +48 +acc +2 +jmp +241 +acc +38 +jmp +544 +jmp +1 +jmp +382 +acc -4 +acc -10 +acc +44 +jmp +444 +jmp +1 +acc +20 +acc -1 +acc +25 +jmp +332 +acc +18 +jmp +184 +acc +1 +acc +20 +acc -7 +acc -12 +jmp +84 +acc +30 +jmp -19 +nop +491 +acc +37 +acc +44 +jmp +220 +acc +3 +acc +19 +jmp +485 +jmp +222 +nop +264 +acc +4 +jmp +151 +nop -36 +acc +48 +jmp +356 +acc +28 +acc +29 +nop +397 +jmp +168 +nop +115 +acc -13 +acc -11 +jmp +470 +jmp +201 +acc +48 +acc -6 +acc -18 +acc -13 +jmp +442 +jmp +266 +acc +10 +acc +30 +acc -7 +acc -8 +jmp +380 +acc +1 +nop +106 +acc +9 +acc -11 +jmp -79 +jmp +166 +acc -9 +jmp +300 +acc +39 +acc +1 +acc +27 +acc +26 +jmp +367 +jmp +291 +acc +18 +jmp +100 +acc +25 +acc +43 +acc -8 +acc -12 +jmp +475 +acc +15 +jmp +492 +acc -5 +acc -12 +acc +35 +acc +25 +jmp +360 +nop +301 +acc +32 +acc -1 +jmp +436 +acc +21 +jmp +109 +acc +1 +nop +230 +jmp -113 +acc +24 +acc +12 +acc +13 +acc +27 +jmp -52 +jmp +476 +acc +15 +acc -18 +acc -13 +jmp +323 +acc -10 +acc +35 +acc -6 +nop +377 +jmp +8 +jmp +430 +nop +50 +acc +33 +acc -1 +jmp -72 +acc -19 +jmp -92 +jmp +1 +jmp -87 +nop -120 +nop -34 +jmp +159 +jmp +183 +jmp +1 +acc -4 +acc +49 +acc -4 +jmp +73 +acc -18 +acc +34 +acc -8 +jmp +403 +acc +32 +acc +0 +acc +0 +jmp +390 +acc +19 +jmp +305 +acc -15 +jmp +176 +acc +3 +jmp +36 +acc +29 +acc +21 +jmp +1 +acc -17 +jmp +144 +acc +16 +acc +4 +acc +49 +acc -7 +jmp -65 +acc +28 +acc +2 +acc +23 +acc +46 +jmp +278 +jmp +424 +acc +45 +acc +7 +jmp -49 +jmp -50 +acc -11 +nop -121 +jmp -140 +jmp +1 +acc -8 +jmp +206 +acc -7 +jmp +1 +acc +20 +acc +30 +jmp +375 +nop +312 +jmp +111 +acc +23 +jmp -15 +acc +27 +acc +46 +acc +36 +jmp +360 +acc +1 +acc +25 +acc +29 +jmp -137 +jmp +177 +acc +15 +acc -13 +acc +48 +acc +29 +jmp +76 +nop -174 +acc +27 +jmp +214 +acc +4 +jmp +120 +nop -165 +acc -16 +jmp +2 +jmp +238 +jmp +224 +jmp -154 +acc +12 +jmp +162 +acc +31 +acc +26 +acc -13 +acc +18 +jmp +173 +acc +38 +jmp +1 +jmp +199 +jmp -202 +jmp +127 +acc -12 +jmp -42 +acc -12 +acc +36 +acc -4 +acc +24 +jmp +343 +acc -17 +nop +277 +acc +13 +jmp +56 +jmp +41 +nop +92 +acc +32 +jmp +182 +nop +111 +acc +0 +acc +29 +jmp +219 +nop -234 +acc +0 +acc +31 +acc +49 +jmp +216 +jmp +247 +acc +24 +acc -10 +jmp +218 +acc +14 +acc -19 +acc +14 +jmp +11 +jmp +82 +acc +5 +acc +28 +acc +35 +jmp -93 +acc +24 +jmp -210 +acc +39 +jmp -107 +jmp -150 +acc -7 +jmp -185 +acc +25 +acc -15 +jmp +63 +acc +14 +acc +50 +jmp -7 +acc +13 +jmp +298 +nop +69 +jmp -268 +acc -5 +jmp +66 +jmp +48 +nop -1 +acc +38 +acc +3 +acc +46 +jmp +259 +nop +235 +acc +4 +jmp -186 +jmp +94 +acc -16 +acc +6 +jmp +287 +acc -19 +jmp -221 +jmp -69 +acc +8 +nop -102 +acc +31 +jmp +204 +jmp -81 +acc +12 +acc +21 +acc -8 +nop +151 +jmp -155 +acc +50 +nop +145 +acc -6 +acc +0 +jmp -296 +acc +16 +acc +30 +acc +11 +jmp +254 +acc +0 +acc -8 +nop +162 +acc -17 +jmp -144 +acc +6 +acc +2 +acc +32 +acc -5 +jmp +21 +jmp -77 +acc +38 +jmp +117 +acc +27 +acc -11 +nop -203 +jmp +201 +jmp -305 +acc +40 +nop -330 +acc -7 +jmp -279 +jmp +60 +nop -163 +jmp -53 +nop +115 +acc +24 +jmp +1 +acc +45 +jmp -92 +acc +0 +acc +13 +jmp -302 +acc +25 +jmp +208 +nop -293 +jmp +5 +jmp +1 +acc -13 +nop -272 +jmp +62 +acc -4 +acc +32 +acc +49 +jmp -124 +acc -19 +nop -246 +jmp -353 +nop -349 +acc +13 +acc +21 +jmp -165 +acc +14 +acc +37 +nop +28 +acc +7 +jmp -308 +acc +11 +jmp +71 +jmp -139 +nop -19 +acc -7 +acc -3 +jmp -302 +acc -2 +acc +1 +nop -43 +jmp -280 +acc +10 +acc +9 +jmp -358 +acc +39 +acc +16 +acc -11 +jmp +1 +jmp +142 +acc -15 +acc -17 +acc +9 +acc +11 +jmp -172 +jmp -90 +nop +135 +acc -1 +jmp -379 +acc +39 +acc -13 +jmp -57 +acc -3 +acc -7 +jmp +1 +jmp +80 +acc +7 +acc +11 +acc +30 +nop +69 +jmp -140 +acc +11 +acc +7 +acc +3 +jmp -417 +jmp -314 +acc -6 +jmp -6 +jmp -224 +acc +0 +jmp -131 +acc +7 +acc +33 +jmp +20 +acc +32 +acc -14 +nop -375 +jmp -394 +acc +8 +acc +47 +acc +29 +acc -6 +jmp -381 +acc -8 +jmp -353 +jmp -108 +acc -16 +acc +21 +jmp -329 +acc +13 +acc +0 +acc +0 +jmp -402 +acc -8 +jmp -307 +jmp -308 +jmp -358 +acc +38 +acc -19 +acc +33 +jmp -276 +jmp -114 +acc -6 +jmp +55 +acc +16 +jmp -244 +nop +22 +acc -7 +acc +19 +jmp -154 +jmp +18 +jmp -50 +acc +31 +acc +50 +acc +2 +jmp -260 +acc -16 +jmp -135 +acc +50 +acc -9 +acc +50 +acc +27 +jmp -323 +acc +26 +nop -249 +acc +46 +acc +3 +jmp -474 +acc +50 +acc -7 +jmp -78 +jmp +1 +acc -6 +acc +6 +jmp +94 +acc +47 +acc -3 +acc +13 +jmp -485 +nop -499 +acc +35 +acc +35 +acc -1 +jmp -259 +nop -486 +acc +48 +acc -4 +jmp +23 +acc +33 +acc +37 +acc +10 +jmp +61 +acc -1 +jmp +1 +jmp +1 +acc -8 +jmp +61 +jmp -237 +jmp -164 +acc +39 +acc +38 +nop -302 +jmp -468 +acc -15 +jmp -6 +acc -9 +acc +1 +acc +41 +acc +48 +jmp -285 +acc +1 +acc +24 +jmp -111 +jmp -90 +acc +46 +acc +21 +acc +43 +jmp -103 +acc -9 +nop -5 +jmp -274 +acc -13 +jmp -262 +jmp -39 +acc +43 +nop -463 +acc +15 +acc +23 +jmp -176 +nop -305 +acc +2 +acc +28 +jmp -198 +acc +15 +acc -18 +jmp -473 +acc -13 +acc +9 +jmp -46 +acc +1 +acc +43 +acc +6 +jmp +10 +acc +24 +acc -3 +jmp -424 +acc -1 +acc +47 +jmp +1 +acc +20 +jmp -17 +jmp -59 +nop -19 +acc +42 +acc +47 +jmp -9 +jmp -576 +nop -148 +acc +0 +jmp +12 +acc -15 +jmp -209 +acc +13 +jmp -442 +nop -548 +nop -62 +acc +22 +jmp -92 +jmp -516 +acc +8 +jmp -301 +acc +1 +jmp -146 +acc -15 +jmp -366 +jmp -440 +acc +17 +acc +25 +acc +28 +jmp -240 +acc -2 +acc +25 +nop -68 +acc +14 +jmp +1 From e267460bfcec53e16b6cbc03744e021383eb14bb Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Tue, 8 Dec 2020 10:00:51 -0800 Subject: [PATCH 20/52] Completed days 6, 7, & 8 --- 2020/Makefile | 16 +- 2020/day6.cpp | 64 ++ 2020/day6.input | 2249 +++++++++++++++++++++++++++++++++++++++++++++++ 2020/day7.cpp | 104 +++ 2020/day7.input | 594 +++++++++++++ 2020/day8.cpp | 113 +++ 2020/day8.input | 610 +++++++++++++ 7 files changed, 3736 insertions(+), 14 deletions(-) create mode 100644 2020/day6.cpp create mode 100644 2020/day6.input create mode 100644 2020/day7.cpp create mode 100644 2020/day7.input create mode 100644 2020/day8.cpp create mode 100644 2020/day8.input diff --git a/2020/Makefile b/2020/Makefile index fbee5e7..ede9575 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -1,17 +1,5 @@ -day1.out: out/types.o day1.cpp - g++-10 -std=c++2a $(flags) day1.cpp out/types.o -o $@ - -day2.out: out/types.o day2.cpp - g++-10 -std=c++2a $(flags) day2.cpp out/types.o -o $@ - -day3.out: out/types.o day3.cpp - g++-10 -std=c++2a $(flags) day3.cpp out/types.o -o $@ - -day4.out: out/types.o day4.cpp - g++-10 -std=c++2a $(flags) day4.cpp out/types.o -o $@ - -day5.out: out/types.o day5.cpp - g++-10 -std=c++2a $(flags) day5.cpp out/types.o -o $@ +day%.out: out/types.o day%.cpp + g++-10 -std=c++2a $(flags) $(@:out=cpp) out/types.o -o $@ day%.cpp: cp template.cpp $@ diff --git a/2020/day6.cpp b/2020/day6.cpp new file mode 100644 index 0000000..ae1035b --- /dev/null +++ b/2020/day6.cpp @@ -0,0 +1,64 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +auto main(i32 argc, char * argv[]) -> i32 { + { + auto line = std::string(); + auto file = std::ifstream("day6.input"); + + auto answers = std::vector(26); + + auto sum_1 = usize(0); + + auto group_size = usize(0); + auto sum_2 = usize(0); + while (getline(file, line)) { + if (line == "") { + for (auto i = usize(0); i < answers.size(); ++i) { + sum_1 += (answers[i] > 0); + sum_2 += (answers[i] == group_size); + answers[i] = 0; + } + group_size = 0; + } else { + ++group_size; + for (char c : line) { + ++answers[c - 'a']; + } + } + } + std::cout << sum_1 << ", " << sum_2 << std::endl; + } + + return 0; +} diff --git a/2020/day6.input b/2020/day6.input new file mode 100644 index 0000000..f8efe7a --- /dev/null +++ b/2020/day6.input @@ -0,0 +1,2249 @@ +fekdcbayqxnwvh +fycwqktvxandeb +kqbafvcxyewrdn +akwqcvenxfydbs +ewbaxdcvnkyfq + +timjneyhbvxkfagdpzrous +gsumijvxoheptbafnkyzrd +yxtbnupramvdezhkfojsig +soaruhxnpiemjvytzbfdkg +vfanlgjoiskzmubtxhceyprd + +dhgabzfspkltq +pflzsbtaxhqdkg +kzpbfgasthldq + +xeu +uoe +tnpeox +e +vrdzwglecbk + +nucwl +hnmx +fqv + +kfubtzpovrdlw +vdjmblrztpkosfg +kavpdbgfzreol +qpdzfrvokibcy + +yhknrqpubeolzixtvsj +tlysdjzovxhnuqreimk + +bclpmatw +btqmcw +cvwtbm +bmwct +ctmwb + +qmo +oqm + +su +s +s +s +s + +ztfmocgiesxdq +fpjmthksidlbo + +smzbn +bmnzes +skzmnb +mbszn + +kibmrznqcyladupv +umnbkdpievlqcyar +idavpbmnrklqucy + +favynhqocijkmtbzsrulp +ycbzrmkuvlhnpfqsitjao +ujbomprktafvliqhycnzs +nymjkczihqbpfvutosalr + +tdev +vh +wva +va +gzv + +d +d +d + +ejrmqwg +merjguw +jmreugw +mjrgwtie + +wxiqgpu +guxqiwp +puigxqw +pugqwxi + +ealugrzsvhpxfmjdbqknoy +doyhvplkjqarnbeutxsgfmz +uhvxjaklmzoyqdbegrpfsn + +iv +os + +o +amtle +n +npz + +vbfxystq +knsxyqubtvf + +t +p +p +o + +xtz +ptz +ftx +ujt +tp + +rs +qdfan +mkpz + +idewynukmzac +yacfmdwuizke +ieuamdczkywf +iczwymuekad +adwekumyciz + +agnq +gn +gno +gni +vkmnxug + +ftlyhuvaj +xsribwknlgmt + +a +nay +a +a + +leq +q +qj + +sxrwi +isrwx +wrsix +iwsvxjr +rixwbs + +p +p +p +p +p + +unvlyxripzbmaedwjsfqth +uvefyibspxrzjdlwtqhnam +hnbapqzflsvxreiutmydwj +nwdefhtzrxuqpsvljabyim +razbwymsdfpnlutqxveijh + +zfihqcvwdbsm +sufwpahczlbvd + +tqjanyicszeodpmk +ljmtwvkrcfghdqbu + +ydxnthpazbskufcq +txymsjdfhwuqbz +vhyuqsfjbxdrtzg + +smyvegtwiu +imyqtuesv +idrluzhjatkvpc + +pzacglju +pzulcagj +jcalgupz + +rgzbvefacsw +vafbrezcw +wegjvrczfqba +zwrvabpfce +rlhekwzyfbacovm + +hfqu +fq + +kywvrsxgiojp +xosvigpkwyjr +irwkjfvmxpsyog +pvxyrwiksjgo + +ynebghqmrkcjlpiuftdoaz +reaqjoyngdbiltkmuphcf +ynobfdgluriphskejcqtam + +uac +ca + +fmxawgkrin +xfrnbigok +sfighjeckrux +girxkfl +gaxirnfk + +smoyaxbku +uobkxysam +kyszxumojba + +uocvgjr +hjponwcuzg + +fobhkeascqluwrzm +hzcolfipysnrjaguwkeq +ezwlhkcfsoxqrua + +blnosjgezuqcrvxwm +cmeznoglqxubwjrsv +zxnqvwoubpremsjcgl +umxrlsgqoczwbvnej +cuxanesjkivzrmlboqgw + +dewtyuqjlv +ucvazfm + +kbm +imltbj + +ydqnxlmbouvaztcg +vhrkwxjzfnpisye + +jqeadkcibtgflsz +ltbxqifjedsawkzcg +zdfqgkijestcl +jczfqdektlsig +scdgufyjeizlkqt + +w +w +w +w +s + +wygptc +ygctpw +gcptyw +tpycgw + +xaqicwhtdpvk +aixdcpkzhvqwt +qkcdhxpwaivt + +wt +xtrowm +wt +wt +tw + +sncq +cus + +zehxb +txe +exuma +exz + +epjgfknhvuwmr +nkwrmfhjegp +rjkpynefgmwh +ehfprjkgndmw +mewkfdnrgjhp + +hgyc +kgc +ghc +cgxjzl + +evsloum +leosvmu +mejvuzoxdsl +evmolsu + +fugckqhymrxbtvdpnose +beyorulcqxgdkzafh + +s +s +sq + +wtjfgezdhsxckibrqyunvpo +uaonrpkmidbgftwlsjz + +mrylewxsgvfodhu +sfdxoyghwlrvmu +dungfohvlwrxsym +ulmsoghvxfrwdy +uoifgdlwrsvymhx + +tbg +btdg +tbg +tgb +btg + +pukht +huk +fhkqu +hykcfu +hedvmgubsk + +dxycvosnr +xcsdyrgmapf +qoyrsxdc +uedsxtyrc +ucdrsbxy + +m +xz +m + +gcjsybuhrotm +dojcsubhprt + +opmgsudhej +mjceogdsuhp +djpgmoushe +jgeptsluhfomakdvyq + +jugocetyrzwfbhp +ipvqwcozxbsdu +gybprkmznowultcaj + +ipcau +n + +juzmidp +iudjp +digjups +pajiud + +zxnugrosjvlcphwmqbdyt +bvtlmqnudzrjwysxcohagp +tdxhyuwemcvbrpzgnoqfjls + +hoefmguvxyiazwcpbrjk +umlbagzxeowthjfpik +hmxeziglfbwjup +jgxbspifzwqhneum + +mgvupsk +ezwcui + +adczjnguyq +ygnujdacqz + +ohricgqjfu +rqgucfhoji + +vygwkszidxqa +onxkejczsguywqv +stvzbqypwmxkg + +ydjm +fpbustykx +yrq +ry + +vjphn +npvhj +phvnj + +bryndzmekui +oathqpcv + +yczewurklaxnfdhoqbt +rlyhawcdunqeofxkzbt +lhbsqfkxctyonwrdzuea +zltnhdkqybaxufoerwc + +cjwarkog +joawgrkc +wcjgkrao +wrcjogak +coerwgsajk + +umwjqsetdg +sjwmet +jbteyhownvsaxm +dmuspcztjrew + +xtswpc +eahncvzqxkgmo +lcixybdrsuft + +pcrfwszodmqnj +vrcylgb +iruc + +bqigzouxryndpa +jaixybnro +oabixhnjry + +pbznr +xrb +bdntx +qecbyi + +zbvhxyfm +vxmbyfpz +vbxzmyfh + +nfcqwuhsrxojk +jrqvokfscnxuh +nxqiaulkrojszchyf + +dkwqfb +wd +hwd +nhwd +dnw + +vjtpxorsdyzbwhqi +kirdlmofpnectxqwuz + +ynzxtvqogrdhwl +yhdjomktn + +hqwn +hnwq +hnqw +hwnq + +gosxz +xog +gfomxa +ogxd + +wctesuhxonyl +oxwhtecynusl +cslwxehupyton + +pr +spr +pr +pr + +maqfseovdhzj +sqodparevimfzjl +dxosqmafejvz +dqzojehfasvm + +awsicurgfmxeqjylnvktbd +dywmreaitvjgcnbklxs + +wmvbnqtxuriz +hbuwefypzlkadq + +asjcpwml +lcasmjpw +ajspcmwl +cmslwjap + +unkrl +n +ny +yan +nv + +zrjwsxduie +jswxrziunde +xrujwhsidze + +qnl +unc +xhtdjbvf +omauis + +wxvoqihatseg +setwqgi +ewgstqci +fetwqgis +wqtfgkiesd + +vmpikgfsarbnxqudwjtoh +bdovpatjgnxkqufsihmrw +bjhnrtaokxudmfqpigwvsc +kaqbvihwmsnxjpgrtoufd +fmabtdgkuhxpwrivsoqnj + +eazsitkjronml +otmrenjakzsi +samrojenitzfk +tkzenmrjoais +tszkioaejrnm + +r +rbq +r +r + +lwbrfsuahoq +yjawifugdtrvs +rfbaswu +cfsarlknupw + +ist +ay +kc +cu +kd + +mbku +bkva + +sxktwmyfaldbn +ymkbnfpdltx +xbyftnmkdl +dlkfetbimxycn + +cjru +rcju +rjucl +kcjrum +auzcjrtn + +vkinfzqbrled +rinldvbqfze +rqizebfvldn +aciqrfbsnelvxdz + +ig +ig +gi +gi + +rskzxocuq +kcovqsnztur +skzocrnyuq +vourxysqzkc +opescqukrhjz + +i +u + +xqfviycpuzjbwkn +lnxbfkpcyqdawm +xofypnwkbcqv +wbvxcfkqtnpry +bnoixpfqgkcwy + +ziwlofkdgpc +qzayrwjvks + +krybec +ryk +yrk +kyr +yrk + +xkhdreqfbyipmzalco +wiepqtyhxflvcomabjdsz + +jpgankzcvbtw +kxzugtvnbjp +gknqpjxzvtb +kbtjpvzgmn +bptzvmjkng + +hdaxwiypslz +ndbylw +xdkwtflpyqsz +wlrvcdyjg +mlfewsqodyu + +c +c +o +c + +mah +a +gwa + +heczudoqwmvtyab +acevwozyqtdumhb + +v +e + +rom +mor +romi +rom + +uxdj +d + +p +p +m +db +t + +dtpzeykh +pkdhryzetu +zdkhtpyac + +qanetkhrc +ndlhkceqof + +khbfjlnacvz +cmavfjlkn +aynljofvqkgc +tlkjcnavfm + +ejcbnl +mbgcoiuhsfl +qblyc +blyjevc + +vgqlcfhnx +xwgonuc +pystigbca +cnqlgmdk +rlfcwg + +nazyhitgcjr +nytgizahwprjc +zjcgrinmahyt +nrcdhzgjyati + +xtljebqpg +bpjewtgn +gjtpebx +gmoipkebtcsj +ptwejlbng + +e +exa + +h +nohegc +h + +ivbgpd +isfglyvbdo +dgvbi +bdivug +gvikbd + +wyjmpxghiqfeoctdnbuar +qetnaimxlgsfcbrpj +kbcrhxgjnqpadefzimwt + +kindbwqlusyh +tpzryjgehaucfmov + +wzgou +ugo +guo +voug + +ndwhzsrugpjmltxiqofvkbyc +lgirqyotwjbmvuspfnxhdzck +jbqzgwcvhxofkrmsdlytpuni +xrqzfjolsywtcghdbmukpivn +oqryngdmhljvctxwkbfusipz + +saw +as +sa +msajv +sfa + +oxtrnhvfqyswldb +tmzwgrakc + +coqyrbzjhsmwivanep +xkshzgft +hsz +slzh + +z +glh + +dtusogw +fmpkzvbxnjwh +eaqdciyw + +bgcyqhrztvdxwn +vqtanbyurxczowdg +kmjxyvnbqztfgcrwd + +vospejybinm +fiosvkbnjep +johqpznbeisv +iysbokmjvepn + +nxsrfohagwb +agblosrxwnhf +xgircuhsaobfw +hfxpgosarnbw + +bgqurk +eumkrnvxqg +gkrqhspafuoc +qtogubkr + +bxlapnm +nptix +oqxpn +npx + +rytbpswaezlufdqxo +imazhtjqnglc + +encpqudzigamorv +vamkeznqirdcgp +opvrglqsmcindzae +mpvncrisdezaqg + +ikxqemun +zadbkqjtxney +kenmpxuoq + +vjdqxfyhckrpton +hmngcfpytkdxqvo +ohdvuywpstzkcaqf + +tepj +te +ecvty + +jqotiphkmsexvfugd +gwpyfuhlevkdiotjqx +tjkfvghibocaqxeudp +onexjzpgthuidfkvqs + +ltfq +lqts +oqtl + +nqsyglepwzhmtiojbuvxf +wihkgaoydpzvfxclsenqjmt + +fqxmt +bsgtmxqyrjfdv +tfqmx +itmhqwfx +qtmxf + +rgv +vjwo +nlekpa + +ldytkguwhazeqpb +pqzaytglhbmfuedki +dqbatkpyezhglu +ztgyqjebhkdvpual +kpalzeytqghudb + +xsynhr +hsnury + +qyjukdtmnwhrczvolsb +ymsutqrchdblznowvj + +mpw +wmq +tdwm +wmd + +n +n +n +no + +vnutqbxrygmjwhks +rhoalixstfyuq + +jeyfhsotc +setchyoj +hcyoejst + +ylhpvfiawoekjbq +pkroabqvljiyefhw + +akqbyjpziglmfedw +wjdbyeaqpzligmkf +lfikyqwzbmadjegp +aswgkzdyfrqpmnlibje +fqpmyedjklgzibaw + +qe +eqo + +jbxoe +qoikde + +c +n +j +j +j + +rfh +rhf +rfyh +rhbf +qfrh + +hokvgpxyunam +bmpyogvhunlw +morevjuznhydgit + +ohns +nhos +ohns +hons +hsno + +kxclzyqpan +aexnyqzkpc +pakcqnxzy + +gkytw +mgtw +gptmw + +fixsozjwykhupqmvtbrc +syimxhzbpwcktrofuvjq +xuiwfjvzcpykqhbrosmt +mwrbvqjtkcsipxfolyhzu + +bzhxpyfmk +yfzxmakphb +mkzpxbhyof +hbmzfkxpwyu +pxzhkoybmf + +osdyp +dbsroy +sydoj + +yterzphvxdm +vtxrmyhzedp +vymperdhxtz +mpxrvyhedzt + +esakn +cseak +hxasge +enksta + +u +gfzua + +jsymd +dmxjy +jmdy +xymjd + +sezfhlvxmaqtd +ajvtmqsecyghfixzwl +ksbhxzvafqpmuet +zfeqytxhadmsvc +nextsvazhmyfq + +rucla +auclyr +uticrapl + +akizsuwdmnhpxbgyceft +gwxpfeoyihcklbndasz +zwhsbigdynkpxceaf + +zag +vmisa +yphkcant +jdma +bia + +nplydbkoq +oasptkqgldnbey +doypnqklbc +yblkodncpuq +lqkynpdob + +hmj +jm + +gniearxpdbjlkfm +qdvjlute + +omsihqlnwzbt +blzmhisnqoftw +onqlmwsetzbphi + +jzoxcwdf +wdcjzifxq + +ykdshgzwjfecimnp +jhipmsaftezkoc +ziaspcjfmkhve + +t +t +t +f + +zmevcjhbsainxoquwpftkydlr +cygwbtvxemnzfjhrqkdspaolu +efdtnrlwczymxqvpsoukjbah + +oujkhnlzydsirva +dxgzjsuptaohqvnkic +aoiujdlnkzehvs +uriadhksjyoznv +iydmovnzakhfusj + +ycajzrtie +zctyriesap +pxiacrztehby +qaenyxtzirc +saecrytzi + +xrnjkgdpuzqvcm +ndqkvuxczjpgrm +ucgmzjpqrnxkvd +npqxkumdcezvgrj + +thymlxwaoz +ylhowtmazx + +nwaisrejbtqfmh +mbwhqnrfjesa +hfnrqebjasmw +jecwhfgrsqodanmb +qasbhnjwferm + +ny +ny +yne + +lgkmfbthwaouscxpznvyrdi +nhlmtpwyrojfvbuaczxkgds +askbuvdozmnxhfygrlwctp +fytznqhlbmxgrwcdoupavks +wcplxyvsrdjnfgkmuzbtaho + +fklceui +kclfiue +klefiuc +clfekiu +iklcufe + +yavcmhwbp +capvymhbw +whypmabcv +pbzmcywvhja + +lbevjz +gnvefbu +webvd + +ewzcqndmjhvy +jevrqnym +guqpiotaevsbmynlj +vqmekjynf +nefqmjxvy + +akgwyjfi +giwfyljak + +pdejr +jerd +redj + +liwtk +kiwl +wikl + +rbwvox +bxvnor +vbwxro +vkrxob +xbvirwo + +ntsbkwqefjphro +nqdvgxihopwc + +dn +nd +nd + +j +f +g +k +j + +tfsul +usftl + +ov +v +w +tj +sl + +gdlufaesv +uagvd +vudag + +cbegxmuiwkzo +okrmgbfwvnecp +uybxehawmgqkoc +yloqmbwgtczke + +jms +ymsfjo +lmsuiwhe +ydsmk + +wgckujsd +irp + +zgeulsjvimptdaxrqnk +zbxtefdmvganulqprikjs +ptslznrjqkxemagiudv + +fqtb +qp +aq +q +q + +hrkzci +bhwkpidxtflcue +hkic +chki +kcjhiv + +gi +s + +rakewmostbfvjzgi +begtioavfrkzjm +zoeikjtbfagrvm + +xnbhdlctm +bgfhwlxsaqnkov +pelmnhuxryb + +e +qr +jh + +vhtwuokdqpa +jfaniksczbeymr + +ngedtljsvybxkmhfuzw +tbzedwsjgknvhlmfu +lzbgdsuhkjtvermwfn +smizqluwdetfavbnhjg +blwtngusvdjzhefm + +lxaiqvkoh +feioxvwbsrl + +fy +yfbqlm +fy +yf +yf + +cuygpzd +kv +k +v + +antp +nat + +uk +ku +uk + +tdjbri +rdwezgjtlck +stvfhapyx + +psu +spy +ps +pksy +bpsq + +db +o +o + +yi +iq +pmxi +i + +oxt +atox +txo + +wn +sgzth +b +m +ynq + +ayxvhzu +vhyzxu +hvzuyx + +cxoygklt +toky +ovkpyt +voystpk + +yqtjwifbvsn +vstyfbxjqwin +vsjtinqfwby +qxysnitjwfvb +bjfynsthqiwv + +zobny +zynob +ozbyn +noybz +onyzb + +inpdmtkblgqrvaowzxu +zhrbpuwiqdomgvlnt +topveguwzrcbndmqli + +eapmtqrski +islukrmpe +sevcbzfngx + +pcbl +vxqwe + +ky +t +p +qzfo + +bkhdlpnrxezivu +lztsfxpgknho +knwlxmzjhpy + +t +ita +oqt +sbt + +omwk +eowm +wmo +wmo +osbtmxwd + +dwgpvjemitbcnuhr +vyjlitenkbpmuhqwxd +iedvbwjczstunpmhg + +yfakujntsriwgxm +rfatigyjkxusnm +uyxitmkagnjfs +isjafytxumgnek +tiknjmugxsyaf + +pahkyfojrv +enxmd + +sehnkcr +shkrc +hcwxilkru +skgchrfpjt + +zdcvpant +nizclpmtgbv +jtcpnzv +phtnscvza +azcntrowvpd + +ativhgmyedozw +nvztmiahewg +uhaimgzventw +txiqfmzglphvwae +ehmgiwtzav + +qdpreikohtyjc +ihtydekrocpqj +djkoticqhpery +jcorkdepqyiht + +kgwunqm +qgjunwk +oinqruwzyk + +wtkqceimludr +mkhpwdcqleurzt +mqweldutkcr +kdtmwceulrq +rqlutcidwmke + +k +h +k +k +k + +irb +arbi +bri +irb +fbxvri + +umpkng +qmnugpk + +sbdxmlzacj +sbzlcamjxd +cajmslzxdb + +fwndcxr +xbmusn + +t +t +gh +p +t + +zovqiwdhuaslkjxrbcnt +flhnkoxvadiqrwpzbjs +gqkisrxodznabjwvlhp +koqlswdahnzjvbrmyxie + +apecofvgshiyqbj +icegjhasytobfpvq +ocsheqagjfpyivb +pewjncobqiysgzrfahv + +wzomnlgyxj +thazprgi + +rywgaemsubhvkqcozpnxl +avehbwolxnzmqyprgu +qyrgpxhazluvenobmw +jhtrzywlnmbeoxvgpiaqu +gavmwzrponyxhduqble + +tw +wt +tw + +qpzxrctf + +iqpunlsawtcykmxbdvgfzjr +vnwdruyptakbgqxjimlzcfs +fgizdmcblparnsvtuqwxkjy +pxwylavndgqtjbicfksmzru +xtpdfrbkcglzvqjuminaysw + +xkyvhtdwpjnulig +hvegnyitdwxjz +vthsnxjaywdig +whdagyqvxjtni +wjvgytdaxnhi + +ygduev +clqoa +qxc +xaz +fc + +rzeqvofasyhjgxwkmtcudn +vkuogexmwhznrycdqft +zupwcondeklthrbvxgmyfqi + +mtredzn +xcnozebtrmd +elzrmwtund +emtdnrz +tedmzorn + +tlbunpqygz +xmehasrifvwj + +hoskgitlw +owrailhtfkg +wigbjvhtolk +tbhivwgsuklo + +fxnachtsdmiwvuzkg +hacwldskfgvuixmtzn +xghufdizawvnmsctk + +gnauvfizjdortq +rinjautyqdzvg +giunqazvtdrjmc +wndhjzuqviatgr + +vtpsy +sptvy +svpty +ptksyv + +yaskce +xdtvyjnqma +faoyb +psyfa + +lbxounj +lijrmoxnb +mioybjnx +afbjnvopxsch +bjlzoknx + +vqmsgwjfkzdbthal +jszvlwthkmqfgdba +akmfjzgldswvqth +tuswfahjmdqkgvlcz +jvatqgfmnwzhdksl + +uqyfkzdwta +hctzeiywabpgvlqonmuf +zyurtaqwsxf +wyruzjaqft + +rwltyhqdecxagbov +azthexlkoqmvrdngcwfs +corjvwqhutexadlg +lecogwrhavqdtx +qpdvrgctyaohwlex + +egsilhd +hxmijg + +tzdmnvsyiwjrhakbgp +wmzhsctpdrbnagvyei +bvwtaylgdnzhsmipr +rhmlswzvpandgtybi + +qriopbacexhnlwfvsmdk +wblaondrszhcfpei +pdnahlrjseiwfcob +cerwaoshjldbfnipzu +oalsrdienwcfhpb + +xcpe +pcx +cxpl +nbpyzixc +lpecx + +xyfcgdaew +jdlcopnaixqbv +ehkcdrax +dcytarmuhgxews + +bqozpsd +pqzosd +zgqdop +ocqzdfp + +uxy +szj +jzl +fhvk + +muz +m +omycvi +im + +t +u + +xslkmbzarnfeo +axmndjpsqzelrbkfo +eykroszbaxlmhfn + +rsz +rzq +kzrit + +hkmqiydpzlosuanvwj +czsjklbvwaidhnxpu +ejvwqmatlkziundhps +udgjnfoepkwilrhsvaz + +czlnqtdy +bcv +cvga +hvcb +ac + +lcmytwdeqifzakjhuon +mdqxhfgpzykvteajn +emfpxqnhbykzdatj + +rtgmujlen +eguclrkmtnj +npjgemtrlu +untmegrjl + +olykiz +orxyswdtka + +qelnh +yijmfxtvbs +gweh +wrc + +vjcediawtnrmoh +lvnhmabrxcjwet +ajmkbntrvchlegw + +yicrxeztbdpjuqlfgnvksmah +rayjtgdsfhexiqvpcznlkubm +crxijflabsgkhtqmdeunpvyz + +gpbklvxy +pybxg +ypwgxbd +gpxyb + +vos +sv +vs + +hqiktnmezpvacby +uekhv +egskvh +kvehog + +myhoetiwlqrpdk +pgfkbqleywmhtic +tezpslhymwkiq + +t +vxh +g +t + +gjimn +ijugmn +njmgi + +drojlynvs +nrysdjvlo +lydosnjvr +sjylnrodv +nyjrdvols + +vjrclek +vuljbckqfteds +cihklevgj + +rqbvni +flxuv + +gpywjntefcm +cnoaetmyjpgd +mpeynjcg +rbnpymcgexzhqji +cjumnegpwy + +h +c +h +h +h + +hzrqoybi +wynqkcmlduae +zqybh + +itnoq +rtinoq +tqhlin +imtbq + +moetialxhyqkznjwscgdpv +qwcagyzjvtoednmixlsphk +kxqajsiotvnlhcgwdzympe +ynejvlhsopakcmzdtxgiqw +yaxdpiqktjsozmgvncewlh + +qyrlgevbzsutwmxjhindcaokp +vtdjrqaocngwehspylbukmz + +aev +ve +a +byqg + +ycfvpamkhliot +wmckyrthxusfqiedjlaz +atcmhkboiylf + +sfqkmlhdc +mlhkscqdf +fcqsdhmlk +kqfhcdmsl +kqslzfdmhoc + +dgveoupsmhabyfkrztclj +vedwkmptusfhzaygqolcr + +tfoaevgbi +yfu +sfwqh +kpfxlj +dufl + +mlwhb +jvgtzp + +jzp +szwipyj + +larkxcqsbpeuiv +fharycntpzi + +lsympnqboj +nlpjmobqys +njoslbqpym +qsnodjtlmbyp +lnosbmpjyq + +jpovmflgikracyqunwthe +hawgrlcyvpnmkjeofuit +pltojwgrcfkhaneuivmy +klaoumwtfgejnhcripvy + +hmvxakwrtundglz +mkacvnhwrlxbzdug + +asvoizlprxjefycmthugnqw +zohmwpxdaiyvrfnulecgjtq + +natmhjdg +zctmdalg +vbiamufq + +vhxbajdokyn +dkvxonyhmab +hnexvbdaoyk + +gyjfnm +gmfnyj +jfygmn + +bjqn +bnqj +nqbj +qbnj + +hawjpsxeolr +rwlqenjhpsobgamx + +tovhgbwjdckpqn +ifzl +mleysuzrax + +sky +ky +mgfpwk + +zx +h +ict +gz + +zsjitm +lijor +jmwabyit + +nbzmj +abvfwrdn +csnbm + +hdqyski +ywvclhdsq +hsqbyxd + +jmt +mtsuhxjzkla + +fijlt +psjbtfieg +zqcohan + +gwnfpqb +pnwf +wpnf +wfnp +nwpf + +irgkabh +khgibar +akgirhb + +emonkbuycsz +noyzscmuk + +ejsqzftblax +scomdrxgibw + +afdjtiyvgqorsmnhubweplkxzc +fmznscjliqbyevhxwoktdugrap + +cgyxhiubmptdokesrjzlafq +pmdqvjuygbeslzatokxfr + +hyawt +wh +wh +wh + +vojux +ei +nq + +pvnjgmxksluctq +zfrdoa + +d +z +x +xd +d + +dwpscgknx +kwxc +xcwk +wxkci + +qipb +ildp +ziacpr +pbdi + +x +xb +x +x +x + +fenqcuwi +niczkhxeq +mcejqnxit +iycrngpqel + +uyj +yju +yuj +ujy + +b +bd + +e +e +e +e +fei + +tncbizahupsdwlog +oclbqdskwnaymx +atloswndebjcriv + +msojaeqnphzylgdbc +ebmzlphcgyjoadq + +apehlz +tozlmeba +ekyflaz + +qpnhfgjdzymlctkrb +slmbhkqpfyngzj +mlpqjyzbghnkf +nmzghjyblkfpq +bngqfhymkzpjl + +apgvczsfuybdiklq +gmhxdubftesavzlpjcqyi +aswyzugkicpfvqldb +oylsvgbcnuqzdafpi + +ncrkh +nhkrc +kncrh +hkrnc +hcknr + +nvrjtzamfuhqxp +ebdigavktsywflmco + +evrabhcmxkonl +vlcxmbnkrheo +cxloknrmeb +pkclmerbonx +lbkoryunexmc + +zdmhgatfpqcwrsu +beravdksgly + +wfo +fw +bfwh + +kpzlhbtjfiw +fjwpzhkbli +bfhpkjzwil +pjwoikhzlbf + +yworad +adsyr + +atqhenzlswmufgkojrb +lfoanzusbhgtjkyeqwm +nsgajlhqeobkfztwmu +mlcisaozwkhetnqfjgbdu + +xhqkmdutfzasylbw +hqubgdwxlztkmsyfae +pfhuacyitsqxmbwlzkd + +tqbpnosumlj +jdtpqbyoli +ulobptqjn +tfqlvwzopbajc +jxpeobqtulis + +awg +wag +awgk + +czbledy +avgwqu + +kf +f + +bh +gm +tj + +l +dm +lspg +zfeauxn +qt + +zwep +pwze +wpze +ewzp + +jptngbzhk +tgnkrpzxdjh +ghjznktp + +ofrbuieszcakqt +snomauqcerdpbt + +nbjxhyvtpl +tbxzgovhjy +yhbtxjovizk +bytvxhj + +pibogfjn +fogbinjl +bonqgfji +banjisugcmwfvoe +iobghfjn + +tz +t +ta + +qnraf +qrxf +qfr +ezroqf + +iachtzfemxwbs +gzsfycehaqwkm +twmhzcsbrafe +zmafhcewxs + +gqoznmrlxvudwehf +uvzrohmlgdnwqxef +frgvqedxohmlnuwz +fqledmnvwghruzxo + +rxcvnyjbqgm +cjygxmrvbqn +vuybxmkcrnqg +ipgrxvnobcmeyq +yvqnbmrgcx + +ay +ay +ay +ya +ay + +np +xa +ba + +ibrcmtxqvyaed +vycdaeitmbxqr +dvqiytmcxabre +dvbaicqeyxrtm + +hgzd +zdlho +zhd +zdh +zdh + +hcipn +zchnipb + +rwptzv +ymoedzaltsc + +ubdwmjecyqxltipzfn +mvfulhydqewjtzpnci + +najhotpuyrsxdlqbk +wxetrjaobduqpznklsyc + +jwcgbxoipeyfmkvhr +cmblwpoudxteyfvnhkrg +qzseparbjxvykfocghwm +eqvwroycibpxmfghk + +xwedaqgiznj +khubyeatir +avgncxeljzmsoif + +zf +f +f +htbcr + +st +kmr +rm +tvebzs +cig + +gdij +gvi +jhgies + +fduipkhlz +izdplfu + +pdculaojmwsqebvgh +zmhjsdwlefgoucrpvy + +bzwagcde +uhsqpmloni + +mf +f +ltfn + +xlhmpdyieob +mlxpyhideo +mixkldhpoye + +lwthjcvgnmxuypos +vixqojmy +evrxmoyj +ymkajoxv +zfvjdymaxo + +voh +h + +onqdyf +qmnf +wiktfqsajgn + +poaheifqcl +plqcoifaeh +paegritwhnvlofzucjd +ipeohaflc +oielhpafcs + +tzvenpcqxisbjhmgkrw +xvnckipbhszegfwm +pkchgoxbavsmewizn +csvzekmhyngipxbaw + +wgim +ixaw +wixka +iyownrps +iwk + +caofbkuznsiqrtvpjyg +pyroglzcjtfub +pcfjryzgtubmo + +junoecpfwmhtxkayziqvgrl +zqigynpcvufwohjlemtkxar +oeavkrhizljumtgfpxwcqny +tyizfjnoqcbgxarepklvwsudmh + +itvqcxburwo +idtvacoqbex +btvifjxcqyo +ojikvqcltbx + +bromkxwdfq +dkfrbwqamxo +korxywiqfdmb + +smyfvkg +xmkgvsf +kgnsfvem +mkfvgs + +pdxa +mqgx +lxsezkbjic +xy +wfprx + +ynhepftgslro +wytlefgosarn +ysgtndocwlrf +lrgnfoswtya +zlibfutmrkxsvjnqgyo + +kht +tkh +htk +hkt + +pcdxhjnovlusitq +dbtrjizv + +bjhnkitaegvrsx +nxghvbestra +bwetgsarvhxdn + +oleswygxbnfmtzkjuar +xuaezbtcwlgmnrofsjy + +hdrgyowbfktavjuqlzm +gtkvfdulwqjzhymabro +rzojgmltbyhafvwdqku + +uxpwqbyr +xpquwyrb +rwxyqubp +rwbyquxp +qxrbyuwp + +kqlwz +rkve +klnf +ucqk + +irqgpjmdk +ctqmvnkfbgj + +dv +dv +dv + +fariyqplzoetb +zykjphxcg + +pytmwqvx +txvpqmdwy +xtyqvwmp +wvqmxypt + +oekfrmuatwl +axsvpcjkgqdzhiby + +fnyuqsihvmatgwxlr +ufjmioapebxnqydhtk + +tpskxdqc +kxsqcdtp +ytqsdkxcp +cxpqdtks +tcxpsdqk + +soivtnhezljymw +mhcyptneuvob +nfetymhgdavo +vnbhmxetaoy + +sqruavzncixgbpof +vioanzfgreuxqc +acetqngfrxoziuv +gqcfmxvrnzaoliju + +earxh +gmizfq + +tejlcvwgxpdbhsorufmiz +oftmijdscxlvzbuwpehgry +cvnksdzamhgbporwtufiljxe + +wdmgbxyihk +khmxyidwg +hikxwdlpygm + +nzcf +cz + +vhfecblgmowtqxpaskyi +xwgztblrjiacpfmheksvy + +pemi +e +e +ze +e + +fxwy +xyfw +yzxfw + +kshfqrlmyea +xsqboukan + +vknp +levn +pknv + +vqsdyhzwei +poijeyhscazl + +ryf +ofit +txw +jqvlhmbgeuznps + +qhzycdugf +cuhqdzfg +fghuqzcd + +emqngdv +meaqh +ezqmax +exqm +qmaze + +jgrnahfyvotupkxziqsdmceblw +ntughqlksexifdraozvmbcpwy + +imt +tim + +pthzw +tpnwhz +piztlw +tzpw + +xpuh +xbqrvys +lxw + +cpidsmqk +rkpcdmisq +pcdkqsmi +pmskqdic + +thxqby +bqxohty +qybhxt +yqtbxh +yqbxth + +qkplixrshe +jndbsraivm +zrgelsyit +lfsri + +zqr +zrtc +rz + +deabt +ueatgs +hwiqknj +ulxb +tdm + +sfpwq +phsqw +kpsqw + +guhmbl +gmuhb +mhndpub +yuihmgcb +uismhby + +qioblnp +olnqbip +loqbinp + +rqc +qcr +crqay +rqc + +z +z +z +z +zp + +ljo +lcbajeorg +jlox +oljx + +loasmqxdy +mqld +lvmdqb + +iq +qi + +filjwt +fwitlj +fliwtj +wtljif +tjwfil + +dx +xd +dx +xnd +xd + +vzo +zov + +ogbwntefukpch +ebwnsfkgupocht +noctepwgfhkub +wfqkugnpodjthbce + +genbzqkvspy +brkwjevpqsczn +fdxnvtzsobqiekau + +nxwb +wnj + +imfvncxbhlrdzgok +vbfdakgnhlcrixmo +cnzbholrkvdifmxg +ucoklqmbdxnvigrhf +blndpvmhkirgcxfo + +hquykcmexvza +evnayxkchmzq +jfyxamhqpiwzeokgcvs +ekzdruqamhlbtvxyc + +nk +knwct +pbykwan +dzsegnfqrom +linuwk + +tbc +tqbe +tcub + +lzxybkftrhis +ylrxhdasutjzncipgbfw +xktyhfizlrobqsmv + +sjb +pdkaowvu + +bnhcaqjprkx +ncdrqxbolaijkt +zaxrnksqchybj +cbnaxejqrk + +bteqziwsumofxpvchr +choiepzjxuwtvfrsm +irtuwcsemlpvfzhox +twhximepcsfzorlvgu + +ta +at + +xjdybasehgpm +edaosjpgxhmby +xybgpdjemsha +dmexjpbaslhywg +xpmedyahjbsg + +cbjxvynghstrfluoempdk +idhbtapleufcsrgywnvmox +xohdljfecvupmsgrbytkn +rvleksucfbdymxgotqpnh + +klfewtsaihpxnmogudy +seqdufxypnlikwtogah +ewpohdiknstxugayfl +xwenydkuhfasotlgpij +fignpyousdtkwexalh + +oudzygfimh +xvj + +qbpviwoadmfr +dimbswlpqnh +yzgxbqidwuj + +ismkdvnyzajbuowlpqfr +vjqwufylscopgmkrdabi +rhbwefvqiykupsajolmd +msdqtukoipvfxlyjrabw + +lho +hol +jfolhv + diff --git a/2020/day7.cpp b/2020/day7.cpp new file mode 100644 index 0000000..97991ea --- /dev/null +++ b/2020/day7.cpp @@ -0,0 +1,104 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include "types.hpp" + +struct SubBag { std::string type; u32 count; }; + +auto find_bag(const std::string & line, usize & index, SubBag & new_bag) -> bool { + while (++index <= line.size() && (line[index] < '0' || line[index] > '9')); + if (index >= line.size()) { + return false; + } + auto end = line.find(" ", index); + auto count = std::stoi(line.substr(index, end - index)); + index = end + 1; + end = line.find("bag", index); + new_bag = SubBag{ line.substr(index, end - index - 1), u32(count) }; + index = end; + return true; +} + +struct Edges{ std::vector from; std::vector to; }; + +auto count_to(const std::string & search, std::map & map) -> usize { + auto counted = 1; + for (auto & bag : map[search].to) { + counted += bag.count * count_to(bag.type, map); + } + return counted; +} + +auto main(i32 argc, char * argv[]) -> i32 { + auto bag_graph = std::map(); + { + auto line = std::string(); + auto file = std::ifstream("day7.input"); + while (getline(file, line)) { + auto find = line.find("bag") - 1; + auto bag_type = line.substr(0, line.find("bag") - 1); + if (!bag_graph.contains(bag_type)) { + bag_graph.insert_or_assign(bag_type, Edges()); + } + + auto new_bag = SubBag(); + while (find_bag(line, find, new_bag)) { + if (!bag_graph.contains(new_bag.type)) { + bag_graph.insert_or_assign(new_bag.type, Edges()); + } + bag_graph[new_bag.type].from.push_back(bag_type); + bag_graph[bag_type].to.push_back(new_bag); + } + } + } + + auto seen = std::set(); + auto search = std::stack(); + search.push("shiny gold"); + while (search.size() > 0) { + auto current = search.top(); + search.pop(); + for (const auto & bag_type : bag_graph[current].from) { + if (!seen.contains(bag_type)) { + search.push(bag_type); + seen.insert(bag_type); + } + } + } + std::cout << seen.size() << std::endl; + + std::cout << (count_to("shiny gold", bag_graph) - 1) << std::endl; + + return 0; +} diff --git a/2020/day7.input b/2020/day7.input new file mode 100644 index 0000000..4a770f4 --- /dev/null +++ b/2020/day7.input @@ -0,0 +1,594 @@ +faded plum bags contain 5 wavy cyan bags. +dull aqua bags contain 4 dark fuchsia bags, 1 shiny purple bag. +dotted olive bags contain 1 striped gray bag. +vibrant brown bags contain 4 dark tan bags, 4 mirrored gray bags. +shiny black bags contain 3 mirrored black bags. +dull bronze bags contain 2 plaid aqua bags, 4 shiny magenta bags, 2 faded green bags, 3 dotted gold bags. +wavy plum bags contain 5 dim indigo bags. +drab brown bags contain 5 clear fuchsia bags. +vibrant maroon bags contain 3 shiny coral bags, 1 dim indigo bag, 4 muted crimson bags, 5 clear black bags. +posh magenta bags contain no other bags. +dull brown bags contain 3 dim violet bags, 3 striped silver bags, 1 shiny purple bag. +pale gray bags contain 3 plaid magenta bags, 3 clear teal bags, 3 pale white bags. +plaid turquoise bags contain 4 bright orange bags, 5 drab white bags, 4 dotted coral bags. +dotted silver bags contain 2 pale silver bags, 4 dark teal bags, 5 posh gold bags, 1 bright orange bag. +light red bags contain 1 dark violet bag, 1 mirrored coral bag, 3 drab tan bags, 4 muted olive bags. +shiny brown bags contain 5 vibrant lavender bags, 4 dark lavender bags. +plaid plum bags contain 1 faded green bag. +vibrant lavender bags contain 4 bright chartreuse bags, 3 dark teal bags, 4 muted aqua bags. +muted yellow bags contain 5 posh yellow bags, 3 dim olive bags, 1 light cyan bag, 1 plaid gray bag. +light beige bags contain 2 wavy orange bags, 5 vibrant salmon bags, 2 dim brown bags. +muted indigo bags contain 3 dim brown bags, 3 drab brown bags. +dim bronze bags contain 4 dim black bags, 5 wavy turquoise bags, 5 bright violet bags, 2 dark bronze bags. +shiny teal bags contain 5 plaid chartreuse bags. +pale aqua bags contain 2 striped lime bags, 4 dark turquoise bags, 3 dull tomato bags, 2 mirrored lavender bags. +plaid violet bags contain 2 light olive bags. +dotted maroon bags contain 5 striped maroon bags, 2 shiny turquoise bags, 2 dull gold bags, 4 pale olive bags. +dim chartreuse bags contain 5 striped plum bags. +plaid gold bags contain 1 striped green bag, 3 plaid coral bags, 4 dotted violet bags. +faded tomato bags contain 2 dark indigo bags. +posh plum bags contain 1 wavy chartreuse bag, 4 vibrant blue bags. +drab bronze bags contain 2 mirrored gray bags, 3 vibrant plum bags. +muted blue bags contain 1 bright brown bag, 2 pale coral bags, 5 plaid purple bags, 4 dim lavender bags. +striped indigo bags contain 5 dark salmon bags. +shiny tan bags contain 2 faded bronze bags, 3 mirrored lavender bags, 2 mirrored cyan bags. +dim red bags contain 5 dull salmon bags, 3 dim purple bags, 2 striped crimson bags. +plaid gray bags contain 5 bright violet bags, 4 vibrant aqua bags, 4 dull tomato bags. +dotted white bags contain 1 drab brown bag, 5 light brown bags. +plaid tan bags contain 3 striped teal bags, 2 dotted brown bags. +vibrant black bags contain 3 plaid tan bags, 4 muted white bags, 4 drab orange bags, 5 muted aqua bags. +drab purple bags contain 5 muted violet bags, 2 vibrant blue bags, 4 pale olive bags. +mirrored beige bags contain 1 plaid gray bag, 2 mirrored lime bags, 3 dark brown bags. +vibrant olive bags contain 5 shiny indigo bags. +drab green bags contain 1 muted violet bag. +faded turquoise bags contain 2 striped brown bags, 3 vibrant white bags, 1 dull lavender bag, 5 bright olive bags. +shiny maroon bags contain 1 dim bronze bag. +dull white bags contain 1 muted salmon bag, 4 dim olive bags, 5 drab white bags, 1 dotted teal bag. +dim white bags contain 3 mirrored lavender bags. +clear beige bags contain 5 shiny cyan bags, 3 clear chartreuse bags. +plaid tomato bags contain 5 muted beige bags. +bright teal bags contain 5 shiny gold bags, 4 clear beige bags, 5 vibrant chartreuse bags. +dotted salmon bags contain 1 clear fuchsia bag, 2 muted maroon bags, 4 posh yellow bags, 1 drab chartreuse bag. +light gold bags contain 4 light maroon bags. +faded cyan bags contain 2 posh magenta bags, 2 dark violet bags. +drab cyan bags contain 5 faded purple bags, 4 striped crimson bags, 1 shiny maroon bag, 4 drab tomato bags. +dotted black bags contain 3 striped turquoise bags, 4 dark tan bags, 4 vibrant lavender bags. +faded purple bags contain 4 dull purple bags. +dim violet bags contain 2 clear blue bags. +wavy gray bags contain 4 muted crimson bags, 2 mirrored silver bags, 5 vibrant chartreuse bags. +posh tan bags contain 4 drab tan bags, 3 muted crimson bags, 2 striped crimson bags, 2 plaid fuchsia bags. +mirrored magenta bags contain 5 pale bronze bags. +plaid brown bags contain 1 bright chartreuse bag. +drab orange bags contain 4 drab teal bags, 1 dark bronze bag, 2 clear purple bags. +dim green bags contain 5 dull maroon bags, 1 dull green bag. +faded teal bags contain 2 bright yellow bags, 2 posh red bags, 2 posh indigo bags. +dim gray bags contain 4 wavy blue bags, 2 shiny maroon bags, 1 pale cyan bag. +light crimson bags contain 1 wavy plum bag, 3 muted magenta bags, 3 plaid aqua bags, 2 striped chartreuse bags. +clear white bags contain 2 posh magenta bags, 5 bright white bags, 5 drab bronze bags, 3 vibrant beige bags. +drab magenta bags contain 4 pale olive bags. +plaid silver bags contain 4 bright violet bags, 3 dim brown bags, 1 dark teal bag. +bright bronze bags contain 4 posh white bags, 3 dull salmon bags. +drab maroon bags contain 3 clear black bags, 2 dotted orange bags. +dark fuchsia bags contain 3 faded chartreuse bags, 5 clear green bags, 4 bright brown bags. +vibrant salmon bags contain 1 bright red bag, 5 clear black bags, 2 clear green bags. +shiny crimson bags contain 4 muted fuchsia bags, 2 plaid red bags, 3 clear green bags. +plaid crimson bags contain 4 bright gold bags, 2 clear turquoise bags, 3 faded magenta bags. +dim turquoise bags contain 3 drab brown bags, 5 plaid cyan bags, 3 plaid teal bags, 5 shiny silver bags. +clear crimson bags contain 3 plaid blue bags, 2 drab tomato bags, 2 dull cyan bags, 3 mirrored fuchsia bags. +pale tomato bags contain 1 dull yellow bag, 3 muted aqua bags. +dim orange bags contain 1 posh magenta bag, 2 wavy gray bags, 5 faded indigo bags. +mirrored orange bags contain 1 posh bronze bag, 2 faded white bags, 1 light orange bag, 2 posh red bags. +striped turquoise bags contain 5 muted salmon bags, 5 dark white bags, 1 mirrored purple bag, 3 pale chartreuse bags. +dotted coral bags contain 3 bright brown bags, 2 posh yellow bags, 3 drab maroon bags. +wavy maroon bags contain 2 clear lime bags. +mirrored indigo bags contain 1 mirrored cyan bag, 1 posh plum bag, 2 plaid silver bags. +wavy indigo bags contain 5 dark violet bags, 5 drab black bags, 4 dark orange bags, 5 muted green bags. +striped tomato bags contain 4 dark indigo bags, 5 light lavender bags. +pale lime bags contain 2 bright orange bags. +muted maroon bags contain 2 bright violet bags, 1 shiny coral bag, 1 posh gray bag. +drab lavender bags contain 1 muted magenta bag. +bright fuchsia bags contain 1 striped lime bag. +wavy beige bags contain 2 bright brown bags, 1 pale black bag, 1 drab tomato bag, 4 vibrant blue bags. +shiny olive bags contain 2 dim teal bags, 1 mirrored cyan bag, 4 dim yellow bags, 4 muted aqua bags. +posh coral bags contain no other bags. +dark green bags contain 2 posh brown bags, 2 muted white bags, 4 bright fuchsia bags. +shiny green bags contain 1 faded crimson bag, 3 striped purple bags, 4 shiny salmon bags, 2 dark bronze bags. +clear coral bags contain no other bags. +dull salmon bags contain 1 muted white bag. +dark lavender bags contain 2 plaid gray bags, 4 muted olive bags. +bright silver bags contain 5 pale black bags. +posh green bags contain 5 muted olive bags, 4 dotted crimson bags, 4 dotted brown bags. +dotted fuchsia bags contain 5 shiny chartreuse bags, 1 dotted coral bag, 1 shiny cyan bag. +dim fuchsia bags contain 1 striped orange bag, 1 clear crimson bag. +dotted cyan bags contain 5 muted olive bags, 3 shiny white bags. +dark beige bags contain 4 light teal bags, 4 drab teal bags, 5 wavy beige bags. +striped magenta bags contain 5 plaid purple bags, 3 dotted crimson bags, 2 dull tomato bags. +striped blue bags contain 3 dim aqua bags. +light silver bags contain 3 shiny green bags, 2 vibrant black bags, 1 wavy turquoise bag, 3 faded bronze bags. +pale indigo bags contain 4 pale silver bags, 3 dotted tomato bags, 1 dark violet bag, 3 clear lime bags. +mirrored turquoise bags contain 1 pale salmon bag, 2 dotted crimson bags, 1 drab tomato bag, 2 muted green bags. +striped beige bags contain 3 dotted tomato bags, 4 vibrant purple bags, 2 plaid tomato bags, 4 dark salmon bags. +pale silver bags contain 5 dark lavender bags, 4 drab tan bags, 5 clear yellow bags. +dark lime bags contain 3 pale aqua bags, 5 posh green bags. +faded coral bags contain 3 dull tomato bags, 4 dark bronze bags, 3 drab tomato bags, 2 bright white bags. +mirrored lavender bags contain 3 mirrored cyan bags. +bright crimson bags contain 2 mirrored silver bags. +striped gray bags contain 3 dotted coral bags, 4 muted maroon bags, 4 dark teal bags, 5 pale bronze bags. +dotted magenta bags contain 2 dim teal bags, 2 wavy turquoise bags, 5 dull turquoise bags. +posh white bags contain 4 drab tomato bags, 2 muted aqua bags. +striped red bags contain 2 plaid blue bags, 1 light plum bag, 3 bright white bags. +pale white bags contain 1 light purple bag. +shiny coral bags contain no other bags. +dark magenta bags contain 4 pale tan bags, 1 posh chartreuse bag, 2 pale yellow bags, 2 pale indigo bags. +light gray bags contain 4 pale green bags, 5 dotted green bags, 4 shiny gray bags. +dim gold bags contain 3 clear violet bags, 5 plaid aqua bags, 2 bright tomato bags, 2 wavy teal bags. +dim crimson bags contain 4 muted blue bags, 2 light tan bags. +wavy tan bags contain 1 posh plum bag, 3 mirrored gray bags, 1 muted purple bag. +posh brown bags contain 4 mirrored black bags. +bright plum bags contain 3 vibrant plum bags, 3 mirrored crimson bags. +faded black bags contain 1 pale lime bag, 2 pale tomato bags. +mirrored yellow bags contain 1 pale aqua bag, 4 dull aqua bags, 4 shiny white bags, 3 clear lime bags. +muted tan bags contain 2 clear brown bags. +drab white bags contain 5 dull coral bags, 2 drab green bags, 4 wavy tomato bags, 5 mirrored cyan bags. +dull black bags contain 4 vibrant tan bags, 1 shiny chartreuse bag, 5 pale gold bags. +posh maroon bags contain 5 dark coral bags, 5 faded yellow bags, 2 light lavender bags, 2 wavy teal bags. +drab coral bags contain 4 posh chartreuse bags, 2 dim red bags. +posh indigo bags contain 2 plaid brown bags, 4 muted green bags. +drab aqua bags contain 2 pale magenta bags, 2 posh orange bags. +drab crimson bags contain 2 pale bronze bags, 4 dotted blue bags, 2 dim silver bags. +drab silver bags contain 5 clear blue bags, 4 pale bronze bags. +clear salmon bags contain 2 pale aqua bags, 1 plaid gray bag, 1 clear coral bag. +wavy chartreuse bags contain no other bags. +dull plum bags contain 3 plaid gray bags, 3 plaid aqua bags, 2 mirrored beige bags, 2 wavy magenta bags. +faded gray bags contain 2 dull cyan bags, 3 light lime bags, 3 bright lavender bags, 5 wavy plum bags. +striped teal bags contain 4 drab maroon bags. +clear lavender bags contain 3 clear coral bags, 5 bright crimson bags, 5 drab brown bags, 2 dim indigo bags. +mirrored maroon bags contain 1 clear gray bag, 3 shiny salmon bags, 3 mirrored violet bags. +muted turquoise bags contain 2 drab teal bags, 2 plaid plum bags, 4 plaid coral bags, 2 wavy chartreuse bags. +dark white bags contain 4 bright fuchsia bags, 1 dull white bag, 3 shiny indigo bags, 3 dim white bags. +drab red bags contain 3 dotted teal bags, 2 striped purple bags. +muted teal bags contain 3 dark violet bags, 4 plaid chartreuse bags, 2 pale crimson bags. +wavy red bags contain 2 clear crimson bags. +striped olive bags contain 2 mirrored lavender bags. +dull teal bags contain 4 pale teal bags, 5 pale violet bags, 2 drab white bags. +light black bags contain 1 dark red bag, 2 plaid tan bags. +clear orange bags contain 5 bright cyan bags. +pale yellow bags contain 2 bright lavender bags. +posh cyan bags contain 4 clear coral bags. +drab tomato bags contain 4 vibrant blue bags, 5 faded beige bags, 3 clear coral bags, 2 mirrored white bags. +pale orange bags contain 2 light aqua bags. +dull tomato bags contain 5 plaid aqua bags, 2 posh magenta bags, 3 vibrant aqua bags. +pale turquoise bags contain 1 pale coral bag, 3 dim teal bags. +plaid maroon bags contain 5 posh maroon bags. +vibrant beige bags contain 5 dull coral bags. +bright purple bags contain 2 vibrant salmon bags, 5 dotted purple bags, 5 clear silver bags. +dull coral bags contain 4 vibrant aqua bags, 3 dotted brown bags, 4 shiny coral bags. +drab gray bags contain 4 vibrant lavender bags. +dull lavender bags contain 3 vibrant lavender bags, 1 posh red bag, 4 drab tan bags, 3 light purple bags. +striped maroon bags contain 3 bright silver bags. +mirrored silver bags contain 5 clear blue bags, 3 posh magenta bags, 2 bright brown bags. +faded yellow bags contain 2 muted maroon bags. +striped purple bags contain 2 dotted yellow bags, 1 clear cyan bag, 2 dark teal bags. +clear gray bags contain 5 dim black bags, 1 faded green bag, 5 muted crimson bags. +plaid cyan bags contain 2 dark teal bags, 1 pale lime bag, 1 wavy beige bag. +bright orange bags contain 5 mirrored brown bags, 2 dotted gold bags. +dotted turquoise bags contain 3 plaid gray bags, 3 clear chartreuse bags. +vibrant turquoise bags contain 1 muted brown bag, 3 dim purple bags, 1 posh gray bag, 5 pale bronze bags. +striped lime bags contain 1 shiny gold bag. +light violet bags contain 4 mirrored purple bags, 5 clear blue bags. +striped orange bags contain 3 light gold bags, 3 light olive bags, 3 muted crimson bags, 2 pale cyan bags. +drab turquoise bags contain 3 dim magenta bags, 4 pale black bags. +pale salmon bags contain 2 mirrored cyan bags, 4 vibrant blue bags. +shiny yellow bags contain 5 vibrant tomato bags, 3 muted salmon bags, 5 wavy tomato bags. +plaid lime bags contain 2 pale yellow bags, 2 shiny red bags, 3 muted crimson bags, 4 dull green bags. +muted cyan bags contain 4 bright green bags, 5 striped bronze bags, 1 vibrant lavender bag, 4 posh violet bags. +dull cyan bags contain 5 dark lavender bags, 5 drab green bags, 1 bright crimson bag, 4 mirrored silver bags. +pale beige bags contain 3 posh coral bags. +shiny chartreuse bags contain 4 mirrored silver bags. +dark silver bags contain 2 dull turquoise bags, 1 muted maroon bag, 5 vibrant magenta bags. +mirrored violet bags contain 4 dark brown bags. +clear aqua bags contain 2 striped beige bags, 1 dotted indigo bag, 5 faded violet bags, 5 vibrant violet bags. +plaid teal bags contain 3 mirrored lavender bags, 4 posh gray bags. +wavy olive bags contain 3 dull blue bags, 5 bright salmon bags, 5 shiny purple bags. +pale lavender bags contain 4 light purple bags, 2 dotted gray bags, 2 pale plum bags, 3 shiny silver bags. +shiny blue bags contain 2 vibrant white bags, 3 light gold bags, 3 mirrored lavender bags, 1 drab plum bag. +light coral bags contain 4 light teal bags, 1 striped chartreuse bag, 5 dotted chartreuse bags. +pale brown bags contain 2 dim gold bags, 2 clear turquoise bags, 3 bright cyan bags, 4 clear maroon bags. +vibrant tomato bags contain 3 dark brown bags, 1 vibrant blue bag. +dull olive bags contain 5 mirrored yellow bags, 2 shiny cyan bags. +light chartreuse bags contain 2 dull aqua bags, 4 dull brown bags, 1 clear fuchsia bag, 4 bright yellow bags. +posh gray bags contain 4 posh green bags, 1 mirrored gray bag. +bright yellow bags contain 4 pale aqua bags. +bright gold bags contain 3 pale indigo bags, 3 dull crimson bags. +dotted red bags contain 4 pale turquoise bags, 4 muted blue bags, 1 bright bronze bag, 2 light blue bags. +clear brown bags contain 1 mirrored yellow bag. +light plum bags contain 2 bright violet bags. +dim purple bags contain 3 faded chartreuse bags, 5 light teal bags. +dull yellow bags contain 5 muted aqua bags, 3 dotted coral bags, 2 drab maroon bags. +shiny gold bags contain 4 pale black bags, 4 dim violet bags, 3 muted yellow bags. +mirrored crimson bags contain 1 striped teal bag, 5 mirrored cyan bags. +shiny lavender bags contain 4 bright brown bags, 3 bright tan bags, 5 dotted crimson bags, 4 pale black bags. +vibrant cyan bags contain 1 dim yellow bag, 5 bright tan bags. +wavy gold bags contain 2 dark brown bags, 1 dull yellow bag. +dark cyan bags contain 4 dim white bags, 2 mirrored indigo bags, 4 muted white bags, 2 bright white bags. +posh lime bags contain 4 shiny plum bags, 3 plaid fuchsia bags. +posh purple bags contain 3 muted salmon bags. +pale magenta bags contain 1 drab gold bag, 1 dark white bag, 3 posh silver bags. +dim plum bags contain 4 dark chartreuse bags, 4 mirrored lavender bags. +plaid indigo bags contain 2 clear lime bags, 5 dull tomato bags. +dark blue bags contain 1 bright olive bag, 1 dull bronze bag, 1 shiny gold bag. +dull red bags contain 2 wavy teal bags, 3 wavy crimson bags, 1 faded olive bag. +striped yellow bags contain 4 drab salmon bags. +vibrant magenta bags contain 4 light beige bags, 2 dark red bags, 1 plaid magenta bag, 5 dim magenta bags. +plaid red bags contain 2 striped red bags, 4 light plum bags, 3 mirrored silver bags. +wavy orange bags contain 5 vibrant white bags, 1 posh coral bag, 5 muted purple bags, 2 light coral bags. +pale green bags contain 5 pale aqua bags, 1 clear gray bag. +dotted chartreuse bags contain 4 muted violet bags, 5 striped teal bags. +light turquoise bags contain 5 dull turquoise bags, 2 dark aqua bags, 1 dull teal bag. +shiny violet bags contain 2 pale indigo bags. +light white bags contain 3 mirrored indigo bags, 1 faded blue bag, 1 plaid white bag, 1 posh plum bag. +muted beige bags contain 4 drab gold bags. +faded silver bags contain 2 drab white bags, 5 pale white bags, 3 clear lime bags. +faded red bags contain 1 bright turquoise bag, 5 faded coral bags, 2 drab purple bags, 5 bright olive bags. +shiny bronze bags contain 4 plaid purple bags, 5 bright red bags, 1 muted white bag, 2 dull fuchsia bags. +dull gold bags contain 1 dotted orange bag. +muted olive bags contain 1 clear coral bag, 1 posh magenta bag, 2 bright violet bags, 1 wavy chartreuse bag. +dotted bronze bags contain 1 plaid beige bag, 3 clear olive bags, 2 light lime bags, 5 dull beige bags. +shiny orange bags contain 5 pale brown bags, 5 clear tomato bags. +wavy salmon bags contain 2 shiny maroon bags. +wavy crimson bags contain 5 bright violet bags, 3 plaid violet bags. +bright coral bags contain 1 dull bronze bag, 5 dotted gold bags, 1 posh gray bag. +dotted crimson bags contain 2 posh magenta bags, 4 mirrored white bags. +bright violet bags contain no other bags. +drab blue bags contain 5 shiny gold bags, 1 shiny brown bag, 4 dark silver bags. +posh salmon bags contain 4 dim purple bags, 1 striped lime bag, 1 muted gray bag, 2 drab gold bags. +dim coral bags contain 3 dark red bags, 2 faded crimson bags. +dark aqua bags contain 3 dotted salmon bags, 4 pale olive bags, 1 vibrant aqua bag, 5 dull lavender bags. +dark orange bags contain 4 mirrored teal bags, 5 clear salmon bags. +vibrant red bags contain 3 vibrant blue bags. +muted lime bags contain 1 dull silver bag. +clear tan bags contain 2 striped beige bags, 1 posh coral bag, 1 wavy teal bag, 2 faded plum bags. +vibrant coral bags contain 2 faded blue bags, 4 bright turquoise bags. +dark olive bags contain 2 dark indigo bags. +dotted blue bags contain 5 faded cyan bags, 4 striped aqua bags, 4 dotted gold bags. +bright maroon bags contain 1 dark bronze bag, 3 vibrant aqua bags, 4 dim magenta bags, 3 clear crimson bags. +bright cyan bags contain 2 wavy tomato bags. +plaid olive bags contain 3 striped indigo bags, 5 dim purple bags, 3 striped bronze bags, 2 light teal bags. +plaid chartreuse bags contain 3 plaid yellow bags, 1 faded brown bag, 1 vibrant tan bag, 4 wavy fuchsia bags. +dull maroon bags contain 3 muted yellow bags. +light fuchsia bags contain 5 drab maroon bags, 5 muted silver bags. +dull orange bags contain 4 dim indigo bags, 4 posh beige bags, 1 bright red bag. +dull blue bags contain 5 wavy yellow bags, 4 posh gray bags. +plaid yellow bags contain 1 bright fuchsia bag, 1 faded beige bag, 1 wavy beige bag, 4 light green bags. +clear black bags contain 1 dull tomato bag. +muted coral bags contain 5 drab indigo bags. +plaid magenta bags contain 3 posh salmon bags. +clear tomato bags contain 5 dotted brown bags, 3 dim tomato bags, 3 drab brown bags. +clear yellow bags contain 3 clear black bags, 2 mirrored black bags. +dark gray bags contain 5 light bronze bags, 4 dotted coral bags, 4 dim chartreuse bags. +light magenta bags contain 4 wavy turquoise bags, 1 mirrored green bag, 2 plaid chartreuse bags. +shiny indigo bags contain 1 bright silver bag, 2 pale tomato bags, 4 light teal bags, 4 posh coral bags. +muted gray bags contain 3 faded beige bags, 1 dark teal bag, 3 muted violet bags, 3 muted white bags. +wavy lavender bags contain 1 clear chartreuse bag, 2 clear maroon bags, 5 dull plum bags. +faded olive bags contain 4 mirrored yellow bags, 4 vibrant tomato bags, 5 muted olive bags. +muted crimson bags contain 1 mirrored gray bag, 4 dim violet bags. +drab chartreuse bags contain 1 pale olive bag, 1 vibrant plum bag. +wavy cyan bags contain 2 mirrored coral bags. +mirrored plum bags contain 3 bright turquoise bags, 3 dark beige bags, 4 mirrored beige bags. +plaid lavender bags contain 1 drab white bag. +muted gold bags contain 1 clear black bag, 2 light orange bags, 4 dotted red bags, 4 dull silver bags. +faded bronze bags contain 4 posh plum bags. +clear turquoise bags contain 1 light gold bag, 1 clear beige bag, 2 striped chartreuse bags. +vibrant gray bags contain 1 plaid white bag. +bright tan bags contain 3 drab silver bags, 2 faded yellow bags, 2 bright green bags. +pale bronze bags contain 5 posh coral bags, 4 clear coral bags, 1 dotted orange bag, 4 wavy chartreuse bags. +clear plum bags contain 1 dim plum bag, 4 light gold bags. +posh turquoise bags contain 3 wavy bronze bags, 4 shiny purple bags. +posh teal bags contain 2 striped magenta bags, 3 dark magenta bags, 5 faded silver bags, 5 mirrored chartreuse bags. +dim yellow bags contain 4 pale bronze bags, 3 shiny tan bags. +faded lavender bags contain 3 dull white bags, 3 striped teal bags. +wavy magenta bags contain 2 pale aqua bags, 4 shiny indigo bags. +dim brown bags contain 2 bright brown bags, 3 striped chartreuse bags, 5 dull purple bags, 1 light cyan bag. +light lime bags contain 5 clear crimson bags, 4 plaid indigo bags, 1 pale silver bag. +striped silver bags contain 3 posh green bags, 3 muted violet bags, 1 drab green bag. +bright brown bags contain no other bags. +vibrant fuchsia bags contain 4 dull olive bags, 2 mirrored gold bags, 3 mirrored bronze bags, 1 posh crimson bag. +plaid purple bags contain 3 faded beige bags, 1 drab green bag, 2 striped chartreuse bags. +wavy violet bags contain 2 vibrant gray bags, 5 wavy fuchsia bags. +dark maroon bags contain 5 pale chartreuse bags, 5 striped brown bags. +pale coral bags contain 3 vibrant plum bags. +dark black bags contain 4 striped salmon bags, 4 dim bronze bags. +plaid bronze bags contain 2 mirrored black bags, 1 drab bronze bag, 4 plaid purple bags, 5 dull tomato bags. +faded orange bags contain 5 plaid indigo bags. +light lavender bags contain 2 shiny magenta bags, 5 dim lavender bags, 1 dotted crimson bag. +dull chartreuse bags contain 4 clear lime bags. +dark gold bags contain 4 light magenta bags. +dim black bags contain 4 shiny silver bags, 1 dull tomato bag. +plaid salmon bags contain 3 light magenta bags, 4 dull fuchsia bags, 2 striped salmon bags. +vibrant bronze bags contain 5 mirrored white bags, 1 dull coral bag. +wavy brown bags contain 1 light gold bag, 4 drab purple bags, 3 muted violet bags, 4 muted fuchsia bags. +dotted lavender bags contain 4 dotted indigo bags, 2 dull lavender bags. +dotted gold bags contain 1 posh magenta bag, 2 posh yellow bags. +faded brown bags contain 4 muted blue bags, 3 wavy teal bags. +light yellow bags contain 3 clear black bags, 1 dotted crimson bag. +striped salmon bags contain 1 dull yellow bag, 5 mirrored gray bags, 5 light lavender bags, 5 mirrored brown bags. +light blue bags contain 5 mirrored purple bags, 3 dim violet bags, 2 pale tomato bags. +faded gold bags contain 3 plaid gray bags. +shiny aqua bags contain 1 striped crimson bag, 5 pale black bags. +shiny lime bags contain 4 dark green bags. +vibrant tan bags contain 3 clear silver bags, 3 pale white bags. +vibrant aqua bags contain no other bags. +vibrant teal bags contain 3 wavy tan bags. +light maroon bags contain 3 vibrant silver bags. +faded crimson bags contain 3 plaid red bags. +light teal bags contain 2 dark teal bags, 1 faded beige bag, 4 dull cyan bags. +mirrored coral bags contain 2 vibrant plum bags. +muted black bags contain 2 drab magenta bags, 1 mirrored gray bag, 4 drab tan bags, 1 dim indigo bag. +striped gold bags contain 1 dark lavender bag, 4 drab brown bags, 2 bright silver bags, 2 striped teal bags. +light purple bags contain 3 posh gray bags. +dull silver bags contain 2 clear chartreuse bags, 3 plaid silver bags, 1 drab salmon bag, 2 wavy teal bags. +clear bronze bags contain 4 dull red bags. +wavy yellow bags contain 3 dull tomato bags, 2 posh green bags, 4 plaid aqua bags, 2 faded purple bags. +muted purple bags contain 5 pale black bags, 2 muted salmon bags, 2 muted yellow bags. +plaid aqua bags contain no other bags. +drab plum bags contain 3 drab turquoise bags. +muted orange bags contain 1 faded blue bag, 5 plaid brown bags, 4 mirrored chartreuse bags. +dim silver bags contain 4 dark fuchsia bags, 2 clear cyan bags, 2 dark green bags, 4 dotted silver bags. +pale tan bags contain 5 shiny silver bags, 5 drab indigo bags. +wavy tomato bags contain 4 clear black bags, 4 plaid gray bags. +posh bronze bags contain 4 drab green bags. +clear blue bags contain 3 bright brown bags, 5 dull tomato bags, 1 clear black bag, 5 bright violet bags. +striped plum bags contain 4 plaid yellow bags, 3 dark teal bags, 2 mirrored lavender bags, 1 dotted salmon bag. +muted salmon bags contain 1 dull cyan bag, 2 clear coral bags, 1 posh coral bag. +light aqua bags contain 4 clear maroon bags, 4 striped black bags. +bright blue bags contain 4 drab violet bags, 4 light indigo bags, 3 muted indigo bags. +light brown bags contain 5 striped lavender bags. +light salmon bags contain 1 drab beige bag, 5 faded orange bags, 4 plaid coral bags, 5 light chartreuse bags. +posh beige bags contain 1 shiny red bag. +dotted orange bags contain 2 dotted brown bags, 3 mirrored silver bags, 1 dull tomato bag. +wavy purple bags contain 1 mirrored green bag, 1 clear maroon bag. +dark coral bags contain 5 bright chartreuse bags, 4 clear lime bags. +dim lime bags contain 3 bright olive bags, 3 dull gold bags. +pale plum bags contain 1 light orange bag, 3 drab orange bags, 5 mirrored purple bags. +dim beige bags contain 5 pale fuchsia bags, 4 mirrored fuchsia bags, 4 plaid teal bags, 1 shiny orange bag. +drab tan bags contain 5 plaid silver bags, 3 muted crimson bags, 1 clear salmon bag. +posh blue bags contain 4 plaid aqua bags, 2 drab salmon bags, 4 pale teal bags, 2 drab gold bags. +drab violet bags contain 3 shiny white bags. +shiny plum bags contain 3 mirrored green bags, 2 dark yellow bags, 3 pale salmon bags. +pale fuchsia bags contain 5 faded violet bags. +clear fuchsia bags contain 2 dark lavender bags, 3 posh green bags. +mirrored lime bags contain 3 light bronze bags. +plaid white bags contain 1 dim lavender bag, 4 dim olive bags, 3 clear yellow bags. +striped violet bags contain 4 plaid plum bags, 3 plaid black bags, 4 pale teal bags, 5 wavy magenta bags. +dark purple bags contain 2 shiny gold bags, 3 faded blue bags. +mirrored blue bags contain 1 drab fuchsia bag, 4 posh white bags, 3 wavy red bags. +pale black bags contain 2 dim olive bags, 5 bright brown bags. +dark brown bags contain 5 dotted purple bags, 2 striped silver bags. +muted lavender bags contain 3 posh brown bags, 2 clear yellow bags, 3 posh coral bags, 1 shiny tan bag. +muted bronze bags contain 1 drab teal bag, 5 drab tomato bags, 1 drab magenta bag, 5 posh maroon bags. +posh violet bags contain 5 bright white bags, 5 vibrant tan bags. +clear green bags contain 3 mirrored silver bags, 2 dotted orange bags. +dotted plum bags contain 3 plaid yellow bags, 1 wavy yellow bag, 1 drab cyan bag. +drab olive bags contain 1 shiny indigo bag. +wavy turquoise bags contain 3 muted yellow bags. +dark violet bags contain 2 bright crimson bags, 4 bright fuchsia bags, 2 dull blue bags. +posh gold bags contain 3 drab teal bags. +dim cyan bags contain 5 clear olive bags, 4 bright turquoise bags, 1 pale gray bag. +posh red bags contain 1 bright salmon bag. +dull tan bags contain 4 plaid cyan bags. +faded indigo bags contain 3 light gold bags, 5 dotted brown bags, 3 dotted cyan bags, 2 drab teal bags. +clear violet bags contain 1 wavy turquoise bag, 1 vibrant chartreuse bag, 1 dark violet bag, 3 bright bronze bags. +clear indigo bags contain 1 mirrored tan bag, 4 faded indigo bags. +bright turquoise bags contain 1 drab teal bag, 4 dull salmon bags, 4 pale olive bags, 2 faded chartreuse bags. +muted tomato bags contain 1 dark purple bag, 3 striped tan bags. +posh silver bags contain 4 muted gray bags. +mirrored olive bags contain 5 bright lavender bags, 2 clear blue bags, 5 dotted crimson bags, 5 pale black bags. +shiny tomato bags contain 1 mirrored purple bag, 4 posh gold bags, 3 vibrant plum bags. +striped coral bags contain 5 clear orange bags, 3 muted coral bags, 4 bright green bags, 1 clear chartreuse bag. +mirrored chartreuse bags contain 4 clear blue bags. +pale maroon bags contain 1 muted indigo bag. +striped black bags contain 3 striped gray bags, 1 striped lime bag, 4 bright cyan bags, 4 light orange bags. +dim maroon bags contain 4 dull cyan bags. +bright beige bags contain 2 pale fuchsia bags, 5 vibrant beige bags, 1 light lavender bag. +shiny gray bags contain 2 striped lime bags, 1 pale black bag, 4 wavy tomato bags, 2 vibrant brown bags. +drab lime bags contain 5 muted bronze bags, 2 posh indigo bags. +dull gray bags contain 2 dull plum bags, 4 dim white bags, 2 shiny purple bags. +light olive bags contain 4 clear salmon bags, 1 dim indigo bag. +vibrant violet bags contain 5 striped tan bags, 1 pale lime bag, 4 posh plum bags, 4 mirrored black bags. +posh lavender bags contain 4 pale tomato bags. +plaid coral bags contain 3 mirrored olive bags, 2 muted black bags, 3 light plum bags. +vibrant blue bags contain 4 mirrored silver bags. +dim aqua bags contain 5 dim maroon bags. +wavy bronze bags contain 5 wavy plum bags, 1 bright cyan bag, 2 drab chartreuse bags. +muted plum bags contain 3 plaid silver bags, 5 faded black bags, 3 drab maroon bags. +dull turquoise bags contain 4 plaid silver bags. +plaid blue bags contain 3 plaid purple bags. +dotted tan bags contain 5 plaid chartreuse bags, 4 dotted coral bags, 4 posh green bags, 1 striped turquoise bag. +plaid black bags contain 2 drab salmon bags, 5 posh maroon bags. +light cyan bags contain 2 dotted orange bags, 5 drab green bags, 1 bright lavender bag. +dull fuchsia bags contain 2 posh red bags, 4 mirrored beige bags, 2 dull salmon bags, 4 striped purple bags. +dark turquoise bags contain 4 drab tomato bags, 3 dotted chartreuse bags, 5 muted salmon bags, 4 posh magenta bags. +vibrant silver bags contain 3 dark brown bags, 2 wavy beige bags, 5 dull turquoise bags, 2 drab tan bags. +dotted tomato bags contain 3 drab tan bags, 2 striped magenta bags, 5 dim violet bags, 4 wavy tomato bags. +vibrant white bags contain 5 bright crimson bags, 2 mirrored white bags, 5 mirrored indigo bags, 4 wavy teal bags. +shiny fuchsia bags contain 1 pale lime bag. +wavy fuchsia bags contain 4 clear cyan bags. +dotted gray bags contain 3 striped chartreuse bags, 1 dark fuchsia bag. +bright tomato bags contain 4 wavy orange bags, 2 dotted salmon bags, 1 striped gray bag, 3 pale tomato bags. +clear chartreuse bags contain 3 clear purple bags. +dim teal bags contain 3 faded silver bags, 5 vibrant silver bags, 2 wavy fuchsia bags. +dotted yellow bags contain 5 bright bronze bags, 4 drab teal bags. +dark indigo bags contain 5 plaid red bags, 5 dim purple bags. +wavy black bags contain 5 shiny tomato bags, 2 clear gray bags, 4 dim lavender bags, 3 clear blue bags. +striped green bags contain 3 light crimson bags, 5 mirrored cyan bags, 2 mirrored maroon bags, 2 faded yellow bags. +dull lime bags contain 3 pale yellow bags. +faded chartreuse bags contain 2 wavy teal bags, 3 dim olive bags, 2 dull purple bags, 5 vibrant plum bags. +dark yellow bags contain 2 muted brown bags. +plaid beige bags contain 3 pale green bags, 3 bright purple bags, 5 faded black bags, 1 drab brown bag. +faded maroon bags contain 5 drab tomato bags. +muted silver bags contain 3 striped lime bags, 3 dim orange bags, 3 muted aqua bags, 1 plaid black bag. +pale violet bags contain 1 mirrored gray bag, 1 dull gold bag, 1 wavy crimson bag, 1 pale magenta bag. +dim olive bags contain no other bags. +mirrored bronze bags contain 2 drab white bags. +dull green bags contain 1 striped silver bag, 2 bright orange bags, 4 dull yellow bags, 4 dotted chartreuse bags. +bright gray bags contain 1 striped gray bag, 5 dull teal bags, 4 light beige bags, 2 vibrant orange bags. +light indigo bags contain 1 dim maroon bag, 4 dark indigo bags, 1 dark brown bag, 2 muted beige bags. +bright magenta bags contain 2 muted lime bags. +posh crimson bags contain 4 pale indigo bags, 2 faded green bags. +vibrant plum bags contain 1 posh gray bag, 3 mirrored silver bags, 4 bright brown bags, 2 posh magenta bags. +wavy lime bags contain 4 wavy black bags, 4 shiny cyan bags, 5 striped aqua bags, 4 plaid gray bags. +shiny silver bags contain 5 dotted crimson bags, 2 wavy turquoise bags, 1 shiny coral bag. +dark tan bags contain 5 clear silver bags. +mirrored brown bags contain 1 dotted brown bag, 2 plaid gray bags, 5 dull tomato bags, 5 clear black bags. +muted brown bags contain 3 drab magenta bags, 4 plaid aqua bags, 5 dim black bags. +posh black bags contain 2 bright turquoise bags, 3 mirrored maroon bags, 1 dull white bag. +wavy aqua bags contain 3 drab green bags, 3 clear magenta bags. +vibrant chartreuse bags contain 3 muted violet bags. +wavy silver bags contain 2 muted yellow bags, 4 plaid violet bags. +shiny salmon bags contain 1 clear yellow bag. +clear purple bags contain 2 posh green bags, 2 muted gray bags. +clear cyan bags contain 5 posh gray bags, 5 plaid aqua bags, 1 wavy tomato bag, 1 dim lavender bag. +wavy coral bags contain 5 dim yellow bags, 3 clear yellow bags. +wavy green bags contain 4 plaid bronze bags, 4 dull coral bags. +mirrored gold bags contain 5 bright lavender bags. +muted fuchsia bags contain 1 dotted purple bag. +clear maroon bags contain 3 muted gray bags, 2 bright chartreuse bags, 3 dotted gold bags. +faded salmon bags contain 5 clear green bags. +striped aqua bags contain 5 pale yellow bags, 1 dotted salmon bag, 1 wavy teal bag, 1 muted yellow bag. +plaid fuchsia bags contain 2 dim olive bags. +pale chartreuse bags contain 3 posh magenta bags, 3 mirrored yellow bags. +shiny beige bags contain 1 mirrored indigo bag. +posh aqua bags contain 3 pale silver bags, 3 shiny tan bags, 5 striped blue bags, 5 dull salmon bags. +dull magenta bags contain 5 dotted lime bags, 4 bright plum bags, 5 vibrant turquoise bags. +posh tomato bags contain 5 shiny tan bags, 1 wavy salmon bag. +clear red bags contain 5 clear black bags. +dotted aqua bags contain 1 clear black bag. +clear olive bags contain 1 plaid gray bag, 3 clear cyan bags. +dotted green bags contain 3 light red bags. +clear teal bags contain 5 faded coral bags, 3 wavy plum bags, 5 bright orange bags, 1 clear purple bag. +plaid orange bags contain 4 pale chartreuse bags, 1 dark silver bag, 2 drab tomato bags. +pale teal bags contain 1 drab black bag. +posh chartreuse bags contain 1 dotted gold bag, 4 bright salmon bags. +pale red bags contain 2 vibrant plum bags, 4 wavy cyan bags, 2 dotted white bags, 1 posh silver bag. +faded violet bags contain 1 mirrored white bag, 4 muted green bags, 5 mirrored olive bags, 1 dim brown bag. +faded fuchsia bags contain 2 dark brown bags. +dotted brown bags contain 4 clear blue bags. +dark teal bags contain 5 dull cyan bags. +bright salmon bags contain 2 pale black bags, 5 dotted chartreuse bags, 2 striped chartreuse bags. +pale blue bags contain 4 shiny gold bags, 2 clear white bags, 1 dotted coral bag. +dim tan bags contain 3 plaid yellow bags, 5 clear blue bags, 2 clear cyan bags. +dull beige bags contain 5 shiny maroon bags, 4 mirrored bronze bags, 4 dark plum bags. +clear magenta bags contain 5 dim bronze bags, 5 wavy olive bags. +bright black bags contain 2 bright bronze bags, 5 mirrored gold bags, 4 dark yellow bags. +muted aqua bags contain 2 dark teal bags. +faded blue bags contain 4 clear salmon bags, 1 light cyan bag, 5 wavy tomato bags. +dotted indigo bags contain 2 shiny maroon bags, 2 wavy tan bags, 4 dim tomato bags, 1 posh plum bag. +striped chartreuse bags contain 2 dotted orange bags, 3 bright lavender bags. +dim indigo bags contain 4 shiny coral bags, 4 mirrored olive bags. +dotted purple bags contain 4 mirrored white bags, 1 posh yellow bag, 5 drab maroon bags. +muted chartreuse bags contain 5 bright silver bags, 2 bright brown bags. +shiny purple bags contain 3 dim maroon bags, 2 mirrored lime bags, 2 light lavender bags, 3 dotted salmon bags. +faded white bags contain 3 vibrant white bags, 5 muted gray bags. +muted red bags contain 3 posh coral bags. +mirrored tan bags contain 1 dotted gold bag, 2 dark coral bags, 3 light purple bags. +dim blue bags contain 3 dull blue bags, 4 posh plum bags. +bright indigo bags contain 1 muted white bag, 1 wavy fuchsia bag. +striped crimson bags contain 3 dotted coral bags. +light orange bags contain 3 striped chartreuse bags, 4 bright silver bags, 5 clear cyan bags. +posh yellow bags contain 3 bright brown bags. +dotted beige bags contain 1 plaid red bag. +faded aqua bags contain 3 drab tan bags. +shiny red bags contain 3 striped lime bags, 5 wavy teal bags, 2 muted olive bags, 1 shiny chartreuse bag. +light tomato bags contain 4 muted green bags. +bright olive bags contain 4 shiny maroon bags, 1 striped tan bag, 2 drab teal bags, 3 mirrored chartreuse bags. +mirrored white bags contain 4 vibrant aqua bags, 4 clear blue bags, 4 bright violet bags, 1 muted olive bag. +posh olive bags contain 2 shiny maroon bags, 3 faded coral bags, 1 dark turquoise bag. +vibrant lime bags contain 1 light lime bag, 5 bright lime bags, 4 vibrant olive bags. +striped brown bags contain 3 clear chartreuse bags, 4 drab magenta bags. +striped lavender bags contain 1 wavy plum bag. +wavy white bags contain 4 dotted red bags. +dark bronze bags contain 2 posh green bags, 1 dotted crimson bag, 5 bright lavender bags, 1 shiny coral bag. +mirrored black bags contain 3 muted salmon bags. +shiny magenta bags contain 4 dotted orange bags, 4 bright silver bags, 3 posh coral bags. +light bronze bags contain 3 dotted coral bags. +mirrored gray bags contain 1 muted olive bag, 1 bright violet bag. +bright lavender bags contain 1 dull tomato bag, 2 clear blue bags. +drab yellow bags contain 3 dim tomato bags, 3 striped green bags. +dark chartreuse bags contain 5 vibrant violet bags, 4 shiny tan bags, 4 dark orange bags, 1 dull tan bag. +vibrant indigo bags contain 3 mirrored violet bags, 3 light teal bags, 2 dim red bags. +plaid green bags contain 3 wavy blue bags, 4 wavy yellow bags, 1 dull lavender bag. +mirrored purple bags contain 5 vibrant silver bags. +vibrant yellow bags contain 4 plaid brown bags, 3 drab bronze bags, 5 posh bronze bags, 3 mirrored lime bags. +pale gold bags contain 4 shiny indigo bags, 4 clear maroon bags. +shiny cyan bags contain 3 dim olive bags. +dim salmon bags contain 5 faded beige bags, 2 faded orange bags, 2 shiny purple bags. +dark crimson bags contain 3 dull aqua bags, 1 wavy olive bag, 3 posh plum bags, 3 bright brown bags. +vibrant gold bags contain 3 wavy gray bags, 4 clear white bags, 1 faded salmon bag, 3 drab aqua bags. +faded magenta bags contain 5 plaid aqua bags, 4 faded purple bags, 5 wavy bronze bags. +drab black bags contain 3 pale aqua bags, 2 clear coral bags, 2 mirrored silver bags, 5 dark cyan bags. +bright green bags contain 1 shiny aqua bag, 5 drab salmon bags, 5 wavy tomato bags, 4 faded beige bags. +bright aqua bags contain 2 vibrant magenta bags, 3 dim indigo bags, 5 dark fuchsia bags. +pale olive bags contain 1 dotted brown bag. +mirrored fuchsia bags contain 1 dull brown bag, 3 light cyan bags. +mirrored red bags contain 3 plaid lavender bags. +wavy blue bags contain 5 wavy turquoise bags, 3 light green bags, 4 dim indigo bags, 3 posh coral bags. +clear silver bags contain 4 plaid gray bags. +muted white bags contain 2 dotted salmon bags, 4 mirrored white bags, 3 clear cyan bags, 2 muted chartreuse bags. +dim tomato bags contain 3 drab white bags, 1 posh gray bag, 3 dark cyan bags, 5 posh green bags. +drab beige bags contain 1 light orange bag, 3 bright salmon bags, 3 pale silver bags. +clear gold bags contain 2 vibrant white bags, 2 plaid yellow bags. +vibrant orange bags contain 5 muted chartreuse bags. +striped tan bags contain 1 wavy gold bag, 3 mirrored black bags, 1 shiny aqua bag, 5 vibrant red bags. +bright lime bags contain 4 dim indigo bags, 3 dull tomato bags. +bright red bags contain 5 drab magenta bags, 1 clear salmon bag. +vibrant green bags contain 4 plaid tomato bags. +light tan bags contain 5 muted green bags. +striped white bags contain 1 faded silver bag, 2 vibrant red bags. +dull violet bags contain 5 dull turquoise bags. +drab salmon bags contain 3 posh magenta bags, 1 dark teal bag. +mirrored cyan bags contain 2 dim violet bags, 1 plaid aqua bag, 1 vibrant blue bag, 1 posh magenta bag. +wavy teal bags contain 1 bright crimson bag, 2 light cyan bags, 4 striped silver bags. +vibrant purple bags contain 5 shiny magenta bags, 1 dotted orange bag, 2 wavy teal bags. +faded beige bags contain 1 posh green bag, 5 clear coral bags. +faded lime bags contain 1 wavy gray bag, 1 light orange bag, 5 clear bronze bags. +mirrored green bags contain 5 drab bronze bags, 3 muted violet bags, 1 clear blue bag. +light green bags contain 5 mirrored lavender bags, 3 drab gold bags. +pale crimson bags contain 3 pale chartreuse bags. +mirrored aqua bags contain 4 drab plum bags. +dull crimson bags contain 2 bright white bags, 5 drab olive bags, 5 pale salmon bags. +dull purple bags contain 1 posh magenta bag, 3 mirrored brown bags. +bright white bags contain 4 vibrant blue bags, 3 dull brown bags, 4 drab green bags. +drab indigo bags contain 2 bright salmon bags, 2 muted maroon bags, 2 clear gray bags. +striped fuchsia bags contain 2 drab gold bags, 4 mirrored white bags, 3 muted black bags, 1 dark teal bag. +dark tomato bags contain 3 muted fuchsia bags, 1 dotted lavender bag, 4 drab turquoise bags. +mirrored tomato bags contain 5 dark olive bags, 4 light black bags, 4 dark magenta bags. +dark plum bags contain 4 wavy yellow bags, 4 shiny salmon bags. +dark salmon bags contain 1 dim bronze bag, 4 pale indigo bags, 5 dotted chartreuse bags. +dotted lime bags contain 1 shiny brown bag, 3 faded lavender bags. +dark red bags contain 3 posh green bags, 1 vibrant bronze bag, 2 dull maroon bags. +dim lavender bags contain 2 dark turquoise bags. +striped cyan bags contain 1 clear chartreuse bag. +dull indigo bags contain 5 shiny brown bags. +faded green bags contain 1 drab maroon bag. +drab fuchsia bags contain 2 clear olive bags, 1 bright cyan bag. +drab gold bags contain 2 dull turquoise bags, 5 dim lavender bags, 4 light teal bags. +dotted violet bags contain 3 drab tomato bags, 5 dark lavender bags, 4 bright fuchsia bags. +shiny turquoise bags contain 4 light black bags. +muted green bags contain 3 vibrant bronze bags, 4 dim olive bags, 2 posh yellow bags, 2 dull cyan bags. +pale purple bags contain 2 drab yellow bags, 3 bright crimson bags. +posh fuchsia bags contain 1 dull tan bag, 2 dim orange bags. +drab teal bags contain 1 dim violet bag, 2 drab green bags, 5 mirrored lavender bags, 2 faded purple bags. +mirrored teal bags contain 4 vibrant aqua bags, 2 dull turquoise bags, 4 vibrant bronze bags, 3 mirrored olive bags. +muted violet bags contain 3 wavy chartreuse bags. +mirrored salmon bags contain 3 clear cyan bags, 5 posh plum bags, 1 shiny coral bag. +vibrant crimson bags contain 4 dotted chartreuse bags, 2 wavy yellow bags, 3 drab green bags. +dotted teal bags contain 3 clear black bags, 1 faded blue bag, 1 clear beige bag, 4 striped brown bags. +posh orange bags contain 1 dim olive bag. +striped bronze bags contain 1 dull salmon bag, 4 wavy teal bags, 1 pale salmon bag, 2 dim aqua bags. +clear lime bags contain 1 dim lavender bag, 1 drab magenta bag. +muted magenta bags contain 1 shiny indigo bag, 4 mirrored cyan bags, 4 shiny cyan bags, 2 posh bronze bags. +bright chartreuse bags contain 5 drab white bags, 3 dotted purple bags. +dim magenta bags contain 2 dull turquoise bags, 1 dull coral bag, 3 dark violet bags, 4 muted crimson bags. +pale cyan bags contain 5 dotted coral bags, 4 drab chartreuse bags, 4 dull plum bags. +shiny white bags contain 2 drab salmon bags, 3 shiny silver bags. +faded tan bags contain 4 posh magenta bags, 1 pale teal bag. diff --git a/2020/day8.cpp b/2020/day8.cpp new file mode 100644 index 0000000..ad82b0f --- /dev/null +++ b/2020/day8.cpp @@ -0,0 +1,113 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +enum OpCode { Acc, Jmp, Nop }; +struct Op{ OpCode code; i32 num; }; +auto extract_op(const std::string & string) -> Op { + auto op = Op{ Nop, 0 }; + auto op_code_str = string.substr(0, 3); + if (string.substr(0, 3) == "acc") { op.code = Acc; } + else if (string.substr(0, 3) == "jmp") { op.code = Jmp; } + else if (string.substr(0, 3) == "nop") { op.code = Nop; } + + op.num = std::stoi(string.substr(4, string.size() - 4)); + + return op; +} + +struct State{ u32 isp; i32 acc; }; + +auto execute(State & state, const std::vector & ops) -> void { + switch (ops[state.isp].code) { + case Acc: state.acc += ops[state.isp].num; ++state.isp; break; + case Jmp: state.isp += ops[state.isp].num; break; + case Nop: ++state.isp; break; + } +} + +auto attempt_swap(State & state, std::vector & ops) -> bool { + if (ops[state.isp].code == Jmp) { + ops[state.isp].code = Nop; + } else if (ops[state.isp].code == Nop) { + ops[state.isp].code = Jmp; + } else { + return false; + } + + auto local_state = state; + auto executed = std::vector(ops.size()); + while (local_state.isp < ops.size() && !executed[local_state.isp]) { + executed[local_state.isp] = true; + execute(local_state, ops); + } + if (local_state.isp >= ops.size()) { + state = local_state; + return true; + } else if (ops[state.isp].code == Jmp) { + ops[state.isp].code = Nop; + } else if (ops[state.isp].code == Nop) { + ops[state.isp].code = Jmp; + } + + return false; +} + +auto main(i32 argc, char * argv[]) -> i32 { + auto ops = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("day8.input"); + while (getline(file, line)) { + ops.push_back(extract_op(line)); + } + } + + auto state = State{ 0, 0 }; + auto executed = std::vector(ops.size()); + while (!executed[state.isp]) { + executed[state.isp] = true; + execute(state, ops); + } + std::cout << state.acc << std::endl; + + state = State{ 0, 0 }; + while (state.isp < ops.size()) { + if (attempt_swap(state, ops)) { + std::cout << state.acc << std::endl; + break; + } + execute(state, ops); + } + + return 0; +} diff --git a/2020/day8.input b/2020/day8.input new file mode 100644 index 0000000..a348b44 --- /dev/null +++ b/2020/day8.input @@ -0,0 +1,610 @@ +acc +0 +jmp +516 +acc -16 +nop +326 +jmp +366 +jmp +400 +jmp +494 +acc -5 +jmp +475 +acc +29 +nop +24 +jmp +186 +jmp -5 +acc +50 +acc +49 +acc +49 +nop +507 +jmp +236 +acc -4 +acc +50 +acc +48 +jmp +293 +jmp +461 +acc +48 +acc +2 +jmp +241 +acc +38 +jmp +544 +jmp +1 +jmp +382 +acc -4 +acc -10 +acc +44 +jmp +444 +jmp +1 +acc +20 +acc -1 +acc +25 +jmp +332 +acc +18 +jmp +184 +acc +1 +acc +20 +acc -7 +acc -12 +jmp +84 +acc +30 +jmp -19 +nop +491 +acc +37 +acc +44 +jmp +220 +acc +3 +acc +19 +jmp +485 +jmp +222 +nop +264 +acc +4 +jmp +151 +nop -36 +acc +48 +jmp +356 +acc +28 +acc +29 +nop +397 +jmp +168 +nop +115 +acc -13 +acc -11 +jmp +470 +jmp +201 +acc +48 +acc -6 +acc -18 +acc -13 +jmp +442 +jmp +266 +acc +10 +acc +30 +acc -7 +acc -8 +jmp +380 +acc +1 +nop +106 +acc +9 +acc -11 +jmp -79 +jmp +166 +acc -9 +jmp +300 +acc +39 +acc +1 +acc +27 +acc +26 +jmp +367 +jmp +291 +acc +18 +jmp +100 +acc +25 +acc +43 +acc -8 +acc -12 +jmp +475 +acc +15 +jmp +492 +acc -5 +acc -12 +acc +35 +acc +25 +jmp +360 +nop +301 +acc +32 +acc -1 +jmp +436 +acc +21 +jmp +109 +acc +1 +nop +230 +jmp -113 +acc +24 +acc +12 +acc +13 +acc +27 +jmp -52 +jmp +476 +acc +15 +acc -18 +acc -13 +jmp +323 +acc -10 +acc +35 +acc -6 +nop +377 +jmp +8 +jmp +430 +nop +50 +acc +33 +acc -1 +jmp -72 +acc -19 +jmp -92 +jmp +1 +jmp -87 +nop -120 +nop -34 +jmp +159 +jmp +183 +jmp +1 +acc -4 +acc +49 +acc -4 +jmp +73 +acc -18 +acc +34 +acc -8 +jmp +403 +acc +32 +acc +0 +acc +0 +jmp +390 +acc +19 +jmp +305 +acc -15 +jmp +176 +acc +3 +jmp +36 +acc +29 +acc +21 +jmp +1 +acc -17 +jmp +144 +acc +16 +acc +4 +acc +49 +acc -7 +jmp -65 +acc +28 +acc +2 +acc +23 +acc +46 +jmp +278 +jmp +424 +acc +45 +acc +7 +jmp -49 +jmp -50 +acc -11 +nop -121 +jmp -140 +jmp +1 +acc -8 +jmp +206 +acc -7 +jmp +1 +acc +20 +acc +30 +jmp +375 +nop +312 +jmp +111 +acc +23 +jmp -15 +acc +27 +acc +46 +acc +36 +jmp +360 +acc +1 +acc +25 +acc +29 +jmp -137 +jmp +177 +acc +15 +acc -13 +acc +48 +acc +29 +jmp +76 +nop -174 +acc +27 +jmp +214 +acc +4 +jmp +120 +nop -165 +acc -16 +jmp +2 +jmp +238 +jmp +224 +jmp -154 +acc +12 +jmp +162 +acc +31 +acc +26 +acc -13 +acc +18 +jmp +173 +acc +38 +jmp +1 +jmp +199 +jmp -202 +jmp +127 +acc -12 +jmp -42 +acc -12 +acc +36 +acc -4 +acc +24 +jmp +343 +acc -17 +nop +277 +acc +13 +jmp +56 +jmp +41 +nop +92 +acc +32 +jmp +182 +nop +111 +acc +0 +acc +29 +jmp +219 +nop -234 +acc +0 +acc +31 +acc +49 +jmp +216 +jmp +247 +acc +24 +acc -10 +jmp +218 +acc +14 +acc -19 +acc +14 +jmp +11 +jmp +82 +acc +5 +acc +28 +acc +35 +jmp -93 +acc +24 +jmp -210 +acc +39 +jmp -107 +jmp -150 +acc -7 +jmp -185 +acc +25 +acc -15 +jmp +63 +acc +14 +acc +50 +jmp -7 +acc +13 +jmp +298 +nop +69 +jmp -268 +acc -5 +jmp +66 +jmp +48 +nop -1 +acc +38 +acc +3 +acc +46 +jmp +259 +nop +235 +acc +4 +jmp -186 +jmp +94 +acc -16 +acc +6 +jmp +287 +acc -19 +jmp -221 +jmp -69 +acc +8 +nop -102 +acc +31 +jmp +204 +jmp -81 +acc +12 +acc +21 +acc -8 +nop +151 +jmp -155 +acc +50 +nop +145 +acc -6 +acc +0 +jmp -296 +acc +16 +acc +30 +acc +11 +jmp +254 +acc +0 +acc -8 +nop +162 +acc -17 +jmp -144 +acc +6 +acc +2 +acc +32 +acc -5 +jmp +21 +jmp -77 +acc +38 +jmp +117 +acc +27 +acc -11 +nop -203 +jmp +201 +jmp -305 +acc +40 +nop -330 +acc -7 +jmp -279 +jmp +60 +nop -163 +jmp -53 +nop +115 +acc +24 +jmp +1 +acc +45 +jmp -92 +acc +0 +acc +13 +jmp -302 +acc +25 +jmp +208 +nop -293 +jmp +5 +jmp +1 +acc -13 +nop -272 +jmp +62 +acc -4 +acc +32 +acc +49 +jmp -124 +acc -19 +nop -246 +jmp -353 +nop -349 +acc +13 +acc +21 +jmp -165 +acc +14 +acc +37 +nop +28 +acc +7 +jmp -308 +acc +11 +jmp +71 +jmp -139 +nop -19 +acc -7 +acc -3 +jmp -302 +acc -2 +acc +1 +nop -43 +jmp -280 +acc +10 +acc +9 +jmp -358 +acc +39 +acc +16 +acc -11 +jmp +1 +jmp +142 +acc -15 +acc -17 +acc +9 +acc +11 +jmp -172 +jmp -90 +nop +135 +acc -1 +jmp -379 +acc +39 +acc -13 +jmp -57 +acc -3 +acc -7 +jmp +1 +jmp +80 +acc +7 +acc +11 +acc +30 +nop +69 +jmp -140 +acc +11 +acc +7 +acc +3 +jmp -417 +jmp -314 +acc -6 +jmp -6 +jmp -224 +acc +0 +jmp -131 +acc +7 +acc +33 +jmp +20 +acc +32 +acc -14 +nop -375 +jmp -394 +acc +8 +acc +47 +acc +29 +acc -6 +jmp -381 +acc -8 +jmp -353 +jmp -108 +acc -16 +acc +21 +jmp -329 +acc +13 +acc +0 +acc +0 +jmp -402 +acc -8 +jmp -307 +jmp -308 +jmp -358 +acc +38 +acc -19 +acc +33 +jmp -276 +jmp -114 +acc -6 +jmp +55 +acc +16 +jmp -244 +nop +22 +acc -7 +acc +19 +jmp -154 +jmp +18 +jmp -50 +acc +31 +acc +50 +acc +2 +jmp -260 +acc -16 +jmp -135 +acc +50 +acc -9 +acc +50 +acc +27 +jmp -323 +acc +26 +nop -249 +acc +46 +acc +3 +jmp -474 +acc +50 +acc -7 +jmp -78 +jmp +1 +acc -6 +acc +6 +jmp +94 +acc +47 +acc -3 +acc +13 +jmp -485 +nop -499 +acc +35 +acc +35 +acc -1 +jmp -259 +nop -486 +acc +48 +acc -4 +jmp +23 +acc +33 +acc +37 +acc +10 +jmp +61 +acc -1 +jmp +1 +jmp +1 +acc -8 +jmp +61 +jmp -237 +jmp -164 +acc +39 +acc +38 +nop -302 +jmp -468 +acc -15 +jmp -6 +acc -9 +acc +1 +acc +41 +acc +48 +jmp -285 +acc +1 +acc +24 +jmp -111 +jmp -90 +acc +46 +acc +21 +acc +43 +jmp -103 +acc -9 +nop -5 +jmp -274 +acc -13 +jmp -262 +jmp -39 +acc +43 +nop -463 +acc +15 +acc +23 +jmp -176 +nop -305 +acc +2 +acc +28 +jmp -198 +acc +15 +acc -18 +jmp -473 +acc -13 +acc +9 +jmp -46 +acc +1 +acc +43 +acc +6 +jmp +10 +acc +24 +acc -3 +jmp -424 +acc -1 +acc +47 +jmp +1 +acc +20 +jmp -17 +jmp -59 +nop -19 +acc +42 +acc +47 +jmp -9 +jmp -576 +nop -148 +acc +0 +jmp +12 +acc -15 +jmp -209 +acc +13 +jmp -442 +nop -548 +nop -62 +acc +22 +jmp -92 +jmp -516 +acc +8 +jmp -301 +acc +1 +jmp -146 +acc -15 +jmp -366 +jmp -440 +acc +17 +acc +25 +acc +28 +jmp -240 +acc -2 +acc +25 +nop -68 +acc +14 +jmp +1 From dd62e471fc3370cba5c35f1f92c7d0e005d866b3 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Tue, 8 Dec 2020 10:08:19 -0800 Subject: [PATCH 21/52] Updated day8 so it's not reliant on all op codes being 3 chars long --- 2020/day8.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2020/day8.cpp b/2020/day8.cpp index ad82b0f..1b389d2 100644 --- a/2020/day8.cpp +++ b/2020/day8.cpp @@ -40,7 +40,7 @@ auto extract_op(const std::string & string) -> Op { else if (string.substr(0, 3) == "jmp") { op.code = Jmp; } else if (string.substr(0, 3) == "nop") { op.code = Nop; } - op.num = std::stoi(string.substr(4, string.size() - 4)); + op.num = std::stoi(string.substr(string.find(" ") + 1, string.size() - 4)); return op; } From eb3cce2ccfa22a8f6e8717d6a7235e87dc6273cf Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Tue, 8 Dec 2020 10:08:19 -0800 Subject: [PATCH 22/52] Updated day8 so it's not reliant on all op codes being 3 chars long --- 2020/day8.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2020/day8.cpp b/2020/day8.cpp index ad82b0f..1b389d2 100644 --- a/2020/day8.cpp +++ b/2020/day8.cpp @@ -40,7 +40,7 @@ auto extract_op(const std::string & string) -> Op { else if (string.substr(0, 3) == "jmp") { op.code = Jmp; } else if (string.substr(0, 3) == "nop") { op.code = Nop; } - op.num = std::stoi(string.substr(4, string.size() - 4)); + op.num = std::stoi(string.substr(string.find(" ") + 1, string.size() - 4)); return op; } From 14e6266b5fd4107d1aba9e95234275fdc54e1a56 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Wed, 9 Dec 2020 21:38:13 -0800 Subject: [PATCH 23/52] Completed day 10 --- 2020/day10.cpp | 76 ++++ 2020/day10.input | 96 +++++ 2020/day9.cpp | 88 ++++ 2020/day9.input | 1000 +++++++++++++++++++++++++++++++++++++++++++++ 2020/template.cpp | 2 +- 5 files changed, 1261 insertions(+), 1 deletion(-) create mode 100644 2020/day10.cpp create mode 100644 2020/day10.input create mode 100644 2020/day9.cpp create mode 100644 2020/day9.input diff --git a/2020/day10.cpp b/2020/day10.cpp new file mode 100644 index 0000000..9f6fab4 --- /dev/null +++ b/2020/day10.cpp @@ -0,0 +1,76 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +struct Pair { + u64 jolt; + u64 count; +}; + +auto operator<(const Pair & left, const Pair & right) -> bool { + return left.jolt < right.jolt; +} + +auto main(i32 argc, char * argv[]) -> i32 { + auto jolts = std::vector{{ 0, 1 }}; + { + auto line = std::string(); + auto file = std::ifstream("day10.input"); + while (getline(file, line)) { + jolts.push_back({ (u64) std::stoll(line), 0 }); + } + } + std::sort(jolts.begin(), jolts.end()); + jolts.push_back({ jolts[jolts.size() - 1].jolt + 3, 0 }); + + auto dif1 = usize(0); + auto dif3 = usize(0); + for (auto i = usize(0); i < jolts.size() - 1; ++i) { + if (jolts[i + 1].jolt - jolts[i].jolt == 1) ++dif1; + else if (jolts[i + 1].jolt - jolts[i].jolt == 3) ++dif3; + } + + std::cout << (dif1 * dif3) << std::endl; + + for (auto i = i32(0); i < jolts.size() - 1; ++i) { + for (auto j = i + 1; j < jolts.size(); ++j) { + if (jolts[j].jolt <= jolts[i].jolt + 3) { + jolts[j].count += jolts[i].count; + } else { + break; + } + } + } + std::cout << jolts[jolts.size() - 1].count << std::endl; + + return 0; +} diff --git a/2020/day10.input b/2020/day10.input new file mode 100644 index 0000000..526a28e --- /dev/null +++ b/2020/day10.input @@ -0,0 +1,96 @@ +133 +157 +39 +74 +108 +136 +92 +55 +86 +46 +111 +58 +80 +115 +84 +67 +98 +30 +40 +61 +71 +114 +17 +9 +123 +142 +49 +158 +107 +139 +104 +132 +155 +96 +91 +15 +11 +23 +54 +6 +63 +126 +3 +10 +116 +87 +68 +72 +109 +62 +134 +103 +1 +16 +101 +117 +35 +120 +151 +102 +85 +145 +135 +79 +2 +147 +33 +41 +93 +52 +48 +64 +81 +29 +20 +110 +129 +43 +148 +36 +53 +26 +42 +156 +154 +77 +88 +73 +27 +34 +12 +146 +78 +47 +28 +97 diff --git a/2020/day9.cpp b/2020/day9.cpp new file mode 100644 index 0000000..1668fd5 --- /dev/null +++ b/2020/day9.cpp @@ -0,0 +1,88 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +auto find_sum(usize index, std::vector xmas) { + for (auto i = index - 25; i < index - 1; ++i) { + for (auto j = i + 1; j < index; ++j) { + if (xmas[i] + xmas[j] == xmas[index]) { + return true; + } + } + } + return false; +} + +auto main(i32 argc, char * argv[]) -> i32 { + auto xmas = std::vector(); + auto line = std::string(); + auto file = std::ifstream("day9.input"); + while (getline(file, line)) { + xmas.push_back(std::stoll(line)); + } + + auto invalid = u64(0); + for (auto i = usize(25); i < xmas.size(); ++i) { + if (!find_sum(i, xmas)) { + std::cout << (invalid = xmas[i]) << std::endl; + break; + } + } + + auto head_index = 0; + auto tail_index = 1; + auto sum = xmas[0] + xmas[1]; + while (sum != invalid) { + if (sum < invalid) { + sum += xmas[++tail_index]; + } else if (head_index + 1 < tail_index) { + sum -= xmas[head_index]; + ++head_index; + } else { + head_index = tail_index + 1; + tail_index = head_index + 1; + sum = xmas[head_index] + xmas[tail_index]; + } + } + auto min = xmas[tail_index]; + auto max = xmas[tail_index]; + for (auto i = head_index; i < tail_index; ++i) { + if (xmas[i] < min) { + min = xmas[i]; + } else if (xmas[i] > max) { + max = xmas[i]; + } + } + std::cout << (min + max) << std::endl; + + return 0; +} diff --git a/2020/day9.input b/2020/day9.input new file mode 100644 index 0000000..ea99600 --- /dev/null +++ b/2020/day9.input @@ -0,0 +1,1000 @@ +8 +11 +27 +48 +5 +19 +18 +36 +3 +45 +22 +37 +46 +4 +31 +42 +39 +30 +41 +14 +40 +29 +43 +25 +6 +7 +28 +8 +52 +9 +49 +13 +20 +34 +10 +11 +12 +17 +15 +18 +53 +21 +16 +26 +19 +14 +54 +39 +22 +23 +24 +25 +27 +28 +29 +80 +33 +35 +30 +31 +72 +32 +34 +36 +37 +38 +48 +60 +47 +51 +41 +45 +49 +67 +50 +64 +62 +77 +57 +65 +66 +68 +71 +107 +108 +69 +70 +119 +73 +94 +79 +117 +86 +88 +90 +133 +202 +99 +116 +141 +122 +148 +218 +223 +131 +134 +137 +139 +258 +142 +155 +143 +152 +161 +263 +259 +219 +174 +178 +189 +420 +215 +221 +238 +261 +253 +393 +265 +440 +270 +271 +311 +482 +285 +294 +443 +295 +313 +335 +389 +367 +352 +363 +663 +810 +491 +526 +459 +572 +712 +629 +535 +565 +541 +660 +556 +832 +580 +579 +589 +648 +702 +1351 +687 +715 +1000 +811 +952 +1907 +950 +1239 +1031 +1145 +1161 +1076 +1258 +1204 +1515 +1121 +1135 +1530 +1159 +1168 +1276 +1237 +1335 +1389 +1402 +1498 +1526 +1761 +1763 +1902 +1981 +2026 +2917 +2363 +2289 +2197 +2211 +2833 +2724 +3546 +2327 +2294 +2396 +3448 +2557 +4275 +3096 +2737 +2791 +3024 +3259 +3960 +3524 +4159 +3883 +4007 +5811 +4408 +4486 +4500 +4491 +4505 +8434 +5118 +4621 +4690 +4851 +5844 +5815 +5348 +6120 +5528 +7683 +6283 +7750 +8697 +7407 +7531 +7890 +9029 +10971 +8894 +10876 +8991 +9112 +8996 +10349 +9472 +9311 +9541 +10038 +10199 +11468 +11163 +11811 +18423 +14519 +13690 +18089 +20474 +17756 +16919 +15421 +20057 +17885 +18435 +17890 +17987 +18103 +18653 +18537 +24557 +29914 +30609 +19579 +25459 +21362 +22631 +45516 +25501 +31446 +28209 +29111 +33856 +32340 +38116 +33306 +33311 +35877 +36325 +66325 +35993 +36756 +43562 +43094 +50877 +53668 +65302 +40941 +46821 +43993 +54673 +86119 +73725 +69299 +61451 +57320 +62417 +69096 +88993 +71422 +105176 +69188 +79087 +72318 +79555 +80749 +105550 +131605 +84035 +126508 +116120 +119737 +84934 +106410 +133839 +205113 +118771 +123868 +126416 +141972 +141504 +143740 +138284 +140610 +151873 +159836 +148275 +151405 +188438 +164489 +164784 +224645 +283704 +283555 +409971 +191344 +246153 +203705 +278607 +311709 +262511 +242639 +250284 +264700 +316189 +500147 +372920 +278894 +288885 +342749 +299680 +453989 +355833 +329273 +356128 +368489 +395049 +433983 +437497 +618639 +441628 +446344 +564380 +579557 +492923 +539169 +615869 +711238 +543594 +762533 +567779 +578574 +588565 +642429 +962828 +628953 +790111 +685106 +935685 +1369668 +763538 +1122603 +871480 +930420 +1372048 +887972 +1958233 +1057303 +1032092 +1036517 +1082763 +1111373 +1966937 +2045591 +1357890 +1146353 +2179906 +1217518 +1271382 +1850800 +1392491 +1475217 +2034920 +1699223 +2629272 +1635018 +2586590 +2735740 +3015536 +3669938 +1920064 +2119280 +2068609 +3091714 +2147890 +2194136 +2257726 +2363871 +2417735 +5273262 +2488900 +3395281 +3885720 +2663873 +4714759 +2867708 +3110235 +6634823 +3334241 +3555082 +4557509 +5509449 +5755587 +5178844 +4114200 +3988673 +4326335 +5061844 +4342026 +4405616 +6201949 +5972817 +4852771 +4906635 +5152773 +6043982 +8240876 +6665317 +5531581 +6422790 +9744260 +6444476 +8440535 +7448441 +9258387 +8102873 +8315008 +11222826 +8330699 +12510285 +9050517 +8668361 +8747642 +9194797 +9558389 +10005544 +9759406 +10950617 +10059408 +10684354 +18807050 +11954371 +11976057 +15981179 +16503884 +14759484 +14547349 +15551314 +15763449 +17942439 +16417881 +16645707 +16999060 +24298956 +19764950 +17416003 +18306031 +18753186 +18954203 +20509006 +29437540 +21735463 +20743762 +26665533 +25443838 +40716837 +23930428 +26735541 +29306833 +48060019 +30098663 +34415063 +39677902 +33063588 +33416941 +37059217 +33644767 +35305091 +46853543 +35722034 +36370206 +37260234 +37707389 +39463209 +42244469 +54881378 +42479225 +44674190 +60082474 +49374266 +50665969 +53237261 +56042374 +68722032 +63515604 +63162251 +66480529 +76723443 +70677175 +69138975 +68949858 +69366801 +71027125 +86918659 +72092240 +82381579 +74967623 +77170598 +107836441 +98521599 +102561699 +95340159 +123244725 +114181573 +100040235 +103903230 +123914436 +126677855 +139976983 +197704980 +164706960 +139816150 +167432399 +141231215 +213596514 +143119365 +140393926 +145994748 +147059863 +152138221 +172510757 +238915525 +216986748 +193861758 +195380394 +268610190 +199243389 +246034983 +230581085 +226718090 +227817666 +250592291 +346303252 +279793133 +291954371 +280210076 +465633615 +281625141 +315630122 +283513291 +409004116 +345999979 +341375142 +299198084 +367891151 +485596938 +477375049 +514645173 +422098484 +394623783 +425961479 +458398751 +454535756 +992020222 +477310381 +591967433 +530385424 +560003209 +923649289 +573579512 +565138432 +580823225 +774028873 +760823672 +582711375 +721296568 +640573226 +667089235 +693821867 +907695422 +1506360664 +816722267 +871934164 +820585262 +1008672854 +880497235 +1023537183 +756008079 +1334403184 +1007695805 +1090388633 +1095523856 +1125141641 +1138717944 +1145961657 +1223284601 +2108432057 +1249800610 +1276533242 +1307662461 +1334395093 +2090411263 +1360911102 +1449829946 +1572730346 +2181496364 +1828281067 +1576593341 +1966546919 +1636505314 +1763703884 +1779545262 +1846396712 +2098084438 +2132837446 +2271103298 +3404874408 +2263859585 +3401011413 +2369246258 +3540392827 +4477678315 +2849263588 +2584195703 +3274209380 +2937504443 +4977604754 +3730157360 +3022560292 +3416050576 +3213098655 +3340297225 +3356138603 +3400209198 +3482902026 +3610100596 +3912382708 +4369187736 +5638477265 +5484201953 +5113123173 +7376982758 +7769396934 +6477897270 +4953441961 +5433459291 +5606755995 +5960064735 +6740506423 +6211713823 +6150603098 +7391748028 +8824499178 +6235658947 +6966239199 +7395284734 +6696435828 +6839040629 +6883111224 +9025505881 +7522483304 +8281570444 +9322629697 +11104045059 +10066565134 +10386901252 +11040215286 +15800526967 +10560197956 +13201898146 +11393524026 +15804053748 +12110667833 +12362316921 +13033714322 +25126683445 +40930737193 +12932094775 +13074699576 +13535476457 +19916825546 +14405594528 +14361523933 +27436223509 +21483468590 +22643094377 +17604200141 +19389194831 +20453466386 +20626763090 +21953721982 +21600413242 +25564215067 +22922514877 +23504191859 +31139676598 +24472984754 +26610176033 +25294411696 +26006794351 +26467571232 +27293618708 +33988942843 +27480294104 +46682813539 +28767118461 +31965724074 +33750718764 +36993394972 +40015957921 +38230963231 +38057666527 +46190978157 +41080229476 +42227176332 +43554135224 +50479779105 +61469236947 +52474365583 +47977176613 +49767396450 +51766603462 +77773397813 +51301206047 +53300413059 +111949016052 +54773912812 +68959119046 +94701541915 +60732842535 +90495737026 +65716442838 +98790509062 +75051061499 +89783354371 +76288629758 +79137896003 +84634364700 +83307405808 +85781311556 +155503151276 +112034048582 +121433484629 +133074802258 +189286246088 +101068602497 +183424873762 +126352267546 +104601619106 +120490355650 +115506755347 +123733031858 +126449285373 +144040248343 +191795385105 +241923840279 +180206498500 +159685426199 +155426525761 +344789397364 +159596035566 +162445301811 +167941770508 +169088717364 +220108374453 +205670221603 +298931629109 +216575357844 +221558958147 +235997110997 +319281461765 +225091974756 +356487466647 +228334650964 +422245579447 +239239787205 +250182317231 +270489533716 +299466774104 +315022561327 +384004259958 +315111951960 +317871827572 +322041337377 +598398403213 +569421162825 +330387072319 +535130935780 +468020346473 +425778596056 +427229179750 +441667332600 +438134315991 +464331761961 +475236898202 +742341131710 +453426625720 +498824184680 +467574438169 +580569389550 +489422104436 +811463441813 +1002705373949 +614489335431 +645499024279 +632983779532 +757616252069 +820865522057 +652428409696 +863912912047 +890110358017 +910956461869 +865363495741 +853007775806 +1108220677734 +952250810400 +879801648591 +1082063773600 +917758387681 +1105855035416 +921001063889 +1113313520111 +1113073462448 +1353335016483 +1433577165356 +1103911439867 +1266917745127 +1247473114963 +1285412189228 +1516341321743 +1410044661765 +1532230058287 +1832052458991 +1505436185502 +2132281240868 +1718371271547 +1732809424397 +1745165144332 +1770766163487 +2360786635074 +1797560036272 +1800802712480 +2185975213467 +2030831850129 +2024912503756 +2331045725654 +2466408478931 +2360546577411 +2351384554830 +3234379877836 +2992638259295 +2980282539360 +2532885304191 +2695456850993 +3277395202619 +2915480847267 +3223807457049 +3238245609899 +3515931307819 +3463536415879 +3918784637864 +3530369460669 +3542725180604 +3568326199759 +3598362748752 +3822472540028 +7352842000697 +5567637684360 +4726288701122 +4355958229410 +5972920798655 +7084257507578 +4711931132241 +5448366151458 +5228342155184 +5513167843551 +5610937698260 +5756692761240 +7060718149927 +7111051380363 +6139288304316 +8175467548120 +9211166408554 +14439508563738 +10883190689955 +9209300447012 +7073094641273 +7141087929356 +8796668354943 +7420835288780 +8178430769438 +10337226399382 +11776793518190 +12301436796457 +9067889361651 +10160297283699 +10468623893481 +9940273287425 +10676708306642 +13932160309360 +11124105541811 +11367630459500 +11895981065556 +13250339684679 +15596302836900 +15251525410711 +14214182570629 +19265292248424 +25299790768860 +15319518698794 +18647054662919 +14493929930053 +14561923218136 +15599266058218 +20805850292863 +23190612972104 +20844682879841 +19744597668293 +26110163636185 +30161189276354 +20100570571124 +20408897180906 +28426090239413 +22491736001311 +23020086607367 +24617970144179 +26389910995609 +25146320750235 +29745455340764 +34584810947218 +29055853148189 +28708112500682 +29813448628847 +50154352521670 +34306520886429 +49464750329095 +60416684522614 +35699836629342 +35343863726511 +39845168239417 +40153494849199 +51446176846780 +70284647576560 +64330266287982 +59558903969611 +45246891321359 +46798808176515 +45511822608678 +47109706145490 +65299815599434 +85752697733209 +95666175130348 +94143714916829 +57763965648871 +114764565928529 +70006357515771 diff --git a/2020/template.cpp b/2020/template.cpp index eab58ce..51a940b 100644 --- a/2020/template.cpp +++ b/2020/template.cpp @@ -34,7 +34,7 @@ auto main(i32 argc, char * argv[]) -> i32 { { auto line = std::string(); - auto file = std::ifstream("day$NUM.input"); + auto file = std::ifstream("dayNUM.input"); while (getline(file, line)) { } From 8ec9377285b58e0ce58569094f79f21bd1102f25 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Wed, 9 Dec 2020 21:38:13 -0800 Subject: [PATCH 24/52] Completed day 10 --- 2020/day10.cpp | 76 ++++ 2020/day10.input | 96 +++++ 2020/day9.cpp | 88 ++++ 2020/day9.input | 1000 +++++++++++++++++++++++++++++++++++++++++++++ 2020/template.cpp | 2 +- 5 files changed, 1261 insertions(+), 1 deletion(-) create mode 100644 2020/day10.cpp create mode 100644 2020/day10.input create mode 100644 2020/day9.cpp create mode 100644 2020/day9.input diff --git a/2020/day10.cpp b/2020/day10.cpp new file mode 100644 index 0000000..9f6fab4 --- /dev/null +++ b/2020/day10.cpp @@ -0,0 +1,76 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +struct Pair { + u64 jolt; + u64 count; +}; + +auto operator<(const Pair & left, const Pair & right) -> bool { + return left.jolt < right.jolt; +} + +auto main(i32 argc, char * argv[]) -> i32 { + auto jolts = std::vector{{ 0, 1 }}; + { + auto line = std::string(); + auto file = std::ifstream("day10.input"); + while (getline(file, line)) { + jolts.push_back({ (u64) std::stoll(line), 0 }); + } + } + std::sort(jolts.begin(), jolts.end()); + jolts.push_back({ jolts[jolts.size() - 1].jolt + 3, 0 }); + + auto dif1 = usize(0); + auto dif3 = usize(0); + for (auto i = usize(0); i < jolts.size() - 1; ++i) { + if (jolts[i + 1].jolt - jolts[i].jolt == 1) ++dif1; + else if (jolts[i + 1].jolt - jolts[i].jolt == 3) ++dif3; + } + + std::cout << (dif1 * dif3) << std::endl; + + for (auto i = i32(0); i < jolts.size() - 1; ++i) { + for (auto j = i + 1; j < jolts.size(); ++j) { + if (jolts[j].jolt <= jolts[i].jolt + 3) { + jolts[j].count += jolts[i].count; + } else { + break; + } + } + } + std::cout << jolts[jolts.size() - 1].count << std::endl; + + return 0; +} diff --git a/2020/day10.input b/2020/day10.input new file mode 100644 index 0000000..526a28e --- /dev/null +++ b/2020/day10.input @@ -0,0 +1,96 @@ +133 +157 +39 +74 +108 +136 +92 +55 +86 +46 +111 +58 +80 +115 +84 +67 +98 +30 +40 +61 +71 +114 +17 +9 +123 +142 +49 +158 +107 +139 +104 +132 +155 +96 +91 +15 +11 +23 +54 +6 +63 +126 +3 +10 +116 +87 +68 +72 +109 +62 +134 +103 +1 +16 +101 +117 +35 +120 +151 +102 +85 +145 +135 +79 +2 +147 +33 +41 +93 +52 +48 +64 +81 +29 +20 +110 +129 +43 +148 +36 +53 +26 +42 +156 +154 +77 +88 +73 +27 +34 +12 +146 +78 +47 +28 +97 diff --git a/2020/day9.cpp b/2020/day9.cpp new file mode 100644 index 0000000..1668fd5 --- /dev/null +++ b/2020/day9.cpp @@ -0,0 +1,88 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "types.hpp" + +auto find_sum(usize index, std::vector xmas) { + for (auto i = index - 25; i < index - 1; ++i) { + for (auto j = i + 1; j < index; ++j) { + if (xmas[i] + xmas[j] == xmas[index]) { + return true; + } + } + } + return false; +} + +auto main(i32 argc, char * argv[]) -> i32 { + auto xmas = std::vector(); + auto line = std::string(); + auto file = std::ifstream("day9.input"); + while (getline(file, line)) { + xmas.push_back(std::stoll(line)); + } + + auto invalid = u64(0); + for (auto i = usize(25); i < xmas.size(); ++i) { + if (!find_sum(i, xmas)) { + std::cout << (invalid = xmas[i]) << std::endl; + break; + } + } + + auto head_index = 0; + auto tail_index = 1; + auto sum = xmas[0] + xmas[1]; + while (sum != invalid) { + if (sum < invalid) { + sum += xmas[++tail_index]; + } else if (head_index + 1 < tail_index) { + sum -= xmas[head_index]; + ++head_index; + } else { + head_index = tail_index + 1; + tail_index = head_index + 1; + sum = xmas[head_index] + xmas[tail_index]; + } + } + auto min = xmas[tail_index]; + auto max = xmas[tail_index]; + for (auto i = head_index; i < tail_index; ++i) { + if (xmas[i] < min) { + min = xmas[i]; + } else if (xmas[i] > max) { + max = xmas[i]; + } + } + std::cout << (min + max) << std::endl; + + return 0; +} diff --git a/2020/day9.input b/2020/day9.input new file mode 100644 index 0000000..ea99600 --- /dev/null +++ b/2020/day9.input @@ -0,0 +1,1000 @@ +8 +11 +27 +48 +5 +19 +18 +36 +3 +45 +22 +37 +46 +4 +31 +42 +39 +30 +41 +14 +40 +29 +43 +25 +6 +7 +28 +8 +52 +9 +49 +13 +20 +34 +10 +11 +12 +17 +15 +18 +53 +21 +16 +26 +19 +14 +54 +39 +22 +23 +24 +25 +27 +28 +29 +80 +33 +35 +30 +31 +72 +32 +34 +36 +37 +38 +48 +60 +47 +51 +41 +45 +49 +67 +50 +64 +62 +77 +57 +65 +66 +68 +71 +107 +108 +69 +70 +119 +73 +94 +79 +117 +86 +88 +90 +133 +202 +99 +116 +141 +122 +148 +218 +223 +131 +134 +137 +139 +258 +142 +155 +143 +152 +161 +263 +259 +219 +174 +178 +189 +420 +215 +221 +238 +261 +253 +393 +265 +440 +270 +271 +311 +482 +285 +294 +443 +295 +313 +335 +389 +367 +352 +363 +663 +810 +491 +526 +459 +572 +712 +629 +535 +565 +541 +660 +556 +832 +580 +579 +589 +648 +702 +1351 +687 +715 +1000 +811 +952 +1907 +950 +1239 +1031 +1145 +1161 +1076 +1258 +1204 +1515 +1121 +1135 +1530 +1159 +1168 +1276 +1237 +1335 +1389 +1402 +1498 +1526 +1761 +1763 +1902 +1981 +2026 +2917 +2363 +2289 +2197 +2211 +2833 +2724 +3546 +2327 +2294 +2396 +3448 +2557 +4275 +3096 +2737 +2791 +3024 +3259 +3960 +3524 +4159 +3883 +4007 +5811 +4408 +4486 +4500 +4491 +4505 +8434 +5118 +4621 +4690 +4851 +5844 +5815 +5348 +6120 +5528 +7683 +6283 +7750 +8697 +7407 +7531 +7890 +9029 +10971 +8894 +10876 +8991 +9112 +8996 +10349 +9472 +9311 +9541 +10038 +10199 +11468 +11163 +11811 +18423 +14519 +13690 +18089 +20474 +17756 +16919 +15421 +20057 +17885 +18435 +17890 +17987 +18103 +18653 +18537 +24557 +29914 +30609 +19579 +25459 +21362 +22631 +45516 +25501 +31446 +28209 +29111 +33856 +32340 +38116 +33306 +33311 +35877 +36325 +66325 +35993 +36756 +43562 +43094 +50877 +53668 +65302 +40941 +46821 +43993 +54673 +86119 +73725 +69299 +61451 +57320 +62417 +69096 +88993 +71422 +105176 +69188 +79087 +72318 +79555 +80749 +105550 +131605 +84035 +126508 +116120 +119737 +84934 +106410 +133839 +205113 +118771 +123868 +126416 +141972 +141504 +143740 +138284 +140610 +151873 +159836 +148275 +151405 +188438 +164489 +164784 +224645 +283704 +283555 +409971 +191344 +246153 +203705 +278607 +311709 +262511 +242639 +250284 +264700 +316189 +500147 +372920 +278894 +288885 +342749 +299680 +453989 +355833 +329273 +356128 +368489 +395049 +433983 +437497 +618639 +441628 +446344 +564380 +579557 +492923 +539169 +615869 +711238 +543594 +762533 +567779 +578574 +588565 +642429 +962828 +628953 +790111 +685106 +935685 +1369668 +763538 +1122603 +871480 +930420 +1372048 +887972 +1958233 +1057303 +1032092 +1036517 +1082763 +1111373 +1966937 +2045591 +1357890 +1146353 +2179906 +1217518 +1271382 +1850800 +1392491 +1475217 +2034920 +1699223 +2629272 +1635018 +2586590 +2735740 +3015536 +3669938 +1920064 +2119280 +2068609 +3091714 +2147890 +2194136 +2257726 +2363871 +2417735 +5273262 +2488900 +3395281 +3885720 +2663873 +4714759 +2867708 +3110235 +6634823 +3334241 +3555082 +4557509 +5509449 +5755587 +5178844 +4114200 +3988673 +4326335 +5061844 +4342026 +4405616 +6201949 +5972817 +4852771 +4906635 +5152773 +6043982 +8240876 +6665317 +5531581 +6422790 +9744260 +6444476 +8440535 +7448441 +9258387 +8102873 +8315008 +11222826 +8330699 +12510285 +9050517 +8668361 +8747642 +9194797 +9558389 +10005544 +9759406 +10950617 +10059408 +10684354 +18807050 +11954371 +11976057 +15981179 +16503884 +14759484 +14547349 +15551314 +15763449 +17942439 +16417881 +16645707 +16999060 +24298956 +19764950 +17416003 +18306031 +18753186 +18954203 +20509006 +29437540 +21735463 +20743762 +26665533 +25443838 +40716837 +23930428 +26735541 +29306833 +48060019 +30098663 +34415063 +39677902 +33063588 +33416941 +37059217 +33644767 +35305091 +46853543 +35722034 +36370206 +37260234 +37707389 +39463209 +42244469 +54881378 +42479225 +44674190 +60082474 +49374266 +50665969 +53237261 +56042374 +68722032 +63515604 +63162251 +66480529 +76723443 +70677175 +69138975 +68949858 +69366801 +71027125 +86918659 +72092240 +82381579 +74967623 +77170598 +107836441 +98521599 +102561699 +95340159 +123244725 +114181573 +100040235 +103903230 +123914436 +126677855 +139976983 +197704980 +164706960 +139816150 +167432399 +141231215 +213596514 +143119365 +140393926 +145994748 +147059863 +152138221 +172510757 +238915525 +216986748 +193861758 +195380394 +268610190 +199243389 +246034983 +230581085 +226718090 +227817666 +250592291 +346303252 +279793133 +291954371 +280210076 +465633615 +281625141 +315630122 +283513291 +409004116 +345999979 +341375142 +299198084 +367891151 +485596938 +477375049 +514645173 +422098484 +394623783 +425961479 +458398751 +454535756 +992020222 +477310381 +591967433 +530385424 +560003209 +923649289 +573579512 +565138432 +580823225 +774028873 +760823672 +582711375 +721296568 +640573226 +667089235 +693821867 +907695422 +1506360664 +816722267 +871934164 +820585262 +1008672854 +880497235 +1023537183 +756008079 +1334403184 +1007695805 +1090388633 +1095523856 +1125141641 +1138717944 +1145961657 +1223284601 +2108432057 +1249800610 +1276533242 +1307662461 +1334395093 +2090411263 +1360911102 +1449829946 +1572730346 +2181496364 +1828281067 +1576593341 +1966546919 +1636505314 +1763703884 +1779545262 +1846396712 +2098084438 +2132837446 +2271103298 +3404874408 +2263859585 +3401011413 +2369246258 +3540392827 +4477678315 +2849263588 +2584195703 +3274209380 +2937504443 +4977604754 +3730157360 +3022560292 +3416050576 +3213098655 +3340297225 +3356138603 +3400209198 +3482902026 +3610100596 +3912382708 +4369187736 +5638477265 +5484201953 +5113123173 +7376982758 +7769396934 +6477897270 +4953441961 +5433459291 +5606755995 +5960064735 +6740506423 +6211713823 +6150603098 +7391748028 +8824499178 +6235658947 +6966239199 +7395284734 +6696435828 +6839040629 +6883111224 +9025505881 +7522483304 +8281570444 +9322629697 +11104045059 +10066565134 +10386901252 +11040215286 +15800526967 +10560197956 +13201898146 +11393524026 +15804053748 +12110667833 +12362316921 +13033714322 +25126683445 +40930737193 +12932094775 +13074699576 +13535476457 +19916825546 +14405594528 +14361523933 +27436223509 +21483468590 +22643094377 +17604200141 +19389194831 +20453466386 +20626763090 +21953721982 +21600413242 +25564215067 +22922514877 +23504191859 +31139676598 +24472984754 +26610176033 +25294411696 +26006794351 +26467571232 +27293618708 +33988942843 +27480294104 +46682813539 +28767118461 +31965724074 +33750718764 +36993394972 +40015957921 +38230963231 +38057666527 +46190978157 +41080229476 +42227176332 +43554135224 +50479779105 +61469236947 +52474365583 +47977176613 +49767396450 +51766603462 +77773397813 +51301206047 +53300413059 +111949016052 +54773912812 +68959119046 +94701541915 +60732842535 +90495737026 +65716442838 +98790509062 +75051061499 +89783354371 +76288629758 +79137896003 +84634364700 +83307405808 +85781311556 +155503151276 +112034048582 +121433484629 +133074802258 +189286246088 +101068602497 +183424873762 +126352267546 +104601619106 +120490355650 +115506755347 +123733031858 +126449285373 +144040248343 +191795385105 +241923840279 +180206498500 +159685426199 +155426525761 +344789397364 +159596035566 +162445301811 +167941770508 +169088717364 +220108374453 +205670221603 +298931629109 +216575357844 +221558958147 +235997110997 +319281461765 +225091974756 +356487466647 +228334650964 +422245579447 +239239787205 +250182317231 +270489533716 +299466774104 +315022561327 +384004259958 +315111951960 +317871827572 +322041337377 +598398403213 +569421162825 +330387072319 +535130935780 +468020346473 +425778596056 +427229179750 +441667332600 +438134315991 +464331761961 +475236898202 +742341131710 +453426625720 +498824184680 +467574438169 +580569389550 +489422104436 +811463441813 +1002705373949 +614489335431 +645499024279 +632983779532 +757616252069 +820865522057 +652428409696 +863912912047 +890110358017 +910956461869 +865363495741 +853007775806 +1108220677734 +952250810400 +879801648591 +1082063773600 +917758387681 +1105855035416 +921001063889 +1113313520111 +1113073462448 +1353335016483 +1433577165356 +1103911439867 +1266917745127 +1247473114963 +1285412189228 +1516341321743 +1410044661765 +1532230058287 +1832052458991 +1505436185502 +2132281240868 +1718371271547 +1732809424397 +1745165144332 +1770766163487 +2360786635074 +1797560036272 +1800802712480 +2185975213467 +2030831850129 +2024912503756 +2331045725654 +2466408478931 +2360546577411 +2351384554830 +3234379877836 +2992638259295 +2980282539360 +2532885304191 +2695456850993 +3277395202619 +2915480847267 +3223807457049 +3238245609899 +3515931307819 +3463536415879 +3918784637864 +3530369460669 +3542725180604 +3568326199759 +3598362748752 +3822472540028 +7352842000697 +5567637684360 +4726288701122 +4355958229410 +5972920798655 +7084257507578 +4711931132241 +5448366151458 +5228342155184 +5513167843551 +5610937698260 +5756692761240 +7060718149927 +7111051380363 +6139288304316 +8175467548120 +9211166408554 +14439508563738 +10883190689955 +9209300447012 +7073094641273 +7141087929356 +8796668354943 +7420835288780 +8178430769438 +10337226399382 +11776793518190 +12301436796457 +9067889361651 +10160297283699 +10468623893481 +9940273287425 +10676708306642 +13932160309360 +11124105541811 +11367630459500 +11895981065556 +13250339684679 +15596302836900 +15251525410711 +14214182570629 +19265292248424 +25299790768860 +15319518698794 +18647054662919 +14493929930053 +14561923218136 +15599266058218 +20805850292863 +23190612972104 +20844682879841 +19744597668293 +26110163636185 +30161189276354 +20100570571124 +20408897180906 +28426090239413 +22491736001311 +23020086607367 +24617970144179 +26389910995609 +25146320750235 +29745455340764 +34584810947218 +29055853148189 +28708112500682 +29813448628847 +50154352521670 +34306520886429 +49464750329095 +60416684522614 +35699836629342 +35343863726511 +39845168239417 +40153494849199 +51446176846780 +70284647576560 +64330266287982 +59558903969611 +45246891321359 +46798808176515 +45511822608678 +47109706145490 +65299815599434 +85752697733209 +95666175130348 +94143714916829 +57763965648871 +114764565928529 +70006357515771 diff --git a/2020/template.cpp b/2020/template.cpp index eab58ce..51a940b 100644 --- a/2020/template.cpp +++ b/2020/template.cpp @@ -34,7 +34,7 @@ auto main(i32 argc, char * argv[]) -> i32 { { auto line = std::string(); - auto file = std::ifstream("day$NUM.input"); + auto file = std::ifstream("dayNUM.input"); while (getline(file, line)) { } From 0e61a0201957245c8533b529a0435d33ed5ddb25 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 11 Dec 2020 00:24:00 -0800 Subject: [PATCH 25/52] Completed day 11 --- 2020/day11.cpp | 135 +++++++++++++++++++++++++++++++++++++++++++++++ 2020/day11.input | 95 +++++++++++++++++++++++++++++++++ 2 files changed, 230 insertions(+) create mode 100644 2020/day11.cpp create mode 100644 2020/day11.input diff --git a/2020/day11.cpp b/2020/day11.cpp new file mode 100644 index 0000000..c5aaa78 --- /dev/null +++ b/2020/day11.cpp @@ -0,0 +1,135 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include + +#include "types.hpp" + +template +auto iterate_seats(const auto & seats, Lambda callback) { + for (auto i = i32(0); i < seats.size(); ++i) { + for (auto j = i32(0); j < seats[0].size(); ++j) { + if (seats[i][j] != '.') { + callback(i, j); + } + } + } +} + +auto seats_equal(const auto & seats) -> bool { + for (auto i = usize(0); i < seats[0].size(); ++i) { + for (auto j = usize(0); j < seats[0][0].size(); ++j) { + if (seats[0][i][j] != seats[1][i][j]) { + return false; + } + } + } + return true; +} + +auto count_seats(const auto & seats) -> usize { + auto occupied = usize(0); + iterate_seats(seats, [&seats, &occupied](i32 i, i32 j) { + occupied += (seats[i][j] == '#'); + }); + return occupied; +} + +auto main(i32 argc, char * argv[]) -> i32 { + auto bit = u8(0b1); + auto seats = std::array, 2>(); + { + auto line = std::string(); + auto file = std::ifstream("day11.input"); + while (getline(file, line)) { + seats[bit].push_back(line); + } + seats[!bit] = seats[bit]; + } + + do { + auto & read = seats[bit]; + auto & write = seats[bit = !bit]; + + iterate_seats(read, [&read, &write](usize i, usize j) { + auto occupied = u8(0); + auto max_ii = std::min(i + 2, read.size()); + auto max_jj = std::min(j + 2, read[0].size()); + for (auto ii = bool(i) * (i - 1); ii < max_ii; ++ii) { + for (auto jj = bool(j) * (j - 1); jj < max_jj; ++jj) { + occupied += read[ii][jj] == '#'; + } + } + if (occupied == 0 && read[i][j] == 'L') write[i][j] = '#'; + else if (occupied >= 5 && read[i][j] == '#') write[i][j] = 'L'; // occupied >= 5 (not >= 4) because the occupied seat itself was counted as adjacent + else write[i][j] = read[i][j]; + }); + } + while (!seats_equal(seats)); + + std::cout << count_seats(seats[0]) << std::endl; + + iterate_seats(seats[0], [&seats](i32 i, i32 j) { + seats[0][i][j] = seats[1][i][j] = 'L'; + }); + + do { + auto & read = seats[bit]; + auto & write = seats[bit = !bit]; + + iterate_seats(read, [&read, &write](i32 i, i32 j) { + auto occupied = u8(0); + for (auto k = i32(0); k < 8; ++k) { + auto dir = k + (k > 3); + auto y = i; + auto x = j; + auto y_shift = (dir % 3) - 1; + auto x_shift = (dir > 5) - (dir < 3); + for (;;) { + y += y_shift; + x += x_shift; + if (y == -1 || x == -1 || y == read.size() || x == read[0].size() || read[y][x] == 'L') { + break; + } else if (read[y][x] == '#') { + ++occupied; + break; + } + } + } + if (occupied == 0 && read[i][j] == 'L') write[i][j] = '#'; + else if (occupied >= 5 && read[i][j] == '#') write[i][j] = 'L'; // no longer counting the seat itself as adjacent so stays occupied >= 5 + else write[i][j] = read[i][j]; + }); + } while (!seats_equal(seats)); + + std::cout << count_seats(seats[0]) << std::endl; + + return 0; +} diff --git a/2020/day11.input b/2020/day11.input new file mode 100644 index 0000000..16b4fb4 --- /dev/null +++ b/2020/day11.input @@ -0,0 +1,95 @@ +LLLLLL.LL.LLLLLL.LLLLLLL.LLLLLL.LLLLL.LLLLLLLLLLLLLLLLLL.LLLL.L.LLL.LLLLLLLL.LLLLLLLL.LLLLL +LLLLLL.L.LL.LLLL.L.LLLL.LLLLLLL.LLLLL.LLLLLLLL.LLLLLL.LLLLLLL.LLLLLLLLLLLLLL.LLLLLLLL.LLLLL +LLLLLL.LLLL.LLLL.LLLLLLLLLLLLLL.LLLLL.LLLL.LLLLLLLLLLL.L.LLLL.LLLLL.LLL..LLL.LLLLLLLLLLLLLL +LLLLLL.LLLL.LLLLLLLLLL.L.LLLLLLLLLLLLL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....L.......L...L.LL.L....L....L...L.... +LLLLLL.LLLL.LLLL.L.LLLLL.LLL.LL.LLLLL.LLLL.LLL.LLLLLLLLLLLLLL.LLLLLLLLLLLLLL.LLLLLLLL.LLLLL +LLL.LL.LLLL.LLL...L.LLL..LLLLLL.LLLLL.LLLLLLLL.LLLLLLLLLLLLLL.LLLLLLL.LLLLLLLLLLLLLLL.LLLLL +LLLLLL.LLLL.LLLL.LLLLLLL.LLLLLL.LLLLLLLLLLLLLL.LLLLLLL.LLLLLL.LLLLLLLLLLLLLLLLLLLLLLL.LLLLL +LLLLLLLLLLLLLLLL.LLLLLLL.LLLLLLLLLLLLLLLLLLLLL.LLL.LLL.LLLLLLLLLLLLL.LL.LLLLL.LLLLLLL.LLLLL +LLLLLL.LLLL.LLLLLLLLLLLLLLLLLLLLLLLLL.LLLLLLLL.LLLLLLL.LLLLLL.LLLLL.LLLLLLLL.LLLLLLLLLLLLLL +LLLLLLLLLLL.LLLL.LLLLLLL.LLLLLL..LLLL.LLLLLLLL.LLLLLLLLL.LLLLLLLLLL.LLLLLLLL.LLLLLLLL.LLLL. +LLLLLL.LLLLLLLLLLLLLL.LL.L.LLLLLLLLLL.LLL.LLLL.LLLLLLLLLLLLLLLLLLLLLLLLLLLLL.LLLLLLLL.LLL.L +LLLLLL.LLLLLLLLL.LLLLLLLLLLL.LLLLLLLL.LLLLL.LLLLLLLLLLLLLLLLL.LLLLL.LLLLLL.L.LLLLLLLLLLLLLL +LLLLLL.LLLLLLLLL.LLLLLLLLLLLLLL.LLLLL.LLLLLLLLLL.LLLLL.LLLLLL.LLLLLLLLLLLLLL.LLLLLLLL.LLLLL From c206715c364419871c39b02245a4dae5514355f7 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 11 Dec 2020 00:24:00 -0800 Subject: [PATCH 26/52] Completed day 11 --- 2020/day11.cpp | 135 +++++++++++++++++++++++++++++++++++++++++++++++ 2020/day11.input | 95 +++++++++++++++++++++++++++++++++ 2 files changed, 230 insertions(+) create mode 100644 2020/day11.cpp create mode 100644 2020/day11.input diff --git a/2020/day11.cpp b/2020/day11.cpp new file mode 100644 index 0000000..c5aaa78 --- /dev/null +++ b/2020/day11.cpp @@ -0,0 +1,135 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include + +#include "types.hpp" + +template +auto iterate_seats(const auto & seats, Lambda callback) { + for (auto i = i32(0); i < seats.size(); ++i) { + for (auto j = i32(0); j < seats[0].size(); ++j) { + if (seats[i][j] != '.') { + callback(i, j); + } + } + } +} + +auto seats_equal(const auto & seats) -> bool { + for (auto i = usize(0); i < seats[0].size(); ++i) { + for (auto j = usize(0); j < seats[0][0].size(); ++j) { + if (seats[0][i][j] != seats[1][i][j]) { + return false; + } + } + } + return true; +} + +auto count_seats(const auto & seats) -> usize { + auto occupied = usize(0); + iterate_seats(seats, [&seats, &occupied](i32 i, i32 j) { + occupied += (seats[i][j] == '#'); + }); + return occupied; +} + +auto main(i32 argc, char * argv[]) -> i32 { + auto bit = u8(0b1); + auto seats = std::array, 2>(); + { + auto line = std::string(); + auto file = std::ifstream("day11.input"); + while (getline(file, line)) { + seats[bit].push_back(line); + } + seats[!bit] = seats[bit]; + } + + do { + auto & read = seats[bit]; + auto & write = seats[bit = !bit]; + + iterate_seats(read, [&read, &write](usize i, usize j) { + auto occupied = u8(0); + auto max_ii = std::min(i + 2, read.size()); + auto max_jj = std::min(j + 2, read[0].size()); + for (auto ii = bool(i) * (i - 1); ii < max_ii; ++ii) { + for (auto jj = bool(j) * (j - 1); jj < max_jj; ++jj) { + occupied += read[ii][jj] == '#'; + } + } + if (occupied == 0 && read[i][j] == 'L') write[i][j] = '#'; + else if (occupied >= 5 && read[i][j] == '#') write[i][j] = 'L'; // occupied >= 5 (not >= 4) because the occupied seat itself was counted as adjacent + else write[i][j] = read[i][j]; + }); + } + while (!seats_equal(seats)); + + std::cout << count_seats(seats[0]) << std::endl; + + iterate_seats(seats[0], [&seats](i32 i, i32 j) { + seats[0][i][j] = seats[1][i][j] = 'L'; + }); + + do { + auto & read = seats[bit]; + auto & write = seats[bit = !bit]; + + iterate_seats(read, [&read, &write](i32 i, i32 j) { + auto occupied = u8(0); + for (auto k = i32(0); k < 8; ++k) { + auto dir = k + (k > 3); + auto y = i; + auto x = j; + auto y_shift = (dir % 3) - 1; + auto x_shift = (dir > 5) - (dir < 3); + for (;;) { + y += y_shift; + x += x_shift; + if (y == -1 || x == -1 || y == read.size() || x == read[0].size() || read[y][x] == 'L') { + break; + } else if (read[y][x] == '#') { + ++occupied; + break; + } + } + } + if (occupied == 0 && read[i][j] == 'L') write[i][j] = '#'; + else if (occupied >= 5 && read[i][j] == '#') write[i][j] = 'L'; // no longer counting the seat itself as adjacent so stays occupied >= 5 + else write[i][j] = read[i][j]; + }); + } while (!seats_equal(seats)); + + std::cout << count_seats(seats[0]) << std::endl; + + return 0; +} diff --git a/2020/day11.input b/2020/day11.input new file mode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.L +LLLLLL.LLLLLLLLL.LLLLLLLLLLL.LLLLLLLL.LLLLL.LLLLLLLLLLLLLLLLL.LLLLL.LLLLLL.L.LLLLLLLLLLLLLL +LLLLLL.LLLLLLLLL.LLLLLLLLLLLLLL.LLLLL.LLLLLLLLLL.LLLLL.LLLLLL.LLLLLLLLLLLLLL.LLLLLLLL.LLLLL From f7c94b2a170bc92abf2e2e6e5f6b1357adac1140 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 11 Dec 2020 00:52:18 -0800 Subject: [PATCH 27/52] Made day 5 part 2 O(n) instead of O(n^2) --- 2020/day8.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/2020/day8.cpp b/2020/day8.cpp index 1b389d2..030bceb 100644 --- a/2020/day8.cpp +++ b/2020/day8.cpp @@ -32,7 +32,7 @@ #include "types.hpp" enum OpCode { Acc, Jmp, Nop }; -struct Op{ OpCode code; i32 num; }; +struct Op{ OpCode code; i32 num; bool executed; }; auto extract_op(const std::string & string) -> Op { auto op = Op{ Nop, 0 }; auto op_code_str = string.substr(0, 3); @@ -47,11 +47,11 @@ auto extract_op(const std::string & string) -> Op { struct State{ u32 isp; i32 acc; }; -auto execute(State & state, const std::vector & ops) -> void { +auto execute(State & state, std::vector & ops) -> void { switch (ops[state.isp].code) { - case Acc: state.acc += ops[state.isp].num; ++state.isp; break; - case Jmp: state.isp += ops[state.isp].num; break; - case Nop: ++state.isp; break; + case Acc: ops[state.isp].executed = true; state.acc += ops[state.isp].num; ++state.isp; break; + case Jmp: ops[state.isp].executed = true; state.isp += ops[state.isp].num; break; + case Nop: ops[state.isp].executed = true; ++state.isp; break; } } @@ -65,9 +65,8 @@ auto attempt_swap(State & state, std::vector & ops) -> bool { } auto local_state = state; - auto executed = std::vector(ops.size()); - while (local_state.isp < ops.size() && !executed[local_state.isp]) { - executed[local_state.isp] = true; + ops[state.isp].executed = false; + while (local_state.isp < ops.size() && !ops[local_state.isp].executed) { execute(local_state, ops); } if (local_state.isp >= ops.size()) { @@ -93,15 +92,15 @@ auto main(i32 argc, char * argv[]) -> i32 { } auto state = State{ 0, 0 }; - auto executed = std::vector(ops.size()); - while (!executed[state.isp]) { - executed[state.isp] = true; + while (!ops[state.isp].executed) { execute(state, ops); } std::cout << state.acc << std::endl; + for (auto & op : ops) { op.executed = false; } + state = State{ 0, 0 }; - while (state.isp < ops.size()) { + for (;;) { if (attempt_swap(state, ops)) { std::cout << state.acc << std::endl; break; From 372300ccb053afbc965c1dffdd5f49ca3da49cd9 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 11 Dec 2020 00:52:18 -0800 Subject: [PATCH 28/52] Made day 5 part 2 O(n) instead of O(n^2) --- 2020/day8.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/2020/day8.cpp b/2020/day8.cpp index 1b389d2..030bceb 100644 --- a/2020/day8.cpp +++ b/2020/day8.cpp @@ -32,7 +32,7 @@ #include "types.hpp" enum OpCode { Acc, Jmp, Nop }; -struct Op{ OpCode code; i32 num; }; +struct Op{ OpCode code; i32 num; bool executed; }; auto extract_op(const std::string & string) -> Op { auto op = Op{ Nop, 0 }; auto op_code_str = string.substr(0, 3); @@ -47,11 +47,11 @@ auto extract_op(const std::string & string) -> Op { struct State{ u32 isp; i32 acc; }; -auto execute(State & state, const std::vector & ops) -> void { +auto execute(State & state, std::vector & ops) -> void { switch (ops[state.isp].code) { - case Acc: state.acc += ops[state.isp].num; ++state.isp; break; - case Jmp: state.isp += ops[state.isp].num; break; - case Nop: ++state.isp; break; + case Acc: ops[state.isp].executed = true; state.acc += ops[state.isp].num; ++state.isp; break; + case Jmp: ops[state.isp].executed = true; state.isp += ops[state.isp].num; break; + case Nop: ops[state.isp].executed = true; ++state.isp; break; } } @@ -65,9 +65,8 @@ auto attempt_swap(State & state, std::vector & ops) -> bool { } auto local_state = state; - auto executed = std::vector(ops.size()); - while (local_state.isp < ops.size() && !executed[local_state.isp]) { - executed[local_state.isp] = true; + ops[state.isp].executed = false; + while (local_state.isp < ops.size() && !ops[local_state.isp].executed) { execute(local_state, ops); } if (local_state.isp >= ops.size()) { @@ -93,15 +92,15 @@ auto main(i32 argc, char * argv[]) -> i32 { } auto state = State{ 0, 0 }; - auto executed = std::vector(ops.size()); - while (!executed[state.isp]) { - executed[state.isp] = true; + while (!ops[state.isp].executed) { execute(state, ops); } std::cout << state.acc << std::endl; + for (auto & op : ops) { op.executed = false; } + state = State{ 0, 0 }; - while (state.isp < ops.size()) { + for (;;) { if (attempt_swap(state, ops)) { std::cout << state.acc << std::endl; break; From e8c883e374b5f4ec16721f2652447f53a91dd3e3 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 11 Dec 2020 09:24:22 -0800 Subject: [PATCH 29/52] Restructured project and updated day 3 --- 2020/Makefile | 16 +++-- 2020/{ => days}/day1.cpp | 19 +++--- 2020/{ => days}/day10.cpp | 13 ++-- 2020/{ => days}/day11.cpp | 13 ++-- 2020/{ => days}/day2.cpp | 13 ++-- 2020/{ => days}/day3.cpp | 57 ++++++++++------- 2020/{ => days}/day4.cpp | 12 ++-- 2020/{ => days}/day5.cpp | 13 ++-- 2020/{ => days}/day6.cpp | 12 ++-- 2020/{ => days}/day7.cpp | 13 ++-- 2020/{ => days}/day8.cpp | 13 ++-- 2020/{ => days}/day9.cpp | 13 ++-- 2020/{ => inputs}/day1.input | 0 2020/{ => inputs}/day10.input | 0 2020/{ => inputs}/day11.input | 0 2020/{ => inputs}/day2.input | 0 2020/{ => inputs}/day3.input | 0 2020/{ => inputs}/day4.input | 0 2020/{ => inputs}/day5.input | 0 2020/{ => inputs}/day6.input | 0 2020/{ => inputs}/day7.input | 0 2020/{ => inputs}/day8.input | 0 2020/{ => inputs}/day9.input | 0 2020/{template.cpp => misc/day.cpp.template} | 9 ++- 2020/misc/main.cpp | 36 +++++++++++ 2020/misc/main_test.cpp | 66 ++++++++++++++++++++ 2020/misc/print.hpp | 31 +++++++++ 2020/{ => misc}/types.cpp | 0 2020/{ => misc}/types.hpp | 0 29 files changed, 245 insertions(+), 104 deletions(-) rename 2020/{ => days}/day1.cpp (87%) rename 2020/{ => days}/day10.cpp (91%) rename 2020/{ => days}/day11.cpp (94%) rename 2020/{ => days}/day2.cpp (91%) rename 2020/{ => days}/day3.cpp (60%) rename 2020/{ => days}/day4.cpp (95%) rename 2020/{ => days}/day5.cpp (90%) rename 2020/{ => days}/day6.cpp (91%) rename 2020/{ => days}/day7.cpp (93%) rename 2020/{ => days}/day8.cpp (94%) rename 2020/{ => days}/day9.cpp (92%) rename 2020/{ => inputs}/day1.input (100%) rename 2020/{ => inputs}/day10.input (100%) rename 2020/{ => inputs}/day11.input (100%) rename 2020/{ => inputs}/day2.input (100%) rename 2020/{ => inputs}/day3.input (100%) rename 2020/{ => inputs}/day4.input (100%) rename 2020/{ => inputs}/day5.input (100%) rename 2020/{ => inputs}/day6.input (100%) rename 2020/{ => inputs}/day7.input (100%) rename 2020/{ => inputs}/day8.input (100%) rename 2020/{ => inputs}/day9.input (100%) rename 2020/{template.cpp => misc/day.cpp.template} (91%) create mode 100644 2020/misc/main.cpp create mode 100644 2020/misc/main_test.cpp create mode 100644 2020/misc/print.hpp rename 2020/{ => misc}/types.cpp (100%) rename 2020/{ => misc}/types.hpp (100%) diff --git a/2020/Makefile b/2020/Makefile index ede9575..812ac33 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -1,12 +1,16 @@ -day%.out: out/types.o day%.cpp - g++-10 -std=c++2a $(flags) $(@:out=cpp) out/types.o -o $@ +day%.out: out/types.o misc/main.cpp days/day%.cpp + g++-10 -std=c++2a $(flags) -Dcurrent_day=$(@:.out=) days/$(@:out=cpp) misc/main.cpp out/types.o -o $@ -day%.cpp: - cp template.cpp $@ +day%_test.out: out/types.o misc/main_test.cpp days/day%.cpp + g++-10 -std=c++2a $(flags) -DTEST_BUILD -Dcurrent_day=$(@:_test.out=) days/$(@:_test.out=.cpp) misc/main_test.cpp out/types.o -o $@ -out/types.o: types.hpp types.cpp +days/day%.cpp: + cp 'misc/day.cpp.template' $@ + sed -i -e "s/current_day/$(shell basename $@ | cut -f 1 -d '.')/g" $@ + +out/types.o: misc/types.hpp misc/types.cpp mkdir -p out/ - g++-10 -std=c++2a $(flags) -c types.cpp -o $@ + g++-10 -std=c++2a $(flags) -c misc/types.cpp -o $@ .PHONY: clean clean: diff --git a/2020/day1.cpp b/2020/days/day1.cpp similarity index 87% rename from 2020/day1.cpp rename to 2020/days/day1.cpp index 5eda877..03d3b48 100644 --- a/2020/day1.cpp +++ b/2020/days/day1.cpp @@ -30,7 +30,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" // Find 2 numbers that sum to 2020 auto find_2020_x2(const std::vector & list) -> void { @@ -44,7 +45,7 @@ auto find_2020_x2(const std::vector & list) -> void { --end; } } - std::cout << (list[begin] * list[end]) << std::endl; + print((list[begin] * list[end])); } // Find 3 numbers that sum to 2020 @@ -53,13 +54,13 @@ auto find_2020_x3(const std::vector & list) -> void { for (auto n1 = 1; n1 < list.size() - 1; ++n1) { auto low = n0 + 1; auto high = n1; - auto n2 = (low + high) / 2; - while (low < high - 1) { + while (low < high) { + auto n2 = (low + high) / 2; auto sum = 0; if ((sum = list[n0] + list[n1] + list[n2]) == 2020) { - std::cout << (list[n0] * list[n1] * list[n2]) << std::endl; + print((list[n0] * list[n1] * list[n2])); return; - } else if (sum > 2020) { + } else if (sum < 2020) { low = n2 + 1; } else { high = n2; @@ -69,11 +70,11 @@ auto find_2020_x3(const std::vector & list) -> void { } } -auto main(i32 argc, char * argv[]) -> i32 { +auto day1() -> void { auto list = std::vector(); { auto line = std::string(); - auto file = std::ifstream("day1.input"); + auto file = std::ifstream("inputs/day1.input"); while (getline(file, line)) { list.push_back(std::stoi(line)); } @@ -82,6 +83,4 @@ auto main(i32 argc, char * argv[]) -> i32 { find_2020_x2(list); find_2020_x3(list); - - return 0; } diff --git a/2020/day10.cpp b/2020/days/day10.cpp similarity index 91% rename from 2020/day10.cpp rename to 2020/days/day10.cpp index 9f6fab4..0da5b83 100644 --- a/2020/day10.cpp +++ b/2020/days/day10.cpp @@ -29,7 +29,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" struct Pair { u64 jolt; @@ -40,11 +41,11 @@ auto operator<(const Pair & left, const Pair & right) -> bool { return left.jolt < right.jolt; } -auto main(i32 argc, char * argv[]) -> i32 { +auto day10() -> void { auto jolts = std::vector{{ 0, 1 }}; { auto line = std::string(); - auto file = std::ifstream("day10.input"); + auto file = std::ifstream("inputs/day10.input"); while (getline(file, line)) { jolts.push_back({ (u64) std::stoll(line), 0 }); } @@ -59,7 +60,7 @@ auto main(i32 argc, char * argv[]) -> i32 { else if (jolts[i + 1].jolt - jolts[i].jolt == 3) ++dif3; } - std::cout << (dif1 * dif3) << std::endl; + print((dif1 * dif3)); for (auto i = i32(0); i < jolts.size() - 1; ++i) { for (auto j = i + 1; j < jolts.size(); ++j) { @@ -70,7 +71,5 @@ auto main(i32 argc, char * argv[]) -> i32 { } } } - std::cout << jolts[jolts.size() - 1].count << std::endl; - - return 0; + print(jolts[jolts.size() - 1].count); } diff --git a/2020/day11.cpp b/2020/days/day11.cpp similarity index 94% rename from 2020/day11.cpp rename to 2020/days/day11.cpp index c5aaa78..ecbd826 100644 --- a/2020/day11.cpp +++ b/2020/days/day11.cpp @@ -30,7 +30,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" template auto iterate_seats(const auto & seats, Lambda callback) { @@ -62,12 +63,12 @@ auto count_seats(const auto & seats) -> usize { return occupied; } -auto main(i32 argc, char * argv[]) -> i32 { +auto day11() -> void { auto bit = u8(0b1); auto seats = std::array, 2>(); { auto line = std::string(); - auto file = std::ifstream("day11.input"); + auto file = std::ifstream("inputs/day11.input"); while (getline(file, line)) { seats[bit].push_back(line); } @@ -94,7 +95,7 @@ auto main(i32 argc, char * argv[]) -> i32 { } while (!seats_equal(seats)); - std::cout << count_seats(seats[0]) << std::endl; + print(count_seats(seats[0])); iterate_seats(seats[0], [&seats](i32 i, i32 j) { seats[0][i][j] = seats[1][i][j] = 'L'; @@ -129,7 +130,5 @@ auto main(i32 argc, char * argv[]) -> i32 { }); } while (!seats_equal(seats)); - std::cout << count_seats(seats[0]) << std::endl; - - return 0; + print(count_seats(seats[0])); } diff --git a/2020/day2.cpp b/2020/days/day2.cpp similarity index 91% rename from 2020/day2.cpp rename to 2020/days/day2.cpp index cec8af6..fa57af9 100644 --- a/2020/day2.cpp +++ b/2020/days/day2.cpp @@ -29,7 +29,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" struct Password { u32 min; @@ -72,11 +73,11 @@ auto count_valid_toboggan(const std::vector & passwords) -> u32 { return valid; } -auto main(i32 argc, char * argv[]) -> i32 { +auto day2() -> void { auto passwords = std::vector(); { auto line = std::string(); - auto file = std::ifstream("day2.input"); + auto file = std::ifstream("inputs/day2.input"); while (getline(file, line)) { auto index = usize(0); auto password = Password{}; @@ -88,8 +89,6 @@ auto main(i32 argc, char * argv[]) -> i32 { } } - std::cout << count_valid_sled(passwords) << std::endl; - std::cout << count_valid_toboggan(passwords) << std::endl; - - return 0; + print(count_valid_sled(passwords) ); + print(count_valid_toboggan(passwords)); } diff --git a/2020/day3.cpp b/2020/days/day3.cpp similarity index 60% rename from 2020/day3.cpp rename to 2020/days/day3.cpp index 4c6268b..647d627 100644 --- a/2020/day3.cpp +++ b/2020/days/day3.cpp @@ -29,40 +29,53 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" -auto read_field_and_count_trees(std::vector & trees, usize horizontal_increment, usize vertical_increment) -> u64 { - auto tree_count = u64(0); +struct TreeVector{ usize horz; usize vert; }; +struct Coordinate{ usize x_index; usize y_index; }; - auto x_index = usize(-horizontal_increment); - auto y_index = usize(-1); - auto line = std::string(); - auto file = std::ifstream("day3.input"); - - while (getline(file, line)) { - auto vertical_check = (++y_index % vertical_increment == 0); - tree_count += vertical_check * (line[(x_index += (vertical_check * horizontal_increment)) % line.size()] == '#'); +auto read_field_and_count_trees(const std::vector & vectors) -> std::vector { + auto tree_counts = std::vector(vectors.size()); + auto coords = std::vector(vectors.size()); + for (auto i = usize(0); i < coords.size(); ++i) { + coords[i] = { usize(-vectors[i].horz), usize(-1) }; } - return tree_count; + auto line = std::string(); + auto file = std::ifstream("inputs/day3.input"); + + while (getline(file, line)) { + for (auto i = usize(0); i < vectors.size(); ++i) { + auto & vector = vectors[i]; + auto & coord = coords[i]; + + auto vertical_check = (++coord.y_index % vector.vert == 0); + tree_counts[i] += vertical_check * (line[(coord.x_index += (vertical_check * vector.horz)) % line.size()] == '#'); + } + } + + return std::move(tree_counts); } -auto main(i32 argc, char ** argv) -> i32 { +auto day3() -> void { auto trees = std::vector(); - auto tree_counts = std::vector(); + auto tree_counts = read_field_and_count_trees( + std::vector{ + { 3, 1 }, + { 1, 1 }, + { 5, 1 }, + { 7, 1 }, + { 1, 2 }, + } + ); - tree_counts.push_back(read_field_and_count_trees(trees, 3, 1)); - std::cout << tree_counts[0] << std::endl; + print(tree_counts[0]); - tree_counts.push_back(read_field_and_count_trees(trees, 1, 1)); - tree_counts.push_back(read_field_and_count_trees(trees, 5, 1)); - tree_counts.push_back(read_field_and_count_trees(trees, 7, 1)); - tree_counts.push_back(read_field_and_count_trees(trees, 1, 2)); auto tree_count_product = u64(1); for (auto tree_count : tree_counts) { tree_count_product *= tree_count; } - std::cout << tree_count_product << std::endl; - return 0; + print(tree_count_product); } diff --git a/2020/day4.cpp b/2020/days/day4.cpp similarity index 95% rename from 2020/day4.cpp rename to 2020/days/day4.cpp index f0c5b78..1ba17f8 100644 --- a/2020/day4.cpp +++ b/2020/days/day4.cpp @@ -29,7 +29,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" struct KeyValue { std::string key; @@ -46,13 +47,13 @@ auto try_num(const std::string & passport, usize index) -> bool { return Min <= num && num <= Max; }; -auto main(i32 argc, char * argv[]) -> i32 { +auto day4() -> void { auto valid_count1 = usize(0); auto valid_count2 = usize(0); auto passport = std::string(); auto line = std::string(); - auto file = std::ifstream("day4.input"); + auto file = std::ifstream("inputs/day4.input"); while (getline(file, line)) { if (line == "") { auto elements = std::vector{ @@ -108,7 +109,6 @@ auto main(i32 argc, char * argv[]) -> i32 { } } - std::cout << valid_count1 << ", " << valid_count2 << std::endl; - - return 0; + print(valid_count1); + print(valid_count2); } diff --git a/2020/day5.cpp b/2020/days/day5.cpp similarity index 90% rename from 2020/day5.cpp rename to 2020/days/day5.cpp index 70d3d35..5a68158 100644 --- a/2020/day5.cpp +++ b/2020/days/day5.cpp @@ -30,12 +30,13 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" -auto main(i32 argc, char * argv[]) -> i32 { +auto day5() -> void { auto seat = usize(0); auto line = std::string(); - auto file = std::ifstream("day5.input"); + auto file = std::ifstream("inputs/day5.input"); auto seats = std::vector(); @@ -49,16 +50,14 @@ auto main(i32 argc, char * argv[]) -> i32 { } seats.push_back(local_seat); } - std::cout << seat << std::endl; + print(seat); std::sort(seats.begin(), seats.end()); for (auto i = usize(0); i < seats.size() - 1; ++i) { if (seats[i] + 2 == seats[i + 1]) { - std::cout << (seats[i] + 1) << std::endl; + print((seats[i] + 1)); break; } } - - return 0; } diff --git a/2020/day6.cpp b/2020/days/day6.cpp similarity index 91% rename from 2020/day6.cpp rename to 2020/days/day6.cpp index ae1035b..b3a3dbe 100644 --- a/2020/day6.cpp +++ b/2020/days/day6.cpp @@ -29,12 +29,13 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" -auto main(i32 argc, char * argv[]) -> i32 { +auto day6() -> void { { auto line = std::string(); - auto file = std::ifstream("day6.input"); + auto file = std::ifstream("inputs/day6.input"); auto answers = std::vector(26); @@ -57,8 +58,7 @@ auto main(i32 argc, char * argv[]) -> i32 { } } } - std::cout << sum_1 << ", " << sum_2 << std::endl; + print(sum_1); + print(sum_2); } - - return 0; } diff --git a/2020/day7.cpp b/2020/days/day7.cpp similarity index 93% rename from 2020/day7.cpp rename to 2020/days/day7.cpp index 97991ea..8c2d8cc 100644 --- a/2020/day7.cpp +++ b/2020/days/day7.cpp @@ -32,7 +32,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" struct SubBag { std::string type; u32 count; }; @@ -60,11 +61,11 @@ auto count_to(const std::string & search, std::map & map) -> return counted; } -auto main(i32 argc, char * argv[]) -> i32 { +auto day7() -> void { auto bag_graph = std::map(); { auto line = std::string(); - auto file = std::ifstream("day7.input"); + auto file = std::ifstream("inputs/day7.input"); while (getline(file, line)) { auto find = line.find("bag") - 1; auto bag_type = line.substr(0, line.find("bag") - 1); @@ -96,9 +97,7 @@ auto main(i32 argc, char * argv[]) -> i32 { } } } - std::cout << seen.size() << std::endl; + print(seen.size()); - std::cout << (count_to("shiny gold", bag_graph) - 1) << std::endl; - - return 0; + print((count_to("shiny gold", bag_graph) - 1)); } diff --git a/2020/day8.cpp b/2020/days/day8.cpp similarity index 94% rename from 2020/day8.cpp rename to 2020/days/day8.cpp index 030bceb..0d770cd 100644 --- a/2020/day8.cpp +++ b/2020/days/day8.cpp @@ -29,7 +29,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" enum OpCode { Acc, Jmp, Nop }; struct Op{ OpCode code; i32 num; bool executed; }; @@ -81,11 +82,11 @@ auto attempt_swap(State & state, std::vector & ops) -> bool { return false; } -auto main(i32 argc, char * argv[]) -> i32 { +auto day8() -> void { auto ops = std::vector(); { auto line = std::string(); - auto file = std::ifstream("day8.input"); + auto file = std::ifstream("inputs/day8.input"); while (getline(file, line)) { ops.push_back(extract_op(line)); } @@ -95,18 +96,16 @@ auto main(i32 argc, char * argv[]) -> i32 { while (!ops[state.isp].executed) { execute(state, ops); } - std::cout << state.acc << std::endl; + print(state.acc); for (auto & op : ops) { op.executed = false; } state = State{ 0, 0 }; for (;;) { if (attempt_swap(state, ops)) { - std::cout << state.acc << std::endl; + print(state.acc); break; } execute(state, ops); } - - return 0; } diff --git a/2020/day9.cpp b/2020/days/day9.cpp similarity index 92% rename from 2020/day9.cpp rename to 2020/days/day9.cpp index 1668fd5..987fc9c 100644 --- a/2020/day9.cpp +++ b/2020/days/day9.cpp @@ -29,7 +29,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" auto find_sum(usize index, std::vector xmas) { for (auto i = index - 25; i < index - 1; ++i) { @@ -42,10 +43,10 @@ auto find_sum(usize index, std::vector xmas) { return false; } -auto main(i32 argc, char * argv[]) -> i32 { +auto day9() -> void { auto xmas = std::vector(); auto line = std::string(); - auto file = std::ifstream("day9.input"); + auto file = std::ifstream("inputs/day9.input"); while (getline(file, line)) { xmas.push_back(std::stoll(line)); } @@ -53,7 +54,7 @@ auto main(i32 argc, char * argv[]) -> i32 { auto invalid = u64(0); for (auto i = usize(25); i < xmas.size(); ++i) { if (!find_sum(i, xmas)) { - std::cout << (invalid = xmas[i]) << std::endl; + print((invalid = xmas[i])); break; } } @@ -82,7 +83,5 @@ auto main(i32 argc, char * argv[]) -> i32 { max = xmas[i]; } } - std::cout << (min + max) << std::endl; - - return 0; + print((min + max)); } diff --git a/2020/day1.input b/2020/inputs/day1.input similarity index 100% rename from 2020/day1.input rename to 2020/inputs/day1.input diff --git a/2020/day10.input b/2020/inputs/day10.input similarity index 100% rename from 2020/day10.input rename to 2020/inputs/day10.input diff --git a/2020/day11.input b/2020/inputs/day11.input similarity index 100% rename from 2020/day11.input rename to 2020/inputs/day11.input diff --git a/2020/day2.input b/2020/inputs/day2.input similarity index 100% rename from 2020/day2.input rename to 2020/inputs/day2.input diff --git a/2020/day3.input b/2020/inputs/day3.input similarity index 100% rename from 2020/day3.input rename to 2020/inputs/day3.input diff --git a/2020/day4.input b/2020/inputs/day4.input similarity index 100% rename from 2020/day4.input rename to 2020/inputs/day4.input diff --git a/2020/day5.input b/2020/inputs/day5.input similarity index 100% rename from 2020/day5.input rename to 2020/inputs/day5.input diff --git a/2020/day6.input b/2020/inputs/day6.input similarity index 100% rename from 2020/day6.input rename to 2020/inputs/day6.input diff --git a/2020/day7.input b/2020/inputs/day7.input similarity index 100% rename from 2020/day7.input rename to 2020/inputs/day7.input diff --git a/2020/day8.input b/2020/inputs/day8.input similarity index 100% rename from 2020/day8.input rename to 2020/inputs/day8.input diff --git a/2020/day9.input b/2020/inputs/day9.input similarity index 100% rename from 2020/day9.input rename to 2020/inputs/day9.input diff --git a/2020/template.cpp b/2020/misc/day.cpp.template similarity index 91% rename from 2020/template.cpp rename to 2020/misc/day.cpp.template index 51a940b..52dfe9d 100644 --- a/2020/template.cpp +++ b/2020/misc/day.cpp.template @@ -29,16 +29,15 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" -auto main(i32 argc, char * argv[]) -> i32 { +auto current_day() -> void { { auto line = std::string(); - auto file = std::ifstream("dayNUM.input"); + auto file = std::ifstream("inputs/current_day.input"); while (getline(file, line)) { } } - - return 0; } diff --git a/2020/misc/main.cpp b/2020/misc/main.cpp new file mode 100644 index 0000000..c4752db --- /dev/null +++ b/2020/misc/main.cpp @@ -0,0 +1,36 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include "types.hpp" + +extern auto current_day() -> void; + +auto main(i32 argc, char * argv[]) -> i32 { + current_day(); + + return 0; +} + diff --git a/2020/misc/main_test.cpp b/2020/misc/main_test.cpp new file mode 100644 index 0000000..0d8954d --- /dev/null +++ b/2020/misc/main_test.cpp @@ -0,0 +1,66 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include + +#include "types.hpp" + +extern auto current_day() -> void; + +auto main(i32 argc, char * argv[]) -> i32 { + auto TEST_CYCLES = 1; + if (argc >= 2) { + TEST_CYCLES = std::stoi(argv[1]); + } + + std::cout << "Starting test with " << TEST_CYCLES << " iterations..." << std::endl; + auto begin1 = std::chrono::high_resolution_clock::now(); + + for (auto i = usize(0); i < TEST_CYCLES; ++i) { + current_day(); + } + + auto end1 = std::chrono::high_resolution_clock::now(); + + if (argc >= 3) { + if (argv[2] == std::string("millis")) { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " milliseconds"<< std::endl; + } else if (argv[2] == std::string("nanos")) { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " nanoseconds"<< std::endl; + } else if (argv[2] == std::string("micros")) { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " microsenconds"<< std::endl; + } else { + std::cout << "Unkown time scale '" << argv[2] << "'" << std::endl; + } + } else { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " microseconds"<< std::endl; + } + + return 0; +} + diff --git a/2020/misc/print.hpp b/2020/misc/print.hpp new file mode 100644 index 0000000..5960cd8 --- /dev/null +++ b/2020/misc/print.hpp @@ -0,0 +1,31 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#ifndef TEST_BUILD +#define print(x) std::cout << (x) << std::endl +#else +#define print(x) +#endif diff --git a/2020/types.cpp b/2020/misc/types.cpp similarity index 100% rename from 2020/types.cpp rename to 2020/misc/types.cpp diff --git a/2020/types.hpp b/2020/misc/types.hpp similarity index 100% rename from 2020/types.hpp rename to 2020/misc/types.hpp From 0f6b89142363a3c5d20717b9b529b741a482bd6e Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 11 Dec 2020 09:29:57 -0800 Subject: [PATCH 30/52] Updated make clean rule --- 2020/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2020/Makefile b/2020/Makefile index 812ac33..3860638 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -14,4 +14,4 @@ out/types.o: misc/types.hpp misc/types.cpp .PHONY: clean clean: - rm out/* day*.out day*.output + rm -f out/* day*.out day*.output From 44b298b12e734615e2bfba2d863ccac211c90f3d Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 11 Dec 2020 09:24:22 -0800 Subject: [PATCH 31/52] Restructured project and updated day 3 --- 2020/Makefile | 16 +++-- 2020/{ => days}/day1.cpp | 19 +++--- 2020/{ => days}/day10.cpp | 13 ++-- 2020/{ => days}/day11.cpp | 13 ++-- 2020/{ => days}/day2.cpp | 13 ++-- 2020/{ => days}/day3.cpp | 57 ++++++++++------- 2020/{ => days}/day4.cpp | 12 ++-- 2020/{ => days}/day5.cpp | 13 ++-- 2020/{ => days}/day6.cpp | 12 ++-- 2020/{ => days}/day7.cpp | 13 ++-- 2020/{ => days}/day8.cpp | 13 ++-- 2020/{ => days}/day9.cpp | 13 ++-- 2020/{ => inputs}/day1.input | 0 2020/{ => inputs}/day10.input | 0 2020/{ => inputs}/day11.input | 0 2020/{ => inputs}/day2.input | 0 2020/{ => inputs}/day3.input | 0 2020/{ => inputs}/day4.input | 0 2020/{ => inputs}/day5.input | 0 2020/{ => inputs}/day6.input | 0 2020/{ => inputs}/day7.input | 0 2020/{ => inputs}/day8.input | 0 2020/{ => inputs}/day9.input | 0 2020/{template.cpp => misc/day.cpp.template} | 9 ++- 2020/misc/main.cpp | 36 +++++++++++ 2020/misc/main_test.cpp | 66 ++++++++++++++++++++ 2020/misc/print.hpp | 31 +++++++++ 2020/{ => misc}/types.cpp | 0 2020/{ => misc}/types.hpp | 0 29 files changed, 245 insertions(+), 104 deletions(-) rename 2020/{ => days}/day1.cpp (87%) rename 2020/{ => days}/day10.cpp (91%) rename 2020/{ => days}/day11.cpp (94%) rename 2020/{ => days}/day2.cpp (91%) rename 2020/{ => days}/day3.cpp (60%) rename 2020/{ => days}/day4.cpp (95%) rename 2020/{ => days}/day5.cpp (90%) rename 2020/{ => days}/day6.cpp (91%) rename 2020/{ => days}/day7.cpp (93%) rename 2020/{ => days}/day8.cpp (94%) rename 2020/{ => days}/day9.cpp (92%) rename 2020/{ => inputs}/day1.input (100%) rename 2020/{ => inputs}/day10.input (100%) rename 2020/{ => inputs}/day11.input (100%) rename 2020/{ => inputs}/day2.input (100%) rename 2020/{ => inputs}/day3.input (100%) rename 2020/{ => inputs}/day4.input (100%) rename 2020/{ => inputs}/day5.input (100%) rename 2020/{ => inputs}/day6.input (100%) rename 2020/{ => inputs}/day7.input (100%) rename 2020/{ => inputs}/day8.input (100%) rename 2020/{ => inputs}/day9.input (100%) rename 2020/{template.cpp => misc/day.cpp.template} (91%) create mode 100644 2020/misc/main.cpp create mode 100644 2020/misc/main_test.cpp create mode 100644 2020/misc/print.hpp rename 2020/{ => misc}/types.cpp (100%) rename 2020/{ => misc}/types.hpp (100%) diff --git a/2020/Makefile b/2020/Makefile index ede9575..812ac33 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -1,12 +1,16 @@ -day%.out: out/types.o day%.cpp - g++-10 -std=c++2a $(flags) $(@:out=cpp) out/types.o -o $@ +day%.out: out/types.o misc/main.cpp days/day%.cpp + g++-10 -std=c++2a $(flags) -Dcurrent_day=$(@:.out=) days/$(@:out=cpp) misc/main.cpp out/types.o -o $@ -day%.cpp: - cp template.cpp $@ +day%_test.out: out/types.o misc/main_test.cpp days/day%.cpp + g++-10 -std=c++2a $(flags) -DTEST_BUILD -Dcurrent_day=$(@:_test.out=) days/$(@:_test.out=.cpp) misc/main_test.cpp out/types.o -o $@ -out/types.o: types.hpp types.cpp +days/day%.cpp: + cp 'misc/day.cpp.template' $@ + sed -i -e "s/current_day/$(shell basename $@ | cut -f 1 -d '.')/g" $@ + +out/types.o: misc/types.hpp misc/types.cpp mkdir -p out/ - g++-10 -std=c++2a $(flags) -c types.cpp -o $@ + g++-10 -std=c++2a $(flags) -c misc/types.cpp -o $@ .PHONY: clean clean: diff --git a/2020/day1.cpp b/2020/days/day1.cpp similarity index 87% rename from 2020/day1.cpp rename to 2020/days/day1.cpp index 5eda877..03d3b48 100644 --- a/2020/day1.cpp +++ b/2020/days/day1.cpp @@ -30,7 +30,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" // Find 2 numbers that sum to 2020 auto find_2020_x2(const std::vector & list) -> void { @@ -44,7 +45,7 @@ auto find_2020_x2(const std::vector & list) -> void { --end; } } - std::cout << (list[begin] * list[end]) << std::endl; + print((list[begin] * list[end])); } // Find 3 numbers that sum to 2020 @@ -53,13 +54,13 @@ auto find_2020_x3(const std::vector & list) -> void { for (auto n1 = 1; n1 < list.size() - 1; ++n1) { auto low = n0 + 1; auto high = n1; - auto n2 = (low + high) / 2; - while (low < high - 1) { + while (low < high) { + auto n2 = (low + high) / 2; auto sum = 0; if ((sum = list[n0] + list[n1] + list[n2]) == 2020) { - std::cout << (list[n0] * list[n1] * list[n2]) << std::endl; + print((list[n0] * list[n1] * list[n2])); return; - } else if (sum > 2020) { + } else if (sum < 2020) { low = n2 + 1; } else { high = n2; @@ -69,11 +70,11 @@ auto find_2020_x3(const std::vector & list) -> void { } } -auto main(i32 argc, char * argv[]) -> i32 { +auto day1() -> void { auto list = std::vector(); { auto line = std::string(); - auto file = std::ifstream("day1.input"); + auto file = std::ifstream("inputs/day1.input"); while (getline(file, line)) { list.push_back(std::stoi(line)); } @@ -82,6 +83,4 @@ auto main(i32 argc, char * argv[]) -> i32 { find_2020_x2(list); find_2020_x3(list); - - return 0; } diff --git a/2020/day10.cpp b/2020/days/day10.cpp similarity index 91% rename from 2020/day10.cpp rename to 2020/days/day10.cpp index 9f6fab4..0da5b83 100644 --- a/2020/day10.cpp +++ b/2020/days/day10.cpp @@ -29,7 +29,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" struct Pair { u64 jolt; @@ -40,11 +41,11 @@ auto operator<(const Pair & left, const Pair & right) -> bool { return left.jolt < right.jolt; } -auto main(i32 argc, char * argv[]) -> i32 { +auto day10() -> void { auto jolts = std::vector{{ 0, 1 }}; { auto line = std::string(); - auto file = std::ifstream("day10.input"); + auto file = std::ifstream("inputs/day10.input"); while (getline(file, line)) { jolts.push_back({ (u64) std::stoll(line), 0 }); } @@ -59,7 +60,7 @@ auto main(i32 argc, char * argv[]) -> i32 { else if (jolts[i + 1].jolt - jolts[i].jolt == 3) ++dif3; } - std::cout << (dif1 * dif3) << std::endl; + print((dif1 * dif3)); for (auto i = i32(0); i < jolts.size() - 1; ++i) { for (auto j = i + 1; j < jolts.size(); ++j) { @@ -70,7 +71,5 @@ auto main(i32 argc, char * argv[]) -> i32 { } } } - std::cout << jolts[jolts.size() - 1].count << std::endl; - - return 0; + print(jolts[jolts.size() - 1].count); } diff --git a/2020/day11.cpp b/2020/days/day11.cpp similarity index 94% rename from 2020/day11.cpp rename to 2020/days/day11.cpp index c5aaa78..ecbd826 100644 --- a/2020/day11.cpp +++ b/2020/days/day11.cpp @@ -30,7 +30,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" template auto iterate_seats(const auto & seats, Lambda callback) { @@ -62,12 +63,12 @@ auto count_seats(const auto & seats) -> usize { return occupied; } -auto main(i32 argc, char * argv[]) -> i32 { +auto day11() -> void { auto bit = u8(0b1); auto seats = std::array, 2>(); { auto line = std::string(); - auto file = std::ifstream("day11.input"); + auto file = std::ifstream("inputs/day11.input"); while (getline(file, line)) { seats[bit].push_back(line); } @@ -94,7 +95,7 @@ auto main(i32 argc, char * argv[]) -> i32 { } while (!seats_equal(seats)); - std::cout << count_seats(seats[0]) << std::endl; + print(count_seats(seats[0])); iterate_seats(seats[0], [&seats](i32 i, i32 j) { seats[0][i][j] = seats[1][i][j] = 'L'; @@ -129,7 +130,5 @@ auto main(i32 argc, char * argv[]) -> i32 { }); } while (!seats_equal(seats)); - std::cout << count_seats(seats[0]) << std::endl; - - return 0; + print(count_seats(seats[0])); } diff --git a/2020/day2.cpp b/2020/days/day2.cpp similarity index 91% rename from 2020/day2.cpp rename to 2020/days/day2.cpp index cec8af6..fa57af9 100644 --- a/2020/day2.cpp +++ b/2020/days/day2.cpp @@ -29,7 +29,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" struct Password { u32 min; @@ -72,11 +73,11 @@ auto count_valid_toboggan(const std::vector & passwords) -> u32 { return valid; } -auto main(i32 argc, char * argv[]) -> i32 { +auto day2() -> void { auto passwords = std::vector(); { auto line = std::string(); - auto file = std::ifstream("day2.input"); + auto file = std::ifstream("inputs/day2.input"); while (getline(file, line)) { auto index = usize(0); auto password = Password{}; @@ -88,8 +89,6 @@ auto main(i32 argc, char * argv[]) -> i32 { } } - std::cout << count_valid_sled(passwords) << std::endl; - std::cout << count_valid_toboggan(passwords) << std::endl; - - return 0; + print(count_valid_sled(passwords) ); + print(count_valid_toboggan(passwords)); } diff --git a/2020/day3.cpp b/2020/days/day3.cpp similarity index 60% rename from 2020/day3.cpp rename to 2020/days/day3.cpp index 4c6268b..647d627 100644 --- a/2020/day3.cpp +++ b/2020/days/day3.cpp @@ -29,40 +29,53 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" -auto read_field_and_count_trees(std::vector & trees, usize horizontal_increment, usize vertical_increment) -> u64 { - auto tree_count = u64(0); +struct TreeVector{ usize horz; usize vert; }; +struct Coordinate{ usize x_index; usize y_index; }; - auto x_index = usize(-horizontal_increment); - auto y_index = usize(-1); - auto line = std::string(); - auto file = std::ifstream("day3.input"); - - while (getline(file, line)) { - auto vertical_check = (++y_index % vertical_increment == 0); - tree_count += vertical_check * (line[(x_index += (vertical_check * horizontal_increment)) % line.size()] == '#'); +auto read_field_and_count_trees(const std::vector & vectors) -> std::vector { + auto tree_counts = std::vector(vectors.size()); + auto coords = std::vector(vectors.size()); + for (auto i = usize(0); i < coords.size(); ++i) { + coords[i] = { usize(-vectors[i].horz), usize(-1) }; } - return tree_count; + auto line = std::string(); + auto file = std::ifstream("inputs/day3.input"); + + while (getline(file, line)) { + for (auto i = usize(0); i < vectors.size(); ++i) { + auto & vector = vectors[i]; + auto & coord = coords[i]; + + auto vertical_check = (++coord.y_index % vector.vert == 0); + tree_counts[i] += vertical_check * (line[(coord.x_index += (vertical_check * vector.horz)) % line.size()] == '#'); + } + } + + return std::move(tree_counts); } -auto main(i32 argc, char ** argv) -> i32 { +auto day3() -> void { auto trees = std::vector(); - auto tree_counts = std::vector(); + auto tree_counts = read_field_and_count_trees( + std::vector{ + { 3, 1 }, + { 1, 1 }, + { 5, 1 }, + { 7, 1 }, + { 1, 2 }, + } + ); - tree_counts.push_back(read_field_and_count_trees(trees, 3, 1)); - std::cout << tree_counts[0] << std::endl; + print(tree_counts[0]); - tree_counts.push_back(read_field_and_count_trees(trees, 1, 1)); - tree_counts.push_back(read_field_and_count_trees(trees, 5, 1)); - tree_counts.push_back(read_field_and_count_trees(trees, 7, 1)); - tree_counts.push_back(read_field_and_count_trees(trees, 1, 2)); auto tree_count_product = u64(1); for (auto tree_count : tree_counts) { tree_count_product *= tree_count; } - std::cout << tree_count_product << std::endl; - return 0; + print(tree_count_product); } diff --git a/2020/day4.cpp b/2020/days/day4.cpp similarity index 95% rename from 2020/day4.cpp rename to 2020/days/day4.cpp index f0c5b78..1ba17f8 100644 --- a/2020/day4.cpp +++ b/2020/days/day4.cpp @@ -29,7 +29,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" struct KeyValue { std::string key; @@ -46,13 +47,13 @@ auto try_num(const std::string & passport, usize index) -> bool { return Min <= num && num <= Max; }; -auto main(i32 argc, char * argv[]) -> i32 { +auto day4() -> void { auto valid_count1 = usize(0); auto valid_count2 = usize(0); auto passport = std::string(); auto line = std::string(); - auto file = std::ifstream("day4.input"); + auto file = std::ifstream("inputs/day4.input"); while (getline(file, line)) { if (line == "") { auto elements = std::vector{ @@ -108,7 +109,6 @@ auto main(i32 argc, char * argv[]) -> i32 { } } - std::cout << valid_count1 << ", " << valid_count2 << std::endl; - - return 0; + print(valid_count1); + print(valid_count2); } diff --git a/2020/day5.cpp b/2020/days/day5.cpp similarity index 90% rename from 2020/day5.cpp rename to 2020/days/day5.cpp index 70d3d35..5a68158 100644 --- a/2020/day5.cpp +++ b/2020/days/day5.cpp @@ -30,12 +30,13 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" -auto main(i32 argc, char * argv[]) -> i32 { +auto day5() -> void { auto seat = usize(0); auto line = std::string(); - auto file = std::ifstream("day5.input"); + auto file = std::ifstream("inputs/day5.input"); auto seats = std::vector(); @@ -49,16 +50,14 @@ auto main(i32 argc, char * argv[]) -> i32 { } seats.push_back(local_seat); } - std::cout << seat << std::endl; + print(seat); std::sort(seats.begin(), seats.end()); for (auto i = usize(0); i < seats.size() - 1; ++i) { if (seats[i] + 2 == seats[i + 1]) { - std::cout << (seats[i] + 1) << std::endl; + print((seats[i] + 1)); break; } } - - return 0; } diff --git a/2020/day6.cpp b/2020/days/day6.cpp similarity index 91% rename from 2020/day6.cpp rename to 2020/days/day6.cpp index ae1035b..b3a3dbe 100644 --- a/2020/day6.cpp +++ b/2020/days/day6.cpp @@ -29,12 +29,13 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" -auto main(i32 argc, char * argv[]) -> i32 { +auto day6() -> void { { auto line = std::string(); - auto file = std::ifstream("day6.input"); + auto file = std::ifstream("inputs/day6.input"); auto answers = std::vector(26); @@ -57,8 +58,7 @@ auto main(i32 argc, char * argv[]) -> i32 { } } } - std::cout << sum_1 << ", " << sum_2 << std::endl; + print(sum_1); + print(sum_2); } - - return 0; } diff --git a/2020/day7.cpp b/2020/days/day7.cpp similarity index 93% rename from 2020/day7.cpp rename to 2020/days/day7.cpp index 97991ea..8c2d8cc 100644 --- a/2020/day7.cpp +++ b/2020/days/day7.cpp @@ -32,7 +32,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" struct SubBag { std::string type; u32 count; }; @@ -60,11 +61,11 @@ auto count_to(const std::string & search, std::map & map) -> return counted; } -auto main(i32 argc, char * argv[]) -> i32 { +auto day7() -> void { auto bag_graph = std::map(); { auto line = std::string(); - auto file = std::ifstream("day7.input"); + auto file = std::ifstream("inputs/day7.input"); while (getline(file, line)) { auto find = line.find("bag") - 1; auto bag_type = line.substr(0, line.find("bag") - 1); @@ -96,9 +97,7 @@ auto main(i32 argc, char * argv[]) -> i32 { } } } - std::cout << seen.size() << std::endl; + print(seen.size()); - std::cout << (count_to("shiny gold", bag_graph) - 1) << std::endl; - - return 0; + print((count_to("shiny gold", bag_graph) - 1)); } diff --git a/2020/day8.cpp b/2020/days/day8.cpp similarity index 94% rename from 2020/day8.cpp rename to 2020/days/day8.cpp index 030bceb..0d770cd 100644 --- a/2020/day8.cpp +++ b/2020/days/day8.cpp @@ -29,7 +29,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" enum OpCode { Acc, Jmp, Nop }; struct Op{ OpCode code; i32 num; bool executed; }; @@ -81,11 +82,11 @@ auto attempt_swap(State & state, std::vector & ops) -> bool { return false; } -auto main(i32 argc, char * argv[]) -> i32 { +auto day8() -> void { auto ops = std::vector(); { auto line = std::string(); - auto file = std::ifstream("day8.input"); + auto file = std::ifstream("inputs/day8.input"); while (getline(file, line)) { ops.push_back(extract_op(line)); } @@ -95,18 +96,16 @@ auto main(i32 argc, char * argv[]) -> i32 { while (!ops[state.isp].executed) { execute(state, ops); } - std::cout << state.acc << std::endl; + print(state.acc); for (auto & op : ops) { op.executed = false; } state = State{ 0, 0 }; for (;;) { if (attempt_swap(state, ops)) { - std::cout << state.acc << std::endl; + print(state.acc); break; } execute(state, ops); } - - return 0; } diff --git a/2020/day9.cpp b/2020/days/day9.cpp similarity index 92% rename from 2020/day9.cpp rename to 2020/days/day9.cpp index 1668fd5..987fc9c 100644 --- a/2020/day9.cpp +++ b/2020/days/day9.cpp @@ -29,7 +29,8 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" auto find_sum(usize index, std::vector xmas) { for (auto i = index - 25; i < index - 1; ++i) { @@ -42,10 +43,10 @@ auto find_sum(usize index, std::vector xmas) { return false; } -auto main(i32 argc, char * argv[]) -> i32 { +auto day9() -> void { auto xmas = std::vector(); auto line = std::string(); - auto file = std::ifstream("day9.input"); + auto file = std::ifstream("inputs/day9.input"); while (getline(file, line)) { xmas.push_back(std::stoll(line)); } @@ -53,7 +54,7 @@ auto main(i32 argc, char * argv[]) -> i32 { auto invalid = u64(0); for (auto i = usize(25); i < xmas.size(); ++i) { if (!find_sum(i, xmas)) { - std::cout << (invalid = xmas[i]) << std::endl; + print((invalid = xmas[i])); break; } } @@ -82,7 +83,5 @@ auto main(i32 argc, char * argv[]) -> i32 { max = xmas[i]; } } - std::cout << (min + max) << std::endl; - - return 0; + print((min + max)); } diff --git a/2020/day1.input b/2020/inputs/day1.input similarity index 100% rename from 2020/day1.input rename to 2020/inputs/day1.input diff --git a/2020/day10.input b/2020/inputs/day10.input similarity index 100% rename from 2020/day10.input rename to 2020/inputs/day10.input diff --git a/2020/day11.input b/2020/inputs/day11.input similarity index 100% rename from 2020/day11.input rename to 2020/inputs/day11.input diff --git a/2020/day2.input b/2020/inputs/day2.input similarity index 100% rename from 2020/day2.input rename to 2020/inputs/day2.input diff --git a/2020/day3.input b/2020/inputs/day3.input similarity index 100% rename from 2020/day3.input rename to 2020/inputs/day3.input diff --git a/2020/day4.input b/2020/inputs/day4.input similarity index 100% rename from 2020/day4.input rename to 2020/inputs/day4.input diff --git a/2020/day5.input b/2020/inputs/day5.input similarity index 100% rename from 2020/day5.input rename to 2020/inputs/day5.input diff --git a/2020/day6.input b/2020/inputs/day6.input similarity index 100% rename from 2020/day6.input rename to 2020/inputs/day6.input diff --git a/2020/day7.input b/2020/inputs/day7.input similarity index 100% rename from 2020/day7.input rename to 2020/inputs/day7.input diff --git a/2020/day8.input b/2020/inputs/day8.input similarity index 100% rename from 2020/day8.input rename to 2020/inputs/day8.input diff --git a/2020/day9.input b/2020/inputs/day9.input similarity index 100% rename from 2020/day9.input rename to 2020/inputs/day9.input diff --git a/2020/template.cpp b/2020/misc/day.cpp.template similarity index 91% rename from 2020/template.cpp rename to 2020/misc/day.cpp.template index 51a940b..52dfe9d 100644 --- a/2020/template.cpp +++ b/2020/misc/day.cpp.template @@ -29,16 +29,15 @@ #include #include -#include "types.hpp" +#include "../misc/types.hpp" +#include "../misc/print.hpp" -auto main(i32 argc, char * argv[]) -> i32 { +auto current_day() -> void { { auto line = std::string(); - auto file = std::ifstream("dayNUM.input"); + auto file = std::ifstream("inputs/current_day.input"); while (getline(file, line)) { } } - - return 0; } diff --git a/2020/misc/main.cpp b/2020/misc/main.cpp new file mode 100644 index 0000000..c4752db --- /dev/null +++ b/2020/misc/main.cpp @@ -0,0 +1,36 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include "types.hpp" + +extern auto current_day() -> void; + +auto main(i32 argc, char * argv[]) -> i32 { + current_day(); + + return 0; +} + diff --git a/2020/misc/main_test.cpp b/2020/misc/main_test.cpp new file mode 100644 index 0000000..0d8954d --- /dev/null +++ b/2020/misc/main_test.cpp @@ -0,0 +1,66 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include + +#include "types.hpp" + +extern auto current_day() -> void; + +auto main(i32 argc, char * argv[]) -> i32 { + auto TEST_CYCLES = 1; + if (argc >= 2) { + TEST_CYCLES = std::stoi(argv[1]); + } + + std::cout << "Starting test with " << TEST_CYCLES << " iterations..." << std::endl; + auto begin1 = std::chrono::high_resolution_clock::now(); + + for (auto i = usize(0); i < TEST_CYCLES; ++i) { + current_day(); + } + + auto end1 = std::chrono::high_resolution_clock::now(); + + if (argc >= 3) { + if (argv[2] == std::string("millis")) { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " milliseconds"<< std::endl; + } else if (argv[2] == std::string("nanos")) { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " nanoseconds"<< std::endl; + } else if (argv[2] == std::string("micros")) { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " microsenconds"<< std::endl; + } else { + std::cout << "Unkown time scale '" << argv[2] << "'" << std::endl; + } + } else { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " microseconds"<< std::endl; + } + + return 0; +} + diff --git a/2020/misc/print.hpp b/2020/misc/print.hpp new file mode 100644 index 0000000..5960cd8 --- /dev/null +++ b/2020/misc/print.hpp @@ -0,0 +1,31 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#ifndef TEST_BUILD +#define print(x) std::cout << (x) << std::endl +#else +#define print(x) +#endif diff --git a/2020/types.cpp b/2020/misc/types.cpp similarity index 100% rename from 2020/types.cpp rename to 2020/misc/types.cpp diff --git a/2020/types.hpp b/2020/misc/types.hpp similarity index 100% rename from 2020/types.hpp rename to 2020/misc/types.hpp From cdb1943e3ddcfc20c8990a88768cd581b3f502bb Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 11 Dec 2020 09:29:57 -0800 Subject: [PATCH 32/52] Updated make clean rule --- 2020/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2020/Makefile b/2020/Makefile index 812ac33..3860638 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -14,4 +14,4 @@ out/types.o: misc/types.hpp misc/types.cpp .PHONY: clean clean: - rm out/* day*.out day*.output + rm -f out/* day*.out day*.output From 0701aec56941b45dd5dff9fe8599e8e03588015e Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 11 Dec 2020 21:33:26 -0800 Subject: [PATCH 33/52] Completed day 12 --- 2020/days/day12.cpp | 104 ++++++ 2020/inputs/day12.input | 748 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 852 insertions(+) create mode 100644 2020/days/day12.cpp create mode 100644 2020/inputs/day12.input diff --git a/2020/days/day12.cpp b/2020/days/day12.cpp new file mode 100644 index 0000000..cc0ee01 --- /dev/null +++ b/2020/days/day12.cpp @@ -0,0 +1,104 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +struct Instruction{ char op; i32 num; }; + +auto day12() -> void { + auto instructions = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day12.input"); + while (getline(file, line)) { + instructions.push_back({ line[0], std::stoi(line.substr(1, line.size() - 1)) }); + if (line[0] == 'L' || line[0] == 'R') { + instructions[instructions.size() - 1].num /= 90; + } + } + } + + { + auto ship_x = i32(0); + auto ship_y = i32(0); + auto direction = i32(2); + for (const auto & instruction : instructions) { + switch (instruction.op) { + case 'N': ship_y += instruction.num; break; + case 'E': ship_x += instruction.num; break; + case 'S': ship_y -= instruction.num; break; + case 'W': ship_x -= instruction.num; break; + case 'R': direction = (direction - instruction.num + 4) % 4; break; + case 'L': direction = (direction + instruction.num ) % 4; break; + case 'F': + ship_x += ((direction - 1) % 2) * instruction.num; + ship_y += ((direction - 2) % 2) * instruction.num; + break; + } + } + print((std::abs(ship_x) + std::abs(ship_y))); + } + + { + auto ship_x = i32(0); + auto ship_y = i32(0); + auto waypoint_x = i32(10); + auto waypoint_y = i32( 1); + for (const auto & instruction : instructions) { + switch (instruction.op) { + case 'N': waypoint_y += instruction.num; break; + case 'E': waypoint_x += instruction.num; break; + case 'S': waypoint_y -= instruction.num; break; + case 'W': waypoint_x -= instruction.num; break; + case 'R': + for (auto i = i32(0); i < instruction.num; ++i) { + auto copy = waypoint_x; + waypoint_x = waypoint_y; + waypoint_y = -copy; + } + break; + case 'L': + for (auto i = i32(0); i < instruction.num; ++i) { + auto copy = waypoint_x; + waypoint_x = -waypoint_y; + waypoint_y = copy; + } + break; + case 'F': + ship_x += waypoint_x * instruction.num; + ship_y += waypoint_y * instruction.num; + break; + } + } + print((std::abs(ship_x) + std::abs(ship_y))); + } +} diff --git a/2020/inputs/day12.input b/2020/inputs/day12.input new file mode 100644 index 0000000..31d6bc8 --- /dev/null +++ b/2020/inputs/day12.input @@ -0,0 +1,748 @@ +W5 +R90 +W3 +F98 +F87 +R90 +F57 +R180 +F3 +L90 +F60 +N3 +F94 +N3 +E2 +S2 +W2 +L90 +F26 +R90 +W1 +F58 +S5 +F22 +N3 +F95 +N1 +W1 +F11 +R180 +S3 +R270 +N1 +N1 +E4 +S3 +F81 +W2 +S2 +L90 +S4 +R90 +S1 +E1 +L90 +S4 +E2 +F72 +S1 +W1 +F73 +W4 +L180 +S1 +W5 +S5 +R90 +E3 +N3 +F28 +N1 +F84 +R90 +E5 +F13 +W5 +L90 +F11 +E4 +F63 +S1 +S2 +L90 +N3 +S5 +F20 +W1 +S4 +W1 +S2 +F67 +N1 +R180 +F11 +E1 +R90 +S2 +R90 +F38 +S5 +F27 +S5 +W3 +S3 +L90 +N2 +W2 +S1 +N4 +R90 +E1 +F16 +L90 +E4 +N1 +L90 +F89 +E5 +F90 +E1 +L180 +N1 +E3 +S2 +F58 +S3 +F53 +R90 +F100 +W1 +F53 +W5 +L90 +W3 +N4 +F54 +R180 +S2 +E2 +F63 +L90 +S4 +F40 +F90 +N3 +F83 +E5 +F35 +W4 +W5 +S3 +E2 +S2 +S1 +F12 +L90 +S1 +F41 +R90 +S3 +R90 +F66 +S2 +F34 +N5 +R90 +E5 +R90 +F25 +N5 +R90 +W1 +S2 +S2 +R90 +E3 +R90 +F95 +N3 +W2 +S4 +R90 +E3 +L90 +E3 +R90 +N2 +F84 +L90 +N2 +R90 +S1 +L90 +F93 +L90 +F60 +S4 +F85 +S2 +F84 +R180 +W5 +N4 +W5 +R270 +S2 +E2 +L180 +W4 +R180 +W5 +F56 +E1 +F45 +W4 +R90 +L180 +S1 +W4 +S5 +F87 +R180 +S2 +F76 +R90 +F76 +S1 +E4 +F6 +S1 +E2 +F47 +S3 +W2 +F16 +F75 +E3 +F75 +E4 +R90 +N5 +W3 +F1 +S1 +F8 +E2 +F64 +R90 +W4 +S5 +R90 +N5 +R90 +E2 +N1 +E1 +L180 +F31 +L180 +E5 +L90 +N3 +R90 +F77 +E3 +F65 +E4 +R90 +W1 +N3 +E3 +F4 +R90 +E3 +N4 +F28 +R180 +N2 +L90 +S2 +L90 +N1 +W1 +L180 +E4 +F51 +W4 +F9 +S4 +R90 +W5 +S4 +R90 +E3 +W2 +F44 +R90 +E1 +L180 +S4 +F93 +S2 +F58 +R90 +F80 +L90 +E2 +F20 +R90 +F19 +S4 +F22 +W1 +S2 +F62 +N2 +E5 +F21 +L90 +F16 +W2 +F58 +E2 +F54 +N1 +F83 +N3 +E2 +F62 +S3 +L90 +E3 +L270 +F29 +N5 +L90 +S2 +F19 +E5 +R180 +F87 +R180 +S2 +F22 +W3 +S5 +F35 +E3 +N5 +R180 +E2 +R270 +N3 +F5 +L90 +W3 +S1 +L90 +S2 +R270 +N5 +L180 +F79 +N3 +F82 +N3 +F73 +N4 +F57 +L90 +W3 +F26 +N4 +E5 +N4 +F48 +R90 +F62 +R90 +F36 +E1 +F76 +R90 +N3 +F83 +E5 +L90 +S1 +F1 +E1 +L90 +F67 +W3 +L90 +F42 +E4 +S2 +L180 +F89 +N1 +E4 +S4 +W1 +S2 +L90 +F91 +R90 +F78 +N5 +F29 +W2 +R90 +W1 +R90 +E2 +F40 +E2 +F76 +R90 +E4 +L90 +W3 +S1 +W3 +N4 +F81 +W4 +F22 +N1 +W1 +F47 +E3 +R90 +N5 +W4 +L90 +F44 +L90 +F58 +S1 +R90 +E3 +F91 +N1 +W4 +N5 +L90 +F60 +F8 +S4 +F17 +E5 +N2 +L90 +F37 +L180 +W4 +L180 +W4 +F93 +S5 +F71 +R90 +N5 +E3 +F20 +R90 +N5 +E5 +R90 +S2 +R180 +S5 +L90 +F26 +E4 +F49 +E5 +S4 +E4 +N1 +L180 +F33 +E1 +L90 +S4 +E5 +N5 +L180 +F60 +S1 +F53 +W1 +F34 +E2 +N3 +E2 +S5 +F61 +F32 +F18 +L90 +W4 +N4 +R90 +E4 +L90 +F26 +S3 +W4 +S5 +E5 +S2 +R90 +S5 +R90 +E2 +R90 +N2 +S3 +L90 +S3 +S2 +L90 +E5 +F31 +R180 +E2 +F42 +R90 +W4 +L90 +E5 +S3 +F79 +R90 +F76 +W1 +F9 +N1 +F91 +R90 +N3 +F32 +L180 +N4 +W2 +F18 +N5 +L90 +S4 +L180 +F22 +E4 +R180 +S2 +L90 +W5 +F31 +L180 +E1 +F15 +W1 +S5 +E4 +F56 +L90 +F7 +S3 +E4 +F13 +R90 +S4 +F78 +R180 +E3 +N1 +R90 +W4 +F29 +S4 +L90 +S4 +W4 +L180 +F6 +F84 +E4 +L90 +F29 +E2 +F75 +E3 +N4 +F33 +L270 +S4 +F62 +E2 +N4 +F50 +E1 +E2 +L270 +F100 +R180 +S2 +F89 +N2 +W3 +F5 +E5 +N2 +F75 +S3 +F2 +S4 +W3 +F33 +S5 +R90 +E5 +F20 +S1 +L90 +S4 +F10 +W5 +S2 +L90 +E3 +E1 +S3 +F41 +E5 +L90 +F28 +S2 +F40 +S2 +S4 +N1 +F15 +W5 +W2 +R270 +E5 +R90 +E4 +F50 +R90 +S4 +E1 +N4 +F73 +L90 +W2 +L270 +E4 +S1 +F30 +S3 +W4 +L180 +W4 +F6 +R90 +F43 +N5 +W3 +W3 +R90 +S2 +R90 +F50 +W2 +S4 +L90 +L180 +W1 +L270 +E3 +N2 +E2 +F48 +W1 +L90 +N4 +L90 +E3 +F86 +L180 +F10 +S1 +F36 +S4 +F33 +N5 +L90 +F14 +S2 +E4 +N4 +R90 +S2 +W2 +N2 +L180 +N4 +R90 +L90 +E5 +S1 +F82 +W1 +S1 +F19 +E3 +F19 +S2 +W1 +F18 +L90 +F43 +W1 +N2 +E3 +L90 +S1 +F75 +L90 +E4 +F80 +N5 +F15 +F53 +N4 +E5 +L90 +E1 +W5 +R270 +F17 +F63 +W2 +F20 +E1 +S3 +F19 +E1 +F99 +S1 +W1 +F23 +L180 +S3 +W4 +F76 From 13de5b3dcdce4e8b669646afa112e723831565f2 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 11 Dec 2020 21:33:26 -0800 Subject: [PATCH 34/52] Completed day 12 --- 2020/days/day12.cpp | 104 ++++++ 2020/inputs/day12.input | 748 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 852 insertions(+) create mode 100644 2020/days/day12.cpp create mode 100644 2020/inputs/day12.input diff --git a/2020/days/day12.cpp b/2020/days/day12.cpp new file mode 100644 index 0000000..cc0ee01 --- /dev/null +++ b/2020/days/day12.cpp @@ -0,0 +1,104 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +struct Instruction{ char op; i32 num; }; + +auto day12() -> void { + auto instructions = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day12.input"); + while (getline(file, line)) { + instructions.push_back({ line[0], std::stoi(line.substr(1, line.size() - 1)) }); + if (line[0] == 'L' || line[0] == 'R') { + instructions[instructions.size() - 1].num /= 90; + } + } + } + + { + auto ship_x = i32(0); + auto ship_y = i32(0); + auto direction = i32(2); + for (const auto & instruction : instructions) { + switch (instruction.op) { + case 'N': ship_y += instruction.num; break; + case 'E': ship_x += instruction.num; break; + case 'S': ship_y -= instruction.num; break; + case 'W': ship_x -= instruction.num; break; + case 'R': direction = (direction - instruction.num + 4) % 4; break; + case 'L': direction = (direction + instruction.num ) % 4; break; + case 'F': + ship_x += ((direction - 1) % 2) * instruction.num; + ship_y += ((direction - 2) % 2) * instruction.num; + break; + } + } + print((std::abs(ship_x) + std::abs(ship_y))); + } + + { + auto ship_x = i32(0); + auto ship_y = i32(0); + auto waypoint_x = i32(10); + auto waypoint_y = i32( 1); + for (const auto & instruction : instructions) { + switch (instruction.op) { + case 'N': waypoint_y += instruction.num; break; + case 'E': waypoint_x += instruction.num; break; + case 'S': waypoint_y -= instruction.num; break; + case 'W': waypoint_x -= instruction.num; break; + case 'R': + for (auto i = i32(0); i < instruction.num; ++i) { + auto copy = waypoint_x; + waypoint_x = waypoint_y; + waypoint_y = -copy; + } + break; + case 'L': + for (auto i = i32(0); i < instruction.num; ++i) { + auto copy = waypoint_x; + waypoint_x = -waypoint_y; + waypoint_y = copy; + } + break; + case 'F': + ship_x += waypoint_x * instruction.num; + ship_y += waypoint_y * instruction.num; + break; + } + } + print((std::abs(ship_x) + std::abs(ship_y))); + } +} diff --git a/2020/inputs/day12.input b/2020/inputs/day12.input new file mode 100644 index 0000000..31d6bc8 --- /dev/null +++ b/2020/inputs/day12.input @@ -0,0 +1,748 @@ +W5 +R90 +W3 +F98 +F87 +R90 +F57 +R180 +F3 +L90 +F60 +N3 +F94 +N3 +E2 +S2 +W2 +L90 +F26 +R90 +W1 +F58 +S5 +F22 +N3 +F95 +N1 +W1 +F11 +R180 +S3 +R270 +N1 +N1 +E4 +S3 +F81 +W2 +S2 +L90 +S4 +R90 +S1 +E1 +L90 +S4 +E2 +F72 +S1 +W1 +F73 +W4 +L180 +S1 +W5 +S5 +R90 +E3 +N3 +F28 +N1 +F84 +R90 +E5 +F13 +W5 +L90 +F11 +E4 +F63 +S1 +S2 +L90 +N3 +S5 +F20 +W1 +S4 +W1 +S2 +F67 +N1 +R180 +F11 +E1 +R90 +S2 +R90 +F38 +S5 +F27 +S5 +W3 +S3 +L90 +N2 +W2 +S1 +N4 +R90 +E1 +F16 +L90 +E4 +N1 +L90 +F89 +E5 +F90 +E1 +L180 +N1 +E3 +S2 +F58 +S3 +F53 +R90 +F100 +W1 +F53 +W5 +L90 +W3 +N4 +F54 +R180 +S2 +E2 +F63 +L90 +S4 +F40 +F90 +N3 +F83 +E5 +F35 +W4 +W5 +S3 +E2 +S2 +S1 +F12 +L90 +S1 +F41 +R90 +S3 +R90 +F66 +S2 +F34 +N5 +R90 +E5 +R90 +F25 +N5 +R90 +W1 +S2 +S2 +R90 +E3 +R90 +F95 +N3 +W2 +S4 +R90 +E3 +L90 +E3 +R90 +N2 +F84 +L90 +N2 +R90 +S1 +L90 +F93 +L90 +F60 +S4 +F85 +S2 +F84 +R180 +W5 +N4 +W5 +R270 +S2 +E2 +L180 +W4 +R180 +W5 +F56 +E1 +F45 +W4 +R90 +L180 +S1 +W4 +S5 +F87 +R180 +S2 +F76 +R90 +F76 +S1 +E4 +F6 +S1 +E2 +F47 +S3 +W2 +F16 +F75 +E3 +F75 +E4 +R90 +N5 +W3 +F1 +S1 +F8 +E2 +F64 +R90 +W4 +S5 +R90 +N5 +R90 +E2 +N1 +E1 +L180 +F31 +L180 +E5 +L90 +N3 +R90 +F77 +E3 +F65 +E4 +R90 +W1 +N3 +E3 +F4 +R90 +E3 +N4 +F28 +R180 +N2 +L90 +S2 +L90 +N1 +W1 +L180 +E4 +F51 +W4 +F9 +S4 +R90 +W5 +S4 +R90 +E3 +W2 +F44 +R90 +E1 +L180 +S4 +F93 +S2 +F58 +R90 +F80 +L90 +E2 +F20 +R90 +F19 +S4 +F22 +W1 +S2 +F62 +N2 +E5 +F21 +L90 +F16 +W2 +F58 +E2 +F54 +N1 +F83 +N3 +E2 +F62 +S3 +L90 +E3 +L270 +F29 +N5 +L90 +S2 +F19 +E5 +R180 +F87 +R180 +S2 +F22 +W3 +S5 +F35 +E3 +N5 +R180 +E2 +R270 +N3 +F5 +L90 +W3 +S1 +L90 +S2 +R270 +N5 +L180 +F79 +N3 +F82 +N3 +F73 +N4 +F57 +L90 +W3 +F26 +N4 +E5 +N4 +F48 +R90 +F62 +R90 +F36 +E1 +F76 +R90 +N3 +F83 +E5 +L90 +S1 +F1 +E1 +L90 +F67 +W3 +L90 +F42 +E4 +S2 +L180 +F89 +N1 +E4 +S4 +W1 +S2 +L90 +F91 +R90 +F78 +N5 +F29 +W2 +R90 +W1 +R90 +E2 +F40 +E2 +F76 +R90 +E4 +L90 +W3 +S1 +W3 +N4 +F81 +W4 +F22 +N1 +W1 +F47 +E3 +R90 +N5 +W4 +L90 +F44 +L90 +F58 +S1 +R90 +E3 +F91 +N1 +W4 +N5 +L90 +F60 +F8 +S4 +F17 +E5 +N2 +L90 +F37 +L180 +W4 +L180 +W4 +F93 +S5 +F71 +R90 +N5 +E3 +F20 +R90 +N5 +E5 +R90 +S2 +R180 +S5 +L90 +F26 +E4 +F49 +E5 +S4 +E4 +N1 +L180 +F33 +E1 +L90 +S4 +E5 +N5 +L180 +F60 +S1 +F53 +W1 +F34 +E2 +N3 +E2 +S5 +F61 +F32 +F18 +L90 +W4 +N4 +R90 +E4 +L90 +F26 +S3 +W4 +S5 +E5 +S2 +R90 +S5 +R90 +E2 +R90 +N2 +S3 +L90 +S3 +S2 +L90 +E5 +F31 +R180 +E2 +F42 +R90 +W4 +L90 +E5 +S3 +F79 +R90 +F76 +W1 +F9 +N1 +F91 +R90 +N3 +F32 +L180 +N4 +W2 +F18 +N5 +L90 +S4 +L180 +F22 +E4 +R180 +S2 +L90 +W5 +F31 +L180 +E1 +F15 +W1 +S5 +E4 +F56 +L90 +F7 +S3 +E4 +F13 +R90 +S4 +F78 +R180 +E3 +N1 +R90 +W4 +F29 +S4 +L90 +S4 +W4 +L180 +F6 +F84 +E4 +L90 +F29 +E2 +F75 +E3 +N4 +F33 +L270 +S4 +F62 +E2 +N4 +F50 +E1 +E2 +L270 +F100 +R180 +S2 +F89 +N2 +W3 +F5 +E5 +N2 +F75 +S3 +F2 +S4 +W3 +F33 +S5 +R90 +E5 +F20 +S1 +L90 +S4 +F10 +W5 +S2 +L90 +E3 +E1 +S3 +F41 +E5 +L90 +F28 +S2 +F40 +S2 +S4 +N1 +F15 +W5 +W2 +R270 +E5 +R90 +E4 +F50 +R90 +S4 +E1 +N4 +F73 +L90 +W2 +L270 +E4 +S1 +F30 +S3 +W4 +L180 +W4 +F6 +R90 +F43 +N5 +W3 +W3 +R90 +S2 +R90 +F50 +W2 +S4 +L90 +L180 +W1 +L270 +E3 +N2 +E2 +F48 +W1 +L90 +N4 +L90 +E3 +F86 +L180 +F10 +S1 +F36 +S4 +F33 +N5 +L90 +F14 +S2 +E4 +N4 +R90 +S2 +W2 +N2 +L180 +N4 +R90 +L90 +E5 +S1 +F82 +W1 +S1 +F19 +E3 +F19 +S2 +W1 +F18 +L90 +F43 +W1 +N2 +E3 +L90 +S1 +F75 +L90 +E4 +F80 +N5 +F15 +F53 +N4 +E5 +L90 +E1 +W5 +R270 +F17 +F63 +W2 +F20 +E1 +S3 +F19 +E1 +F99 +S1 +W1 +F23 +L180 +S3 +W4 +F76 From 16fbe23142083a083291c27d9c0f3fa452884a83 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Sun, 13 Dec 2020 23:08:32 -0800 Subject: [PATCH 35/52] Completed day 13 p1 and day 14 --- 2020/days/day13.cpp | 106 ++++++++ 2020/days/day14.cpp | 112 ++++++++ 2020/inputs/day13.input | 3 + 2020/inputs/day14.input | 556 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 777 insertions(+) create mode 100644 2020/days/day13.cpp create mode 100644 2020/days/day14.cpp create mode 100644 2020/inputs/day13.input create mode 100644 2020/inputs/day14.input diff --git a/2020/days/day13.cpp b/2020/days/day13.cpp new file mode 100644 index 0000000..576af53 --- /dev/null +++ b/2020/days/day13.cpp @@ -0,0 +1,106 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +struct Pair{ u64 id; usize index; }; + +auto find_least(u64 new_base, u64 new_loop, u64 req_base, u64 req_loop, u64 iter) -> u64 { + while ((new_base + ++iter * new_loop - req_base) % req_loop != 0); + return new_base + iter * new_loop; +} + +auto day13() -> void { + auto ready = usize(0); + auto buses = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day13.input"); + getline(file, line); + ready = std::stoi(line); + getline(file, line); + auto start = usize(0); + auto end = usize(0); + auto index = usize(0); + auto id = std::string(); + while ((end = line.find(',', start)) != std::string::npos) { + id = line.substr(start, end - start); + if (id != "x") { + buses.push_back({ u64(std::stoi(line.substr(start, end - start))), index }); + } + start = end + 1; + ++index; + } + end = line.size(); + id = line.substr(start, end - start); + if (id != "x") { + buses.push_back({ u64(std::stoi(line.substr(start, end - start))), index }); + } + } + + auto id = buses[0].id; + auto minutes = buses[0].id - (ready % buses[0].id); + for (auto i = usize(1); i < buses.size(); ++i) { + auto local_minutes = buses[i].id - (ready % buses[i].id); + if (local_minutes < minutes) { + id = buses[i].id; + minutes = local_minutes; + } + } + print((id * minutes)); + + auto req_base = usize(0); + auto req_loop = usize(1); + for (auto i = usize(1); i < buses.size(); ++i) { + auto base_loop = usize(-1); + while ((++base_loop * buses[0].id + buses[i].index) % buses[i].id != 0); + + auto rep_loop = usize(0); + while ((++rep_loop * buses[0].id) % buses[i].id != 0); + + req_base = find_least(base_loop, rep_loop, req_base, req_loop, -1); + if (i < buses.size() - 1) { + req_loop = find_least(0, rep_loop, 0, req_loop, 0); + } + /* + required_base (rqb), required_loop (rql) + + base_loop (bl), repeat_loop (rl) + + rqb + a0 * rql = bl + a1 * rl < minimize and store in required loop + a0 = (bl + a1 * rl - rqb) / rql + + b0 * rql = b1 * rl < minimize and store in required loop + */ + } + print((req_base * buses[0].id)); +} diff --git a/2020/days/day14.cpp b/2020/days/day14.cpp new file mode 100644 index 0000000..a38fbd6 --- /dev/null +++ b/2020/days/day14.cpp @@ -0,0 +1,112 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +struct Op{ u8 op; u64 num1; u64 num2; }; + +auto set_memory(std::map & map, u64 addr, const std::vector & maskX, usize index, u64 value) -> void { + while (++index < maskX.size() && !maskX[index]); + if (index == maskX.size()) { + map.insert_or_assign(addr, value); + } else { + set_memory(map, addr, maskX, index, value); + set_memory(map, addr ^ (u64(1) << (maskX.size() - index - 1)), maskX, index, value); + } +} + +auto day14() -> void { + auto ops = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day14.input"); + while (getline(file, line)) { + if (line.find("mask") != std::string::npos) { + auto mask0 = u64(-1); + auto mask1 = u64( 0); + for (auto i = usize(7); i < line.size(); ++i) { + if (line[i] == '0') { + mask0 ^= (u64(1) << (42 - i)); + } else if (line[i] == '1') { + mask1 ^= (u64(1) << (42 - i)); + } + } + ops.push_back({ 0, mask0, mask1 }); + } else { + auto value = line.find("=") + 2; + ops.push_back({ + 1, + u64(std::stoll(line.substr(4, line.find("]") - 4))), + u64(std::stoll(line.substr(value, line.size() - value))) + }); + } + } + } + auto mask0 = u64(-1); + auto mask1 = u64( 0); + auto memory = std::map(); + for (auto op : ops) { + if (op.op == 0) { + mask0 = op.num1; + mask1 = op.num2; + } else { + memory.insert_or_assign(op.num1, (op.num2 & mask0) | mask1); + } + } + auto sum = u64(0); + for(auto mem : memory) { + sum += mem.second; + } + print(sum); + + mask1 = u64(0); + memory = std::map(); + auto maskX = std::vector(36); + for (auto op : ops) { + if (op.op == 0) { + mask1 = op.num2; + for (auto i = usize(0); i < maskX.size(); ++i) { + auto bit = u64(1) << u64(35 - i); + maskX[i] = (op.num1 & bit) && !(op.num2 & bit); + } + } else { + set_memory(memory, op.num1 | mask1, maskX, -1, op.num2); + } + } + sum = u64(0); + for(auto mem : memory) { + sum += mem.second; + } + print(sum); +} diff --git a/2020/inputs/day13.input b/2020/inputs/day13.input new file mode 100644 index 0000000..20bcf07 --- /dev/null +++ b/2020/inputs/day13.input @@ -0,0 +1,3 @@ +1001171 +17,x,x,x,x,x,x,41,x,x,x,37,x,x,x,x,x,367,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,19,x,x,x,23,x,x,x,x,x,29,x,613,x,x,x,x,x,x,x,x,x,x,x,x,13 + diff --git a/2020/inputs/day14.input b/2020/inputs/day14.input new file mode 100644 index 0000000..fa02b57 --- /dev/null +++ b/2020/inputs/day14.input @@ -0,0 +1,556 @@ +mask = 00X1011010111X01X1X010X01X1111X11100 +mem[13879] = 56974 +mem[26072] = 842 +mem[47322] = 62104110 +mem[31450] = 372784 +mem[54364] = 2818920 +mask = 01000X10101XX0011000X00XXX00101X0101 +mem[13358] = 73976240 +mem[41121] = 3647124 +mask = 010000X01111X0011000X01010X1001100X0 +mem[49893] = 63539 +mem[63669] = 79316429 +mem[19136] = 256 +mem[1117] = 1244 +mem[56655] = 267815 +mem[22811] = 142 +mask = 0101011010111X0111X010110000XXX1010X +mem[40297] = 21028792 +mem[16007] = 950419537 +mem[40907] = 2010 +mem[27377] = 525 +mem[0] = 209 +mem[41317] = 2312973 +mem[4641] = 1227100 +mask = X0X000101X111001110X011X1X1010X10100 +mem[24322] = 103589922 +mem[2572] = 1231 +mem[53327] = 814998856 +mem[30460] = 25015 +mask = 00000010XX101X11X0110100X0X001X010X1 +mem[50914] = 37339 +mem[50218] = 5021282 +mask = 0X0X00X01XX0110X1101X0X010000110X101 +mem[3780] = 51750101 +mem[8561] = 638 +mem[64747] = 215 +mem[51358] = 194347939 +mem[29912] = 9717 +mem[44684] = 418165 +mask = 0X0X00101011XXX11100001X0101X01101XX +mem[1418] = 81827528 +mem[38228] = 399582 +mem[57488] = 7003 +mem[22080] = 112130 +mem[29467] = 2198074 +mem[32800] = 35048851 +mask = 010X00001011100111X0001X0100011010X1 +mem[16589] = 1922920 +mem[31011] = 88738170 +mem[35178] = 4791 +mem[17792] = 5560 +mem[50656] = 1695 +mem[22720] = 1584409 +mem[54364] = 1486 +mask = 01XX011010X110XXX1X001010X01000X1011 +mem[19230] = 13477 +mem[41397] = 781359 +mem[11599] = 7687201 +mem[2817] = 26775 +mask = X10001XX1000100X1X00001X01X100011100 +mem[288] = 1886 +mem[32911] = 326403 +mem[48084] = 66681 +mask = 00001000X011110X11011000X0X000XX10X1 +mem[41020] = 3202 +mem[21434] = 5634478 +mask = 00X0XX001011X0X1X10X100001110111X011 +mem[33545] = 1876 +mem[28976] = 581977039 +mask = 0X11011010111101011000X1101X000X1110 +mem[19071] = 770610413 +mem[20064] = 1694 +mem[43482] = 2871 +mem[46365] = 3148234 +mem[52059] = 3513 +mem[18760] = 1548 +mem[61977] = 605 +mask = 010X01XX1X11100X11001X10X10110000001 +mem[53801] = 111695 +mem[11683] = 168184 +mem[20469] = 1949 +mask = X1010110X01111011100X010000XX0000000 +mem[55872] = 2261951 +mem[13140] = 15964 +mem[45204] = 22572 +mask = X10X0000XX111X01100011X11X1100101101 +mem[56655] = 124863920 +mem[32800] = 20227 +mem[58864] = 42605725 +mem[59474] = 859 +mem[59729] = 141193 +mem[18342] = 1631 +mask = 01100XX01011100111X00010XX01X0XX010X +mem[13572] = 3383121 +mem[32800] = 25726954 +mem[54193] = 54397 +mem[3305] = 251510 +mem[52294] = 33972 +mask = 0100X0XX10XX11X11101001010X1X110X100 +mem[3991] = 3201095 +mem[19248] = 1173 +mem[17507] = 684436 +mem[37324] = 694 +mem[11150] = 44468495 +mem[16853] = 3978967 +mem[10293] = 3552 +mask = X0X00000X01010011011011X1000X01XX001 +mem[54689] = 1224 +mem[36536] = 33407636 +mem[22811] = 296513 +mem[58491] = 109654 +mask = 010XX1111011000X1000X1000100X00011X0 +mem[20982] = 1468 +mem[15854] = 13972 +mem[55563] = 121451 +mem[28871] = 732 +mask = 00100X100001000001001101XX100X10XX10 +mem[37549] = 11144610 +mem[58939] = 280786876 +mem[38833] = 1473210 +mem[44075] = 571 +mem[21698] = 5427778 +mem[35937] = 544693 +mask = 0100011010111XX10X00011011X010110110 +mem[63719] = 36151477 +mem[43205] = 79985 +mem[9431] = 23613381 +mem[38228] = 93679 +mem[45544] = 946568 +mask = 0X000000101010011101110X11001000XX00 +mem[2730] = 8086855 +mem[50422] = 3607 +mem[9544] = 3738 +mask = 0X0XXXX010X1100111100010000001010010 +mem[17216] = 2231300 +mem[40965] = 30453 +mem[43536] = 1780 +mem[26440] = 712936 +mem[26845] = 445304638 +mask = 01X000X1X0101001101111X1000X0001X0XX +mem[34736] = 35 +mem[23584] = 62941351 +mask = 01X000XX1110XX11XX10010000010X00X110 +mem[35014] = 2725 +mem[31317] = 3 +mask = 000XX0XX101010X1X0X111X0100001100001 +mem[372] = 21946096 +mem[10488] = 41777407 +mem[23528] = 1708407 +mem[60206] = 182569990 +mem[44075] = 816675 +mem[43028] = 618865 +mask = 0X00X000101X1X01110XX01XX0000011X001 +mem[955] = 17506 +mem[41317] = 3162029 +mem[37] = 9168685 +mem[24435] = 33494 +mem[10291] = 901681 +mem[26688] = 23163 +mask = 0100100110X111011XX10010101101101X00 +mem[53694] = 184478 +mem[38156] = 140154654 +mem[3645] = 99833620 +mem[5194] = 7438 +mem[13132] = 187583 +mem[10626] = 213169401 +mask = 0X00X11X1011000X100000XXX0001010XX11 +mem[58468] = 3932 +mem[47108] = 13422709 +mem[20791] = 25670347 +mask = 0100010010111000110000X1X11111X0X100 +mem[64332] = 58063181 +mem[20791] = 97103200 +mem[21178] = 704 +mask = 010X000010101X0X11X111001100X1X011XX +mem[29912] = 96861 +mem[11661] = 15933204 +mem[31973] = 1597059 +mask = 010X0010001XX001110011X0000X00101110 +mem[54377] = 929 +mem[1578] = 1628469 +mem[9066] = 1039223 +mem[54819] = 131459054 +mem[59746] = 97979749 +mem[21742] = 919 +mask = 010X000010111X011110X100X00X0000X00X +mem[25877] = 1030474 +mem[40848] = 441 +mem[19136] = 40 +mem[41305] = 509818516 +mask = 11010011XX111011110X111011X11X00X100 +mem[56916] = 23553145 +mem[43067] = 120593523 +mem[41993] = 121958 +mem[16589] = 469 +mask = 00000XX0101111011101X1011XX1001XXXX0 +mem[44363] = 1739 +mem[15915] = 49544 +mem[5729] = 173493396 +mem[29213] = 41122 +mem[50656] = 1531 +mask = 0X010X1010111X0111000X1XX10100X101XX +mem[58111] = 1227 +mem[45142] = 3293 +mem[30952] = 2965075 +mem[25181] = 578696 +mem[50656] = 60702685 +mask = 0111011010111XX10100X100110101000X1X +mem[59881] = 82070 +mem[60524] = 62394 +mem[35663] = 1981 +mem[27322] = 216531615 +mem[8965] = 14469 +mem[13388] = 1148662 +mem[13342] = 92607190 +mask = X1000XX110X0111XXX010010X00101110101 +mem[2228] = 40376 +mem[64755] = 1327525 +mask = 11010010X0XX10X11X0X1X011001101X110X +mem[15280] = 2364003 +mem[19478] = 72063090 +mem[8497] = 28240 +mem[45678] = 2811 +mem[52231] = 39955 +mask = 0X001111X011000010X01011X1000XX00X11 +mem[24827] = 1639 +mem[13879] = 119218 +mem[17610] = 6101768 +mem[48448] = 3972 +mask = XX0000X0X11110X110001111011X00010101 +mem[65388] = 9968 +mem[26462] = 45065510 +mem[27496] = 70270 +mask = 01010X1X111X1001101X101X0XX000000001 +mem[10134] = 755 +mem[34940] = 3959699 +mem[26321] = 156 +mem[63789] = 36543477 +mask = X10X001010111001X1000100001XX00X101X +mem[59095] = 888920 +mem[26072] = 189525541 +mem[41506] = 78022 +mask = 01X000101X1X10X11010X1X010X1010X011X +mem[19618] = 43629 +mem[16853] = 176218496 +mem[27558] = 9383 +mask = 000000X01011101111001XX00000X0000110 +mem[47738] = 782 +mem[9654] = 14755 +mask = 01X0X0001X01X101110X00000000000X0101 +mem[21742] = 34626297 +mem[10621] = 1418350 +mem[45805] = 3784031 +mask = 01XX01001011101X010X001001X1010X0100 +mem[18511] = 458 +mem[4597] = 8053 +mem[34914] = 902 +mem[11895] = 2319205 +mem[54291] = 7059674 +mem[60178] = 1495 +mem[64432] = 22061 +mask = 1X110010001110011X0X01100X1XX0X01XX0 +mem[9055] = 462699 +mem[35882] = 554265333 +mem[50939] = 52443722 +mem[20552] = 160408413 +mask = 0100010010111001X100000X01X1001001X1 +mem[28976] = 404 +mem[64843] = 813 +mem[57066] = 899 +mem[16179] = 3033125 +mask = X101X01X101110X1110011X0X00010X01001 +mem[63922] = 122921015 +mem[47325] = 66631 +mem[34914] = 122827 +mem[41369] = 723416 +mem[26321] = 350572 +mem[10260] = 11917171 +mem[20396] = 112670 +mask = 00X100101011100111XX010X011X0XX001XX +mem[11150] = 875126074 +mem[28760] = 25307778 +mem[14951] = 445519 +mem[54291] = 394307 +mem[19109] = 15584261 +mem[8221] = 524 +mask = 01000XX011111001100000001101X111X101 +mem[58015] = 18497 +mem[63992] = 530980167 +mem[26915] = 14357281 +mem[42401] = 12123838 +mem[65275] = 14601815 +mask = 010X00X0100011X011010010X00XX100010X +mem[49005] = 39006890 +mem[121] = 119847895 +mem[16179] = 737050 +mem[52215] = 11770 +mask = 010XX0001X10X101110XX10X00000X100111 +mem[40066] = 1188 +mem[27727] = 10855 +mem[47207] = 113852179 +mask = 0X10011XX01X1011110000011X11X0XX101X +mem[27558] = 1280 +mem[18441] = 312 +mem[22675] = 2746277 +mem[54987] = 120268 +mask = 1101XX1010111X011XX01XX0110000001110 +mem[8285] = 6819893 +mem[56655] = 10287 +mem[39027] = 158 +mem[25922] = 2798 +mem[22261] = 36850389 +mem[46394] = 48894888 +mask = X1X10010X011100111001000XX100X1X1X00 +mem[24614] = 1802 +mem[13232] = 499261 +mask = 01XX0X1010111XX11100X011010100X0X101 +mem[63992] = 12600674 +mem[56655] = 99142656 +mem[9273] = 302251593 +mask = XX000XXX1011101111XX0010000100111X00 +mem[18088] = 20379649 +mem[47508] = 111520085 +mem[38545] = 90881967 +mem[21514] = 16333 +mem[35731] = 816238944 +mask = 110111101X11X1011010X10010000111101X +mem[13890] = 4842901 +mem[23610] = 19829 +mem[21900] = 31928769 +mem[10595] = 228191 +mem[13375] = 24467 +mem[45544] = 149815 +mask = 010XX1X0101X100X110X1111010X1100X10X +mem[13358] = 7851 +mem[18277] = 1322 +mem[24517] = 6165 +mem[19856] = 93677767 +mask = 010X0110101XX0011100X000X00000100111 +mem[60820] = 549270 +mem[42355] = 609632 +mem[35546] = 241510 +mem[59340] = 57067 +mask = 010X00X0X0101X001X01111011X00XX01010 +mem[58491] = 456443643 +mem[49058] = 86242 +mem[24702] = 25105 +mem[35001] = 88082598 +mem[36988] = 23981732 +mem[54815] = 19064841 +mem[52231] = 329 +mask = 0XX0001X11101XX011X1X1000000110111X1 +mem[7504] = 475530227 +mem[29138] = 11235 +mem[56376] = 76699622 +mask = 0011XXX01011100X1110X111011XX1110X00 +mem[52184] = 60066 +mem[64705] = 2343316 +mem[43172] = 28305258 +mem[5362] = 2133 +mem[38763] = 2754100 +mem[52032] = 7390 +mem[2572] = 19579691 +mask = 010XX00010101001101X111X000101110011 +mem[29623] = 24098 +mem[8946] = 24951998 +mem[11382] = 184167 +mem[47522] = 6393093 +mask = XX01001010X11X011110X000XX000100X0X1 +mem[10260] = 661 +mem[25012] = 11390 +mask = 0100001010001101110101100XX110X01XX1 +mem[9055] = 297216 +mem[49887] = 26800 +mem[18511] = 3731 +mem[26845] = 42990 +mask = 00X0X00010101X1X1001100011X001100001 +mem[19591] = 197388201 +mem[51460] = 1032 +mem[9600] = 934060 +mem[58791] = 1646732 +mem[50283] = 1235563 +mem[26455] = 5018620 +mem[288] = 481559 +mask = 010X001010110X0X1X001111000XX010011X +mem[13491] = 1626583 +mem[36536] = 239 +mem[56224] = 9125 +mem[28105] = 22015873 +mem[44531] = 8125 +mem[18760] = 25964 +mask = X101000011111X011110100011000X010X0X +mem[58864] = 709865577 +mem[32976] = 303129 +mem[44109] = 8025520 +mem[51706] = 3030478 +mask = 00X01X0010101X0X1X011X110000X10101X1 +mem[53349] = 146801393 +mem[372] = 27164788 +mask = 0X00000010101X011XX11110X000XX1X0001 +mem[27091] = 1227 +mem[3194] = 234 +mem[37] = 4066397 +mem[43559] = 17240 +mem[36904] = 23282 +mem[9186] = 622901569 +mem[58468] = 208767 +mask = 00XX00X010X11101X101111001110100101X +mem[9251] = 230 +mem[61367] = 78432672 +mem[37478] = 2594 +mem[64797] = 71052818 +mem[30018] = 11711518 +mem[20324] = 64836 +mem[61185] = 1433 +mask = 010000X0101X11001101011001100XXX0010 +mem[31581] = 232228 +mem[51766] = 13503 +mem[46129] = 1071 +mem[27845] = 3969749 +mem[17643] = 282089 +mem[60524] = 10654 +mask = 010X00X01X1110011XX01010XX00X0X10101 +mem[41317] = 20899132 +mem[17792] = 1949 +mem[1117] = 4931 +mem[21452] = 423952 +mem[29912] = 36667871 +mem[10260] = 15401611 +mem[28642] = 2840753 +mask = 000000X0101111011101XXXX000X001X01X1 +mem[57488] = 297477423 +mem[8228] = 240002 +mem[45051] = 1209316 +mem[65123] = 1339 +mask = 0100000010101X001111X1011X0001X0X00X +mem[25750] = 10538421 +mem[59160] = 13024648 +mem[7581] = 521295867 +mem[44127] = 10349 +mem[20791] = 263486916 +mem[58844] = 37364 +mem[44165] = 213775351 +mask = 010X0X0010XX10011100001X0X0X1X0001X1 +mem[20221] = 7207 +mem[2326] = 247233 +mem[54001] = 1782454 +mem[41112] = 61297 +mem[45994] = 12285 +mask = 00X00010X0X1001111000010X0X1001XX10X +mem[22080] = 50449 +mem[32446] = 69686 +mem[46129] = 6052251 +mem[45810] = 6931 +mem[2730] = 17348930 +mem[25557] = 22866081 +mem[53007] = 2662 +mask = 00000X1010111X0111011X01000X10X0XX01 +mem[26747] = 237030337 +mem[47589] = 912076 +mem[7333] = 105514 +mem[62613] = 1442076 +mem[293] = 1883 +mask = X1001X1010101111110XX010100000100X01 +mem[64864] = 522211793 +mem[381] = 395572639 +mem[39482] = 641 +mem[47108] = 37814 +mask = 00X00111101110111X001101001110XXX00X +mem[16554] = 1304638 +mem[56666] = 189089562 +mem[12934] = 138931 +mem[63122] = 607569 +mem[37147] = 131399848 +mask = 0X1X11101XX11X0X11100111X100001111X0 +mem[24256] = 156773 +mem[14436] = 485469048 +mem[20781] = 376 +mem[23284] = 879110 +mem[2582] = 42478 +mem[39002] = 3578 +mask = 0000XX0X101010011XX000X0000X01100X01 +mem[40945] = 11048 +mem[36114] = 13782606 +mem[2325] = 185202507 +mem[33715] = 4806448 +mem[61649] = 3756998 +mem[55852] = 117 +mask = 01000000101X1011110010010XXX0XX11110 +mem[5881] = 13440134 +mem[22720] = 962895873 +mem[25142] = 11785 +mask = 0101011010111001010011100XX0011111XX +mem[586] = 209 +mem[51207] = 145606 +mem[21220] = 62604 +mem[45100] = 34084913 +mem[30986] = 310031 +mem[56443] = 483530965 +mask = 0000100000X1X10X11X1100010100X011001 +mem[41487] = 38587945 +mem[21434] = 249215427 +mem[7230] = 111149021 +mask = X101X010XXX1100101X0X10100100111111X +mem[40840] = 2606 +mem[63190] = 2447 +mem[60328] = 40915 +mem[45620] = 13499 +mask = 001X0010101110X1X1X0X11X0010X0X001X0 +mem[62719] = 785 +mem[19974] = 42859172 +mem[51864] = 44741 +mem[63056] = 27482866 +mask = X0X1X0101011X001X100101100101XX1X000 +mem[39205] = 10997188 +mem[14100] = 29987320 +mem[616] = 278639655 +mask = 0100000X10101X011X1111000X00X0111000 +mem[49278] = 610 +mem[9321] = 333537 +mem[22656] = 4066 +mem[8228] = 2791399 +mem[9251] = 3866 +mask = X00100X01011100X1X0XX000111011X00011 +mem[58260] = 459 +mem[18311] = 40779317 +mem[10291] = 3362 +mem[16865] = 1236 +mask = X100X000X010110111X0001100000001X011 +mem[1826] = 108687499 +mem[4087] = 243589 +mem[47489] = 474492676 +mem[4129] = 16244 +mem[29617] = 819406 +mem[43545] = 108512190 +mask = 010X0XX0101110X1X100X01X000X0X110100 +mem[57918] = 102433847 +mem[33825] = 9 +mem[372] = 230834 +mem[19591] = 7380 +mem[65409] = 98189 +mem[36391] = 3033 +mask = X101X000101111011000X10X100100100000 +mem[54029] = 347451 +mem[28001] = 82660784 +mask = 01X0000010101001X1000000X0X000110101 +mem[37266] = 1643 +mem[52294] = 242323894 +mem[40965] = 11451 +mem[52532] = 1191041 +mem[1994] = 1830445 +mem[16066] = 694 +mask = 0X100010X0X1XX0X01001X10X1100X110000 +mem[60293] = 92656839 +mem[8228] = 24889387 +mem[13951] = 25158 From 0431e0b6a43263b19287b9f6979f062a5e9ee930 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Sun, 13 Dec 2020 23:08:32 -0800 Subject: [PATCH 36/52] Completed day 13 p1 and day 14 --- 2020/days/day13.cpp | 106 ++++++++ 2020/days/day14.cpp | 112 ++++++++ 2020/inputs/day13.input | 3 + 2020/inputs/day14.input | 556 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 777 insertions(+) create mode 100644 2020/days/day13.cpp create mode 100644 2020/days/day14.cpp create mode 100644 2020/inputs/day13.input create mode 100644 2020/inputs/day14.input diff --git a/2020/days/day13.cpp b/2020/days/day13.cpp new file mode 100644 index 0000000..576af53 --- /dev/null +++ b/2020/days/day13.cpp @@ -0,0 +1,106 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +struct Pair{ u64 id; usize index; }; + +auto find_least(u64 new_base, u64 new_loop, u64 req_base, u64 req_loop, u64 iter) -> u64 { + while ((new_base + ++iter * new_loop - req_base) % req_loop != 0); + return new_base + iter * new_loop; +} + +auto day13() -> void { + auto ready = usize(0); + auto buses = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day13.input"); + getline(file, line); + ready = std::stoi(line); + getline(file, line); + auto start = usize(0); + auto end = usize(0); + auto index = usize(0); + auto id = std::string(); + while ((end = line.find(',', start)) != std::string::npos) { + id = line.substr(start, end - start); + if (id != "x") { + buses.push_back({ u64(std::stoi(line.substr(start, end - start))), index }); + } + start = end + 1; + ++index; + } + end = line.size(); + id = line.substr(start, end - start); + if (id != "x") { + buses.push_back({ u64(std::stoi(line.substr(start, end - start))), index }); + } + } + + auto id = buses[0].id; + auto minutes = buses[0].id - (ready % buses[0].id); + for (auto i = usize(1); i < buses.size(); ++i) { + auto local_minutes = buses[i].id - (ready % buses[i].id); + if (local_minutes < minutes) { + id = buses[i].id; + minutes = local_minutes; + } + } + print((id * minutes)); + + auto req_base = usize(0); + auto req_loop = usize(1); + for (auto i = usize(1); i < buses.size(); ++i) { + auto base_loop = usize(-1); + while ((++base_loop * buses[0].id + buses[i].index) % buses[i].id != 0); + + auto rep_loop = usize(0); + while ((++rep_loop * buses[0].id) % buses[i].id != 0); + + req_base = find_least(base_loop, rep_loop, req_base, req_loop, -1); + if (i < buses.size() - 1) { + req_loop = find_least(0, rep_loop, 0, req_loop, 0); + } + /* + required_base (rqb), required_loop (rql) + + base_loop (bl), repeat_loop (rl) + + rqb + a0 * rql = bl + a1 * rl < minimize and store in required loop + a0 = (bl + a1 * rl - rqb) / rql + + b0 * rql = b1 * rl < minimize and store in required loop + */ + } + print((req_base * buses[0].id)); +} diff --git a/2020/days/day14.cpp b/2020/days/day14.cpp new file mode 100644 index 0000000..a38fbd6 --- /dev/null +++ b/2020/days/day14.cpp @@ -0,0 +1,112 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +struct Op{ u8 op; u64 num1; u64 num2; }; + +auto set_memory(std::map & map, u64 addr, const std::vector & maskX, usize index, u64 value) -> void { + while (++index < maskX.size() && !maskX[index]); + if (index == maskX.size()) { + map.insert_or_assign(addr, value); + } else { + set_memory(map, addr, maskX, index, value); + set_memory(map, addr ^ (u64(1) << (maskX.size() - index - 1)), maskX, index, value); + } +} + +auto day14() -> void { + auto ops = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day14.input"); + while (getline(file, line)) { + if (line.find("mask") != std::string::npos) { + auto mask0 = u64(-1); + auto mask1 = u64( 0); + for (auto i = usize(7); i < line.size(); ++i) { + if (line[i] == '0') { + mask0 ^= (u64(1) << (42 - i)); + } else if (line[i] == '1') { + mask1 ^= (u64(1) << (42 - i)); + } + } + ops.push_back({ 0, mask0, mask1 }); + } else { + auto value = line.find("=") + 2; + ops.push_back({ + 1, + u64(std::stoll(line.substr(4, line.find("]") - 4))), + u64(std::stoll(line.substr(value, line.size() - value))) + }); + } + } + } + auto mask0 = u64(-1); + auto mask1 = u64( 0); + auto memory = std::map(); + for (auto op : ops) { + if (op.op == 0) { + mask0 = op.num1; + mask1 = op.num2; + } else { + memory.insert_or_assign(op.num1, (op.num2 & mask0) | mask1); + } + } + auto sum = u64(0); + for(auto mem : memory) { + sum += mem.second; + } + print(sum); + + mask1 = u64(0); + memory = std::map(); + auto maskX = std::vector(36); + for (auto op : ops) { + if (op.op == 0) { + mask1 = op.num2; + for (auto i = usize(0); i < maskX.size(); ++i) { + auto bit = u64(1) << u64(35 - i); + maskX[i] = (op.num1 & bit) && !(op.num2 & bit); + } + } else { + set_memory(memory, op.num1 | mask1, maskX, -1, op.num2); + } + } + sum = u64(0); + for(auto mem : memory) { + sum += mem.second; + } + print(sum); +} diff --git a/2020/inputs/day13.input b/2020/inputs/day13.input new file mode 100644 index 0000000..20bcf07 --- /dev/null +++ b/2020/inputs/day13.input @@ -0,0 +1,3 @@ +1001171 +17,x,x,x,x,x,x,41,x,x,x,37,x,x,x,x,x,367,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,19,x,x,x,23,x,x,x,x,x,29,x,613,x,x,x,x,x,x,x,x,x,x,x,x,13 + diff --git a/2020/inputs/day14.input b/2020/inputs/day14.input new file mode 100644 index 0000000..fa02b57 --- /dev/null +++ b/2020/inputs/day14.input @@ -0,0 +1,556 @@ +mask = 00X1011010111X01X1X010X01X1111X11100 +mem[13879] = 56974 +mem[26072] = 842 +mem[47322] = 62104110 +mem[31450] = 372784 +mem[54364] = 2818920 +mask = 01000X10101XX0011000X00XXX00101X0101 +mem[13358] = 73976240 +mem[41121] = 3647124 +mask = 010000X01111X0011000X01010X1001100X0 +mem[49893] = 63539 +mem[63669] = 79316429 +mem[19136] = 256 +mem[1117] = 1244 +mem[56655] = 267815 +mem[22811] = 142 +mask = 0101011010111X0111X010110000XXX1010X +mem[40297] = 21028792 +mem[16007] = 950419537 +mem[40907] = 2010 +mem[27377] = 525 +mem[0] = 209 +mem[41317] = 2312973 +mem[4641] = 1227100 +mask = X0X000101X111001110X011X1X1010X10100 +mem[24322] = 103589922 +mem[2572] = 1231 +mem[53327] = 814998856 +mem[30460] = 25015 +mask = 00000010XX101X11X0110100X0X001X010X1 +mem[50914] = 37339 +mem[50218] = 5021282 +mask = 0X0X00X01XX0110X1101X0X010000110X101 +mem[3780] = 51750101 +mem[8561] = 638 +mem[64747] = 215 +mem[51358] = 194347939 +mem[29912] = 9717 +mem[44684] = 418165 +mask = 0X0X00101011XXX11100001X0101X01101XX +mem[1418] = 81827528 +mem[38228] = 399582 +mem[57488] = 7003 +mem[22080] = 112130 +mem[29467] = 2198074 +mem[32800] = 35048851 +mask = 010X00001011100111X0001X0100011010X1 +mem[16589] = 1922920 +mem[31011] = 88738170 +mem[35178] = 4791 +mem[17792] = 5560 +mem[50656] = 1695 +mem[22720] = 1584409 +mem[54364] = 1486 +mask = 01XX011010X110XXX1X001010X01000X1011 +mem[19230] = 13477 +mem[41397] = 781359 +mem[11599] = 7687201 +mem[2817] = 26775 +mask = X10001XX1000100X1X00001X01X100011100 +mem[288] = 1886 +mem[32911] = 326403 +mem[48084] = 66681 +mask = 00001000X011110X11011000X0X000XX10X1 +mem[41020] = 3202 +mem[21434] = 5634478 +mask = 00X0XX001011X0X1X10X100001110111X011 +mem[33545] = 1876 +mem[28976] = 581977039 +mask = 0X11011010111101011000X1101X000X1110 +mem[19071] = 770610413 +mem[20064] = 1694 +mem[43482] = 2871 +mem[46365] = 3148234 +mem[52059] = 3513 +mem[18760] = 1548 +mem[61977] = 605 +mask = 010X01XX1X11100X11001X10X10110000001 +mem[53801] = 111695 +mem[11683] = 168184 +mem[20469] = 1949 +mask = X1010110X01111011100X010000XX0000000 +mem[55872] = 2261951 +mem[13140] = 15964 +mem[45204] = 22572 +mask = X10X0000XX111X01100011X11X1100101101 +mem[56655] = 124863920 +mem[32800] = 20227 +mem[58864] = 42605725 +mem[59474] = 859 +mem[59729] = 141193 +mem[18342] = 1631 +mask = 01100XX01011100111X00010XX01X0XX010X +mem[13572] = 3383121 +mem[32800] = 25726954 +mem[54193] = 54397 +mem[3305] = 251510 +mem[52294] = 33972 +mask = 0100X0XX10XX11X11101001010X1X110X100 +mem[3991] = 3201095 +mem[19248] = 1173 +mem[17507] = 684436 +mem[37324] = 694 +mem[11150] = 44468495 +mem[16853] = 3978967 +mem[10293] = 3552 +mask = X0X00000X01010011011011X1000X01XX001 +mem[54689] = 1224 +mem[36536] = 33407636 +mem[22811] = 296513 +mem[58491] = 109654 +mask = 010XX1111011000X1000X1000100X00011X0 +mem[20982] = 1468 +mem[15854] = 13972 +mem[55563] = 121451 +mem[28871] = 732 +mask = 00100X100001000001001101XX100X10XX10 +mem[37549] = 11144610 +mem[58939] = 280786876 +mem[38833] = 1473210 +mem[44075] = 571 +mem[21698] = 5427778 +mem[35937] = 544693 +mask = 0100011010111XX10X00011011X010110110 +mem[63719] = 36151477 +mem[43205] = 79985 +mem[9431] = 23613381 +mem[38228] = 93679 +mem[45544] = 946568 +mask = 0X000000101010011101110X11001000XX00 +mem[2730] = 8086855 +mem[50422] = 3607 +mem[9544] = 3738 +mask = 0X0XXXX010X1100111100010000001010010 +mem[17216] = 2231300 +mem[40965] = 30453 +mem[43536] = 1780 +mem[26440] = 712936 +mem[26845] = 445304638 +mask = 01X000X1X0101001101111X1000X0001X0XX +mem[34736] = 35 +mem[23584] = 62941351 +mask = 01X000XX1110XX11XX10010000010X00X110 +mem[35014] = 2725 +mem[31317] = 3 +mask = 000XX0XX101010X1X0X111X0100001100001 +mem[372] = 21946096 +mem[10488] = 41777407 +mem[23528] = 1708407 +mem[60206] = 182569990 +mem[44075] = 816675 +mem[43028] = 618865 +mask = 0X00X000101X1X01110XX01XX0000011X001 +mem[955] = 17506 +mem[41317] = 3162029 +mem[37] = 9168685 +mem[24435] = 33494 +mem[10291] = 901681 +mem[26688] = 23163 +mask = 0100100110X111011XX10010101101101X00 +mem[53694] = 184478 +mem[38156] = 140154654 +mem[3645] = 99833620 +mem[5194] = 7438 +mem[13132] = 187583 +mem[10626] = 213169401 +mask = 0X00X11X1011000X100000XXX0001010XX11 +mem[58468] = 3932 +mem[47108] = 13422709 +mem[20791] = 25670347 +mask = 0100010010111000110000X1X11111X0X100 +mem[64332] = 58063181 +mem[20791] = 97103200 +mem[21178] = 704 +mask = 010X000010101X0X11X111001100X1X011XX +mem[29912] = 96861 +mem[11661] = 15933204 +mem[31973] = 1597059 +mask = 010X0010001XX001110011X0000X00101110 +mem[54377] = 929 +mem[1578] = 1628469 +mem[9066] = 1039223 +mem[54819] = 131459054 +mem[59746] = 97979749 +mem[21742] = 919 +mask = 010X000010111X011110X100X00X0000X00X +mem[25877] = 1030474 +mem[40848] = 441 +mem[19136] = 40 +mem[41305] = 509818516 +mask = 11010011XX111011110X111011X11X00X100 +mem[56916] = 23553145 +mem[43067] = 120593523 +mem[41993] = 121958 +mem[16589] = 469 +mask = 00000XX0101111011101X1011XX1001XXXX0 +mem[44363] = 1739 +mem[15915] = 49544 +mem[5729] = 173493396 +mem[29213] = 41122 +mem[50656] = 1531 +mask = 0X010X1010111X0111000X1XX10100X101XX +mem[58111] = 1227 +mem[45142] = 3293 +mem[30952] = 2965075 +mem[25181] = 578696 +mem[50656] = 60702685 +mask = 0111011010111XX10100X100110101000X1X +mem[59881] = 82070 +mem[60524] = 62394 +mem[35663] = 1981 +mem[27322] = 216531615 +mem[8965] = 14469 +mem[13388] = 1148662 +mem[13342] = 92607190 +mask = X1000XX110X0111XXX010010X00101110101 +mem[2228] = 40376 +mem[64755] = 1327525 +mask = 11010010X0XX10X11X0X1X011001101X110X +mem[15280] = 2364003 +mem[19478] = 72063090 +mem[8497] = 28240 +mem[45678] = 2811 +mem[52231] = 39955 +mask = 0X001111X011000010X01011X1000XX00X11 +mem[24827] = 1639 +mem[13879] = 119218 +mem[17610] = 6101768 +mem[48448] = 3972 +mask = XX0000X0X11110X110001111011X00010101 +mem[65388] = 9968 +mem[26462] = 45065510 +mem[27496] = 70270 +mask = 01010X1X111X1001101X101X0XX000000001 +mem[10134] = 755 +mem[34940] = 3959699 +mem[26321] = 156 +mem[63789] = 36543477 +mask = X10X001010111001X1000100001XX00X101X +mem[59095] = 888920 +mem[26072] = 189525541 +mem[41506] = 78022 +mask = 01X000101X1X10X11010X1X010X1010X011X +mem[19618] = 43629 +mem[16853] = 176218496 +mem[27558] = 9383 +mask = 000000X01011101111001XX00000X0000110 +mem[47738] = 782 +mem[9654] = 14755 +mask = 01X0X0001X01X101110X00000000000X0101 +mem[21742] = 34626297 +mem[10621] = 1418350 +mem[45805] = 3784031 +mask = 01XX01001011101X010X001001X1010X0100 +mem[18511] = 458 +mem[4597] = 8053 +mem[34914] = 902 +mem[11895] = 2319205 +mem[54291] = 7059674 +mem[60178] = 1495 +mem[64432] = 22061 +mask = 1X110010001110011X0X01100X1XX0X01XX0 +mem[9055] = 462699 +mem[35882] = 554265333 +mem[50939] = 52443722 +mem[20552] = 160408413 +mask = 0100010010111001X100000X01X1001001X1 +mem[28976] = 404 +mem[64843] = 813 +mem[57066] = 899 +mem[16179] = 3033125 +mask = X101X01X101110X1110011X0X00010X01001 +mem[63922] = 122921015 +mem[47325] = 66631 +mem[34914] = 122827 +mem[41369] = 723416 +mem[26321] = 350572 +mem[10260] = 11917171 +mem[20396] = 112670 +mask = 00X100101011100111XX010X011X0XX001XX +mem[11150] = 875126074 +mem[28760] = 25307778 +mem[14951] = 445519 +mem[54291] = 394307 +mem[19109] = 15584261 +mem[8221] = 524 +mask = 01000XX011111001100000001101X111X101 +mem[58015] = 18497 +mem[63992] = 530980167 +mem[26915] = 14357281 +mem[42401] = 12123838 +mem[65275] = 14601815 +mask = 010X00X0100011X011010010X00XX100010X +mem[49005] = 39006890 +mem[121] = 119847895 +mem[16179] = 737050 +mem[52215] = 11770 +mask = 010XX0001X10X101110XX10X00000X100111 +mem[40066] = 1188 +mem[27727] = 10855 +mem[47207] = 113852179 +mask = 0X10011XX01X1011110000011X11X0XX101X +mem[27558] = 1280 +mem[18441] = 312 +mem[22675] = 2746277 +mem[54987] = 120268 +mask = 1101XX1010111X011XX01XX0110000001110 +mem[8285] = 6819893 +mem[56655] = 10287 +mem[39027] = 158 +mem[25922] = 2798 +mem[22261] = 36850389 +mem[46394] = 48894888 +mask = X1X10010X011100111001000XX100X1X1X00 +mem[24614] = 1802 +mem[13232] = 499261 +mask = 01XX0X1010111XX11100X011010100X0X101 +mem[63992] = 12600674 +mem[56655] = 99142656 +mem[9273] = 302251593 +mask = XX000XXX1011101111XX0010000100111X00 +mem[18088] = 20379649 +mem[47508] = 111520085 +mem[38545] = 90881967 +mem[21514] = 16333 +mem[35731] = 816238944 +mask = 110111101X11X1011010X10010000111101X +mem[13890] = 4842901 +mem[23610] = 19829 +mem[21900] = 31928769 +mem[10595] = 228191 +mem[13375] = 24467 +mem[45544] = 149815 +mask = 010XX1X0101X100X110X1111010X1100X10X +mem[13358] = 7851 +mem[18277] = 1322 +mem[24517] = 6165 +mem[19856] = 93677767 +mask = 010X0110101XX0011100X000X00000100111 +mem[60820] = 549270 +mem[42355] = 609632 +mem[35546] = 241510 +mem[59340] = 57067 +mask = 010X00X0X0101X001X01111011X00XX01010 +mem[58491] = 456443643 +mem[49058] = 86242 +mem[24702] = 25105 +mem[35001] = 88082598 +mem[36988] = 23981732 +mem[54815] = 19064841 +mem[52231] = 329 +mask = 0XX0001X11101XX011X1X1000000110111X1 +mem[7504] = 475530227 +mem[29138] = 11235 +mem[56376] = 76699622 +mask = 0011XXX01011100X1110X111011XX1110X00 +mem[52184] = 60066 +mem[64705] = 2343316 +mem[43172] = 28305258 +mem[5362] = 2133 +mem[38763] = 2754100 +mem[52032] = 7390 +mem[2572] = 19579691 +mask = 010XX00010101001101X111X000101110011 +mem[29623] = 24098 +mem[8946] = 24951998 +mem[11382] = 184167 +mem[47522] = 6393093 +mask = XX01001010X11X011110X000XX000100X0X1 +mem[10260] = 661 +mem[25012] = 11390 +mask = 0100001010001101110101100XX110X01XX1 +mem[9055] = 297216 +mem[49887] = 26800 +mem[18511] = 3731 +mem[26845] = 42990 +mask = 00X0X00010101X1X1001100011X001100001 +mem[19591] = 197388201 +mem[51460] = 1032 +mem[9600] = 934060 +mem[58791] = 1646732 +mem[50283] = 1235563 +mem[26455] = 5018620 +mem[288] = 481559 +mask = 010X001010110X0X1X001111000XX010011X +mem[13491] = 1626583 +mem[36536] = 239 +mem[56224] = 9125 +mem[28105] = 22015873 +mem[44531] = 8125 +mem[18760] = 25964 +mask = X101000011111X011110100011000X010X0X +mem[58864] = 709865577 +mem[32976] = 303129 +mem[44109] = 8025520 +mem[51706] = 3030478 +mask = 00X01X0010101X0X1X011X110000X10101X1 +mem[53349] = 146801393 +mem[372] = 27164788 +mask = 0X00000010101X011XX11110X000XX1X0001 +mem[27091] = 1227 +mem[3194] = 234 +mem[37] = 4066397 +mem[43559] = 17240 +mem[36904] = 23282 +mem[9186] = 622901569 +mem[58468] = 208767 +mask = 00XX00X010X11101X101111001110100101X +mem[9251] = 230 +mem[61367] = 78432672 +mem[37478] = 2594 +mem[64797] = 71052818 +mem[30018] = 11711518 +mem[20324] = 64836 +mem[61185] = 1433 +mask = 010000X0101X11001101011001100XXX0010 +mem[31581] = 232228 +mem[51766] = 13503 +mem[46129] = 1071 +mem[27845] = 3969749 +mem[17643] = 282089 +mem[60524] = 10654 +mask = 010X00X01X1110011XX01010XX00X0X10101 +mem[41317] = 20899132 +mem[17792] = 1949 +mem[1117] = 4931 +mem[21452] = 423952 +mem[29912] = 36667871 +mem[10260] = 15401611 +mem[28642] = 2840753 +mask = 000000X0101111011101XXXX000X001X01X1 +mem[57488] = 297477423 +mem[8228] = 240002 +mem[45051] = 1209316 +mem[65123] = 1339 +mask = 0100000010101X001111X1011X0001X0X00X +mem[25750] = 10538421 +mem[59160] = 13024648 +mem[7581] = 521295867 +mem[44127] = 10349 +mem[20791] = 263486916 +mem[58844] = 37364 +mem[44165] = 213775351 +mask = 010X0X0010XX10011100001X0X0X1X0001X1 +mem[20221] = 7207 +mem[2326] = 247233 +mem[54001] = 1782454 +mem[41112] = 61297 +mem[45994] = 12285 +mask = 00X00010X0X1001111000010X0X1001XX10X +mem[22080] = 50449 +mem[32446] = 69686 +mem[46129] = 6052251 +mem[45810] = 6931 +mem[2730] = 17348930 +mem[25557] = 22866081 +mem[53007] = 2662 +mask = 00000X1010111X0111011X01000X10X0XX01 +mem[26747] = 237030337 +mem[47589] = 912076 +mem[7333] = 105514 +mem[62613] = 1442076 +mem[293] = 1883 +mask = X1001X1010101111110XX010100000100X01 +mem[64864] = 522211793 +mem[381] = 395572639 +mem[39482] = 641 +mem[47108] = 37814 +mask = 00X00111101110111X001101001110XXX00X +mem[16554] = 1304638 +mem[56666] = 189089562 +mem[12934] = 138931 +mem[63122] = 607569 +mem[37147] = 131399848 +mask = 0X1X11101XX11X0X11100111X100001111X0 +mem[24256] = 156773 +mem[14436] = 485469048 +mem[20781] = 376 +mem[23284] = 879110 +mem[2582] = 42478 +mem[39002] = 3578 +mask = 0000XX0X101010011XX000X0000X01100X01 +mem[40945] = 11048 +mem[36114] = 13782606 +mem[2325] = 185202507 +mem[33715] = 4806448 +mem[61649] = 3756998 +mem[55852] = 117 +mask = 01000000101X1011110010010XXX0XX11110 +mem[5881] = 13440134 +mem[22720] = 962895873 +mem[25142] = 11785 +mask = 0101011010111001010011100XX0011111XX +mem[586] = 209 +mem[51207] = 145606 +mem[21220] = 62604 +mem[45100] = 34084913 +mem[30986] = 310031 +mem[56443] = 483530965 +mask = 0000100000X1X10X11X1100010100X011001 +mem[41487] = 38587945 +mem[21434] = 249215427 +mem[7230] = 111149021 +mask = X101X010XXX1100101X0X10100100111111X +mem[40840] = 2606 +mem[63190] = 2447 +mem[60328] = 40915 +mem[45620] = 13499 +mask = 001X0010101110X1X1X0X11X0010X0X001X0 +mem[62719] = 785 +mem[19974] = 42859172 +mem[51864] = 44741 +mem[63056] = 27482866 +mask = X0X1X0101011X001X100101100101XX1X000 +mem[39205] = 10997188 +mem[14100] = 29987320 +mem[616] = 278639655 +mask = 0100000X10101X011X1111000X00X0111000 +mem[49278] = 610 +mem[9321] = 333537 +mem[22656] = 4066 +mem[8228] = 2791399 +mem[9251] = 3866 +mask = X00100X01011100X1X0XX000111011X00011 +mem[58260] = 459 +mem[18311] = 40779317 +mem[10291] = 3362 +mem[16865] = 1236 +mask = X100X000X010110111X0001100000001X011 +mem[1826] = 108687499 +mem[4087] = 243589 +mem[47489] = 474492676 +mem[4129] = 16244 +mem[29617] = 819406 +mem[43545] = 108512190 +mask = 010X0XX0101110X1X100X01X000X0X110100 +mem[57918] = 102433847 +mem[33825] = 9 +mem[372] = 230834 +mem[19591] = 7380 +mem[65409] = 98189 +mem[36391] = 3033 +mask = X101X000101111011000X10X100100100000 +mem[54029] = 347451 +mem[28001] = 82660784 +mask = 01X0000010101001X1000000X0X000110101 +mem[37266] = 1643 +mem[52294] = 242323894 +mem[40965] = 11451 +mem[52532] = 1191041 +mem[1994] = 1830445 +mem[16066] = 694 +mask = 0X100010X0X1XX0X01001X10X1100X110000 +mem[60293] = 92656839 +mem[8228] = 24889387 +mem[13951] = 25158 From cd627ea0f5e453786292ab0e074b2b122aaecf0c Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Mon, 14 Dec 2020 15:28:55 -0800 Subject: [PATCH 37/52] Completed day 13 --- 2020/days/day13.cpp | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/2020/days/day13.cpp b/2020/days/day13.cpp index 576af53..db18feb 100644 --- a/2020/days/day13.cpp +++ b/2020/days/day13.cpp @@ -32,11 +32,14 @@ #include "../misc/types.hpp" #include "../misc/print.hpp" -struct Pair{ u64 id; usize index; }; +struct Pair{ i64 id; usize index; }; -auto find_least(u64 new_base, u64 new_loop, u64 req_base, u64 req_loop, u64 iter) -> u64 { - while ((new_base + ++iter * new_loop - req_base) % req_loop != 0); - return new_base + iter * new_loop; +// f = a + n0 * b = c + n1 * d +// f = req_base + n0 * req_loop = new_base + n1 * new_loop +// Solve for the smallest integer value f such that this holds true +auto find_least(i64 new_base, i64 new_loop, i64 req_base, i64 req_loop, i64 iter) -> i64 { + while ((req_base - new_base + ++iter * req_loop) % new_loop != 0); + return req_base + iter * req_loop; } auto day13() -> void { @@ -55,7 +58,7 @@ auto day13() -> void { while ((end = line.find(',', start)) != std::string::npos) { id = line.substr(start, end - start); if (id != "x") { - buses.push_back({ u64(std::stoi(line.substr(start, end - start))), index }); + buses.push_back({ i64(std::stoi(line.substr(start, end - start))), index }); } start = end + 1; ++index; @@ -63,7 +66,7 @@ auto day13() -> void { end = line.size(); id = line.substr(start, end - start); if (id != "x") { - buses.push_back({ u64(std::stoi(line.substr(start, end - start))), index }); + buses.push_back({ i64(std::stoi(line.substr(start, end - start))), index }); } } @@ -78,18 +81,12 @@ auto day13() -> void { } print((id * minutes)); - auto req_base = usize(0); - auto req_loop = usize(1); + auto req_base = usize(buses[0].index); + auto req_loop = usize(buses[0].id ); for (auto i = usize(1); i < buses.size(); ++i) { - auto base_loop = usize(-1); - while ((++base_loop * buses[0].id + buses[i].index) % buses[i].id != 0); - - auto rep_loop = usize(0); - while ((++rep_loop * buses[0].id) % buses[i].id != 0); - - req_base = find_least(base_loop, rep_loop, req_base, req_loop, -1); + req_base = find_least(-buses[i].index, buses[i].id, req_base, req_loop, -1); if (i < buses.size() - 1) { - req_loop = find_least(0, rep_loop, 0, req_loop, 0); + req_loop = find_least(0, buses[i].id, 0, req_loop, 0); } /* required_base (rqb), required_loop (rql) @@ -102,5 +99,5 @@ auto day13() -> void { b0 * rql = b1 * rl < minimize and store in required loop */ } - print((req_base * buses[0].id)); + print(req_base); } From c152831c7f716da43951d726b7c814fba18d6c8b Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Mon, 14 Dec 2020 15:28:55 -0800 Subject: [PATCH 38/52] Completed day 13 --- 2020/days/day13.cpp | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/2020/days/day13.cpp b/2020/days/day13.cpp index 576af53..db18feb 100644 --- a/2020/days/day13.cpp +++ b/2020/days/day13.cpp @@ -32,11 +32,14 @@ #include "../misc/types.hpp" #include "../misc/print.hpp" -struct Pair{ u64 id; usize index; }; +struct Pair{ i64 id; usize index; }; -auto find_least(u64 new_base, u64 new_loop, u64 req_base, u64 req_loop, u64 iter) -> u64 { - while ((new_base + ++iter * new_loop - req_base) % req_loop != 0); - return new_base + iter * new_loop; +// f = a + n0 * b = c + n1 * d +// f = req_base + n0 * req_loop = new_base + n1 * new_loop +// Solve for the smallest integer value f such that this holds true +auto find_least(i64 new_base, i64 new_loop, i64 req_base, i64 req_loop, i64 iter) -> i64 { + while ((req_base - new_base + ++iter * req_loop) % new_loop != 0); + return req_base + iter * req_loop; } auto day13() -> void { @@ -55,7 +58,7 @@ auto day13() -> void { while ((end = line.find(',', start)) != std::string::npos) { id = line.substr(start, end - start); if (id != "x") { - buses.push_back({ u64(std::stoi(line.substr(start, end - start))), index }); + buses.push_back({ i64(std::stoi(line.substr(start, end - start))), index }); } start = end + 1; ++index; @@ -63,7 +66,7 @@ auto day13() -> void { end = line.size(); id = line.substr(start, end - start); if (id != "x") { - buses.push_back({ u64(std::stoi(line.substr(start, end - start))), index }); + buses.push_back({ i64(std::stoi(line.substr(start, end - start))), index }); } } @@ -78,18 +81,12 @@ auto day13() -> void { } print((id * minutes)); - auto req_base = usize(0); - auto req_loop = usize(1); + auto req_base = usize(buses[0].index); + auto req_loop = usize(buses[0].id ); for (auto i = usize(1); i < buses.size(); ++i) { - auto base_loop = usize(-1); - while ((++base_loop * buses[0].id + buses[i].index) % buses[i].id != 0); - - auto rep_loop = usize(0); - while ((++rep_loop * buses[0].id) % buses[i].id != 0); - - req_base = find_least(base_loop, rep_loop, req_base, req_loop, -1); + req_base = find_least(-buses[i].index, buses[i].id, req_base, req_loop, -1); if (i < buses.size() - 1) { - req_loop = find_least(0, rep_loop, 0, req_loop, 0); + req_loop = find_least(0, buses[i].id, 0, req_loop, 0); } /* required_base (rqb), required_loop (rql) @@ -102,5 +99,5 @@ auto day13() -> void { b0 * rql = b1 * rl < minimize and store in required loop */ } - print((req_base * buses[0].id)); + print(req_base); } From 5d3ec4087b18f013c29f88d0de10d228ee3f8e3d Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Mon, 14 Dec 2020 23:39:50 -0800 Subject: [PATCH 39/52] Completed day 15 --- 2020/Makefile | 4 +-- 2020/days/day15.cpp | 71 +++++++++++++++++++++++++++++++++++++++++ 2020/inputs/day15.input | 1 + 3 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 2020/days/day15.cpp create mode 100644 2020/inputs/day15.input diff --git a/2020/Makefile b/2020/Makefile index 3860638..ea0c262 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -1,8 +1,8 @@ day%.out: out/types.o misc/main.cpp days/day%.cpp - g++-10 -std=c++2a $(flags) -Dcurrent_day=$(@:.out=) days/$(@:out=cpp) misc/main.cpp out/types.o -o $@ + g++-10 -O3 -std=c++2a $(flags) -Dcurrent_day=$(@:.out=) days/$(@:out=cpp) misc/main.cpp out/types.o -o $@ day%_test.out: out/types.o misc/main_test.cpp days/day%.cpp - g++-10 -std=c++2a $(flags) -DTEST_BUILD -Dcurrent_day=$(@:_test.out=) days/$(@:_test.out=.cpp) misc/main_test.cpp out/types.o -o $@ + g++-10 -O3 -std=c++2a $(flags) -DTEST_BUILD -Dcurrent_day=$(@:_test.out=) days/$(@:_test.out=.cpp) misc/main_test.cpp out/types.o -o $@ days/day%.cpp: cp 'misc/day.cpp.template' $@ diff --git a/2020/days/day15.cpp b/2020/days/day15.cpp new file mode 100644 index 0000000..c33fb2a --- /dev/null +++ b/2020/days/day15.cpp @@ -0,0 +1,71 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +struct Pair{ u64 num; usize last; }; + +auto day15() -> void { + auto last = usize(0); + auto index = usize(0); + auto sequence = std::unordered_map(); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day15.input"); + getline(file, line); + auto start = usize(0); + auto end = usize(0); + auto num = std::string(); + while ((end = line.find(',', start)) != std::string::npos) { + num = line.substr(start, end - start); + sequence.insert_or_assign(u64(std::stoll(num)), ++index); + start = end + 1; + } + end = line.size(); + num = line.substr(start, end - start); + sequence.insert_or_assign(u64(std::stoll(num)), ++index); + } + while (++index < 30000000) { + if (index == 2020) { + print(last); + } + if (sequence.contains(last)) { + auto new_last = index - sequence[last]; + sequence[last] = index; + last = new_last; + } else { + sequence.insert_or_assign(last, index); + last = 0; + } + } + print(last); +} diff --git a/2020/inputs/day15.input b/2020/inputs/day15.input new file mode 100644 index 0000000..3576b75 --- /dev/null +++ b/2020/inputs/day15.input @@ -0,0 +1 @@ +0,13,1,8,6,15 From 4a791a455990bbe75b304fadfc0d30e51317a7fe Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Mon, 14 Dec 2020 23:39:50 -0800 Subject: [PATCH 40/52] Completed day 15 --- 2020/Makefile | 4 +-- 2020/days/day15.cpp | 71 +++++++++++++++++++++++++++++++++++++++++ 2020/inputs/day15.input | 1 + 3 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 2020/days/day15.cpp create mode 100644 2020/inputs/day15.input diff --git a/2020/Makefile b/2020/Makefile index 3860638..ea0c262 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -1,8 +1,8 @@ day%.out: out/types.o misc/main.cpp days/day%.cpp - g++-10 -std=c++2a $(flags) -Dcurrent_day=$(@:.out=) days/$(@:out=cpp) misc/main.cpp out/types.o -o $@ + g++-10 -O3 -std=c++2a $(flags) -Dcurrent_day=$(@:.out=) days/$(@:out=cpp) misc/main.cpp out/types.o -o $@ day%_test.out: out/types.o misc/main_test.cpp days/day%.cpp - g++-10 -std=c++2a $(flags) -DTEST_BUILD -Dcurrent_day=$(@:_test.out=) days/$(@:_test.out=.cpp) misc/main_test.cpp out/types.o -o $@ + g++-10 -O3 -std=c++2a $(flags) -DTEST_BUILD -Dcurrent_day=$(@:_test.out=) days/$(@:_test.out=.cpp) misc/main_test.cpp out/types.o -o $@ days/day%.cpp: cp 'misc/day.cpp.template' $@ diff --git a/2020/days/day15.cpp b/2020/days/day15.cpp new file mode 100644 index 0000000..c33fb2a --- /dev/null +++ b/2020/days/day15.cpp @@ -0,0 +1,71 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +struct Pair{ u64 num; usize last; }; + +auto day15() -> void { + auto last = usize(0); + auto index = usize(0); + auto sequence = std::unordered_map(); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day15.input"); + getline(file, line); + auto start = usize(0); + auto end = usize(0); + auto num = std::string(); + while ((end = line.find(',', start)) != std::string::npos) { + num = line.substr(start, end - start); + sequence.insert_or_assign(u64(std::stoll(num)), ++index); + start = end + 1; + } + end = line.size(); + num = line.substr(start, end - start); + sequence.insert_or_assign(u64(std::stoll(num)), ++index); + } + while (++index < 30000000) { + if (index == 2020) { + print(last); + } + if (sequence.contains(last)) { + auto new_last = index - sequence[last]; + sequence[last] = index; + last = new_last; + } else { + sequence.insert_or_assign(last, index); + last = 0; + } + } + print(last); +} diff --git a/2020/inputs/day15.input b/2020/inputs/day15.input new file mode 100644 index 0000000..3576b75 --- /dev/null +++ b/2020/inputs/day15.input @@ -0,0 +1 @@ +0,13,1,8,6,15 From 2b5a93b833e77ef8e06b51fa60829b9a239daa1c Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Tue, 15 Dec 2020 22:56:57 -0800 Subject: [PATCH 41/52] Completed day 16 --- 2020/days/day16.cpp | 209 ++++++++++++++++++++++++++++++++ 2020/inputs/day16.input | 260 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 469 insertions(+) create mode 100644 2020/days/day16.cpp create mode 100644 2020/inputs/day16.input diff --git a/2020/days/day16.cpp b/2020/days/day16.cpp new file mode 100644 index 0000000..6c1989c --- /dev/null +++ b/2020/days/day16.cpp @@ -0,0 +1,209 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +struct Rule { u64 r11; u64 r12; u64 r21; u64 r22; }; + +auto read_ticket(std::vector & ticket, const std::string & line) -> void { + auto start = usize(0); + auto end = usize(0); + while ((end = line.find(",", end + 1)) != std::string::npos) { + ticket.push_back(std::stoll(line.substr(start, end - start))); + start = end + 1; + } + end = line.size(); + ticket.push_back(std::stoll(line.substr(start, end - start))); +} + +auto matches_rule(const Rule & rule, u64 field) -> bool { + return (rule.r11 <= field && field <= rule.r12) || (rule.r21 <= field && field <= rule.r22); +} + +auto remove_if_exists(std::vector & v, u64 search) -> bool { + auto low = usize(0); + auto high = v.size(); + while (low < high) { + auto index = (low + high) / 2; + if (v[index] == search) { + v.erase(v.begin() + index); + return true; + } else if (search > v[index]) { + low = index + 1; + } else { + high = index; + } + } + return false; +} + +auto contains(std::vector & v, u64 search) -> bool { + auto low = usize(0); + auto high = v.size(); + while (low < high) { + auto index = (low + high) / 2; + if (v[index] == search) { + return true; + } else if (search > v[index]) { + low = index + 1; + } else { + high = index; + } + } + return false; +} + +auto day16() -> void { + auto find = std::vector(); + auto rules = std::vector(); + auto your_ticket = std::vector(); + auto tickets = std::vector>(); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day16.input"); + auto index = usize(0); + while (getline(file, line) && line != "") { + auto rule = Rule(); + auto start = line.find(":") + 2; + auto end = line.find("-"); + rule.r11 = std::stoll(line.substr(start, end - start)); + start = end + 1; + end = line.find(" ", end); + rule.r12 = std::stoll(line.substr(start, end - start)); + start = end + 4; + end = line.find("-", end); + rule.r21 = std::stoll(line.substr(start, end - start)); + start = end + 1; + end = line.size(); + rule.r22 = std::stoll(line.substr(start, end - start)); + rules.push_back(rule); + if (line.find("departure") != std::string::npos) { + find.push_back(index); + } + ++index; + } + getline(file, line); + getline(file, line); + read_ticket(your_ticket, line); + getline(file, line); + getline(file, line); + while (getline(file, line)) { + auto ticket = std::vector(); + read_ticket(ticket, line); + tickets.push_back(std::move(ticket)); + } + } + auto valid = std::vector>(); + { + auto foo = std::vector(your_ticket.size()); + for (auto i = usize(0); i < your_ticket.size(); ++i) { + foo[i] = i; + } + for (auto i = usize(0); i < rules.size(); ++i) { + valid.push_back(foo); + } + } + auto sum = u64(0); + for (auto k = usize(0); k < tickets.size(); ++k) { + const auto & ticket = tickets[k]; + auto invalid_ticket = false; + for (auto i = usize(0); i < ticket.size(); ++i) { + auto invalid_field = true; + for (auto j = usize(0); invalid_field && j < rules.size(); ++j) { + if (matches_rule(rules[j], ticket[i])) { + invalid_field = false; + } + } + if (invalid_field) { + sum += ticket[i]; + } + invalid_ticket = invalid_ticket || invalid_field; + } + if (invalid_ticket) { + tickets.erase(tickets.begin() + k); + --k; + } + } + print(sum); + + for (auto i = usize(0); i < tickets.size(); ++i) { + const auto & ticket = tickets[i]; + for (auto j = usize(0); j < valid.size(); ++j) { + auto & v = valid[j]; + for (auto k = usize(0); k < v.size(); ++k) { + if (!matches_rule(rules[j], ticket[v[k]])) { + v.erase(v.begin() + k); + --k; + } + } + } + } + for (auto i = usize(0); i < your_ticket.size(); ++i) { + auto cont_index = usize(0); + auto contained = usize(0); + for (auto j = usize(0); j < valid.size(); ++j) { + if (contains(valid[j], i)) { + cont_index = j; + ++contained; + } + } + if (contained == 1) { + for (auto j = usize(0); j < valid[cont_index].size(); ++j) { + if (valid[cont_index][j] != i) { + valid[cont_index].erase(valid[cont_index].begin() + j); + --j; + } + } + } + } + + auto loop = true; + while (loop) { + loop = false; + for (auto i = usize(0); i < valid.size(); ++i) { + if (valid[i].size() == 1) { + for (auto j = usize(0); j < valid.size(); ++j) { + if (j != i) { + auto temp = remove_if_exists(valid[j], valid[i][0]); + loop = temp || loop; + } + } + } + } + } + + auto product = u64(1); + for (auto i = usize(0); i < find.size(); ++i) { + product *= your_ticket[valid[find[i]][0]]; + } + print(product); +} diff --git a/2020/inputs/day16.input b/2020/inputs/day16.input new file mode 100644 index 0000000..3a28a2a --- /dev/null +++ b/2020/inputs/day16.input @@ -0,0 +1,260 @@ +departure location: 34-724 or 735-974 +departure station: 40-521 or 534-950 +departure platform: 40-329 or 353-973 +departure track: 37-258 or 268-964 +departure date: 32-650 or 665-964 +departure time: 39-373 or 398-950 +arrival location: 42-431 or 447-952 +arrival station: 36-536 or 552-972 +arrival platform: 45-666 or 678-952 +arrival track: 49-836 or 852-952 +class: 35-600 or 623-953 +duration: 50-920 or 929-950 +price: 35-853 or 870-973 +route: 34-309 or 318-965 +row: 42-267 or 292-962 +seat: 46-632 or 642-954 +train: 47-746 or 754-960 +type: 32-406 or 423-963 +wagon: 37-797 or 810-973 +zone: 35-766 or 784-952 + +your ticket: +113,53,97,59,139,73,89,109,67,71,79,127,149,107,137,83,131,101,61,103 + +nearby tickets: +688,200,60,127,239,85,167,91,792,373,724,244,451,659,133,471,240,649,402,554 +686,424,398,148,91,729,425,231,318,711,209,166,665,105,227,579,229,937,876,495 +699,583,291,592,426,173,819,131,158,814,325,496,625,215,568,831,212,456,137,83 +62,134,362,84,404,722,599,898,555,99,318,364,462,208,83,368,723,185,383,884 +100,573,721,722,320,528,250,206,534,585,797,158,626,201,567,206,54,520,362,892 +944,901,891,906,556,122,71,564,558,474,195,325,580,224,570,879,604,759,600,361 +936,887,732,888,693,763,933,424,835,642,299,174,475,360,150,120,117,294,70,495 +556,209,820,68,164,69,447,397,647,128,137,127,164,328,98,241,736,134,908,562 +627,573,562,740,627,70,294,784,884,91,813,579,354,141,820,351,501,372,138,937 +172,894,647,169,763,466,398,755,556,945,229,307,906,369,197,19,787,489,580,64 +690,107,566,116,360,709,627,369,104,298,931,474,644,477,300,98,799,300,427,518 +61,355,872,448,405,825,528,555,500,600,123,882,123,50,645,919,85,401,712,309 +898,829,929,888,236,146,696,484,904,928,203,167,229,590,484,208,536,157,903,896 +475,552,717,206,898,986,630,255,764,580,885,583,447,81,130,165,688,557,763,158 +459,253,590,760,210,307,789,830,560,221,711,406,470,62,274,577,947,79,932,719 +241,450,123,462,622,167,572,933,120,477,427,623,630,898,761,366,74,453,711,581 +152,823,190,56,207,831,586,650,737,520,57,304,292,759,593,523,590,223,735,836 +160,917,931,83,820,585,252,138,630,118,649,308,171,320,484,739,479,453,263,156 +134,904,686,147,234,821,518,894,116,690,828,696,248,689,918,71,207,891,344,328 +91,133,722,87,934,764,256,632,323,738,490,557,166,929,881,58,690,977,915,235 +746,984,86,710,112,584,205,592,179,796,209,174,447,190,123,455,231,786,893,715 +218,461,649,304,892,945,891,586,198,221,755,305,368,206,129,490,462,996,424,88 +497,108,595,560,160,428,827,78,629,801,370,815,453,853,579,707,893,818,592,224 +463,810,631,118,176,716,924,305,788,877,78,404,702,722,912,324,696,702,485,877 +875,919,461,485,578,595,755,109,793,511,589,931,56,213,920,119,594,594,558,923 +683,124,786,878,933,788,15,61,255,200,452,885,449,707,101,555,325,110,358,405 +70,488,830,913,833,680,158,819,881,583,144,477,182,136,131,56,678,931,881,433 +679,353,226,425,895,827,96,652,111,84,70,473,116,241,404,740,111,77,717,699 +568,885,930,820,415,211,300,877,460,196,481,568,162,888,478,155,743,723,51,190 +61,853,793,309,165,497,720,128,176,424,478,356,741,566,151,168,923,82,710,243 +757,898,167,149,592,251,202,787,627,726,757,462,52,220,786,763,757,64,644,361 +746,564,574,560,351,172,429,574,105,84,689,932,224,365,229,504,881,195,116,484 +574,930,120,165,390,881,108,567,875,577,887,492,209,152,423,484,106,821,917,466 +69,326,754,890,204,248,618,930,938,722,915,463,703,879,598,593,149,583,886,398 +691,272,628,713,559,471,887,902,889,144,585,324,53,572,118,486,217,796,77,899 +198,580,147,92,217,623,919,812,694,577,223,697,909,292,130,758,902,73,110,614 +577,80,744,51,594,513,424,755,116,307,254,914,938,74,561,599,641,835,648,553 +228,939,820,503,676,876,934,189,149,692,625,468,215,567,319,126,829,483,893,894 +758,163,297,553,292,192,128,269,309,564,695,509,896,937,294,70,736,156,402,576 +326,885,566,238,562,904,500,471,431,885,129,938,587,784,983,115,89,123,201,64 +647,918,735,894,428,365,84,535,361,70,977,791,939,872,84,318,431,81,650,99 +490,180,128,117,560,176,170,711,535,691,89,289,564,515,493,910,692,253,557,705 +226,760,309,144,795,758,501,672,909,718,499,555,324,449,454,570,84,241,361,295 +69,455,248,146,289,99,756,632,505,93,786,143,106,746,222,486,517,679,821,370 +816,903,646,353,724,678,149,515,718,321,355,701,221,115,611,942,235,218,252,943 +904,463,485,697,64,127,454,694,225,796,195,169,112,695,363,880,157,239,806,824 +909,430,70,940,626,893,580,174,568,72,518,59,703,444,67,208,187,243,766,477 +232,569,738,910,664,487,198,469,90,206,151,428,597,701,624,877,99,171,915,133 +697,58,563,320,598,179,262,716,222,364,494,932,908,592,946,490,121,370,708,75 +90,400,57,132,761,573,179,433,467,202,81,554,423,327,625,822,108,429,74,319 +233,536,833,564,493,96,358,242,571,56,939,61,813,159,634,507,189,63,176,161 +942,303,463,295,793,830,135,892,717,491,948,357,687,554,303,321,81,172,846,117 +552,893,448,766,406,830,367,821,598,792,877,320,144,158,934,424,453,940,923,755 +365,82,679,227,525,362,561,589,746,87,239,499,914,298,102,371,447,896,185,238 +937,946,228,913,466,154,498,67,717,169,217,186,212,808,153,490,103,756,50,74 +137,165,624,242,424,890,467,201,665,521,362,233,706,916,225,806,472,158,353,738 +810,934,370,920,891,498,649,86,681,308,934,630,116,518,51,118,181,737,764,639 +94,459,601,626,400,218,724,90,724,251,248,519,558,249,110,823,214,482,450,218 +304,71,885,765,96,315,710,204,292,565,53,477,120,558,688,81,904,191,144,201 +328,400,111,494,635,882,590,918,357,597,686,789,89,241,229,681,823,784,877,222 +62,240,518,254,520,151,449,719,320,509,432,574,518,887,353,588,300,814,56,485 +871,536,369,497,230,535,453,119,915,302,872,303,199,632,797,459,430,426,611,572 +211,55,889,741,557,600,565,258,737,407,70,745,632,325,428,949,949,424,832,702 +185,238,189,696,742,495,176,225,908,549,495,488,487,491,785,232,935,491,579,218 +225,141,101,294,687,301,682,361,690,239,563,697,575,457,510,633,820,680,66,647 +428,931,181,324,162,13,896,891,53,237,754,205,915,100,220,87,104,878,241,94 +204,758,126,595,117,462,699,488,65,676,355,535,178,185,324,229,423,708,763,167 +692,78,562,589,179,102,430,943,852,757,921,64,302,73,129,474,595,167,190,745 +360,72,119,247,250,675,210,884,429,136,810,934,294,567,565,207,320,515,454,452 +214,161,128,468,937,580,484,479,764,0,217,896,252,593,208,929,193,784,460,174 +76,490,568,558,711,22,702,625,721,695,692,494,256,244,123,705,427,578,101,63 +298,794,931,325,813,938,104,196,80,999,89,243,195,681,365,51,916,581,891,907 +643,365,555,93,740,888,492,232,744,680,84,171,17,762,122,207,324,180,300,319 +811,755,95,500,83,902,703,429,192,942,908,514,744,535,687,898,67,931,314,737 +817,939,78,944,741,685,516,69,141,60,156,920,816,882,942,916,78,797,673,686 +109,875,438,913,698,244,892,705,399,252,448,402,361,128,892,559,464,872,744,357 +902,784,629,95,224,323,50,993,231,679,150,920,937,168,450,118,594,243,786,785 +927,456,115,901,129,455,829,155,182,579,645,248,53,740,699,836,403,596,215,883 +201,948,914,735,593,121,562,87,190,946,709,501,107,512,595,322,710,232,279,947 +449,109,901,916,755,133,58,251,591,763,639,61,205,737,301,718,200,719,187,453 +143,496,104,483,939,402,890,82,518,937,562,133,201,52,250,610,215,227,53,513 +134,694,424,307,312,499,363,879,944,487,448,721,911,599,718,588,191,499,788,510 +466,903,881,149,698,184,12,209,164,736,102,890,468,228,195,465,174,79,481,758 +220,593,697,360,225,146,938,79,369,948,294,799,708,427,485,911,577,83,472,168 +82,717,709,89,240,231,269,295,816,586,836,256,940,309,251,139,489,292,92,573 +796,229,424,463,19,824,300,590,755,583,81,189,949,690,63,516,324,648,372,812 +257,76,789,703,824,362,215,578,809,190,202,132,297,490,886,908,700,102,632,121 +503,565,373,891,199,364,600,489,120,561,572,918,493,899,477,179,659,890,178,702 +128,227,256,204,897,644,578,944,87,597,240,367,169,113,976,483,253,790,470,684 +404,648,506,718,449,802,509,458,878,198,817,820,141,597,53,193,598,629,215,794 +240,911,139,897,429,326,200,692,811,260,871,649,913,70,494,212,353,137,79,593 +63,574,483,893,62,709,717,699,365,898,949,638,68,901,786,306,591,583,242,680 +63,621,650,108,453,520,594,642,218,590,91,947,819,159,104,170,241,907,896,98 +555,233,715,508,695,156,650,145,458,154,231,119,212,898,882,732,367,219,746,911 +835,930,126,64,693,213,359,718,765,745,727,493,706,184,875,297,162,645,941,488 +404,717,314,712,232,62,211,625,50,479,683,457,459,743,59,294,506,948,722,492 +944,87,98,625,236,257,536,648,599,721,358,920,598,142,157,443,644,428,161,95 +257,573,267,431,484,406,145,556,631,597,821,355,245,145,941,594,456,876,740,741 +920,454,217,701,577,124,470,324,826,837,624,711,518,592,465,795,759,294,498,701 +711,224,483,213,908,497,190,896,202,247,522,150,400,222,719,399,138,944,895,165 +353,576,785,629,211,240,256,514,557,163,355,191,882,638,739,111,121,499,360,218 +424,180,690,321,578,494,587,937,361,833,267,683,491,816,169,703,242,201,357,792 +738,134,739,300,593,786,460,743,936,814,569,681,789,64,327,126,264,812,191,431 +426,915,477,323,716,144,112,63,217,438,900,632,724,294,873,181,468,627,900,164 +479,802,563,121,151,906,192,900,426,718,185,552,946,183,830,239,589,194,481,94 +791,649,469,255,724,66,293,112,610,589,898,363,252,109,425,754,368,431,789,148 +754,665,381,908,735,451,308,737,935,226,706,205,460,244,582,153,178,493,137,702 +321,597,137,599,940,99,109,300,357,130,184,686,996,710,96,178,322,477,226,176 +153,890,836,24,888,643,737,902,597,572,504,486,573,878,251,124,184,600,685,217 +59,742,582,792,229,432,117,920,355,252,917,354,488,205,125,191,110,682,216,456 +324,367,186,203,912,564,870,881,553,365,605,476,326,828,586,154,400,104,579,431 +96,491,758,426,835,489,807,507,811,520,536,298,329,326,295,92,692,515,79,947 +535,682,139,232,938,595,552,824,71,630,831,558,258,448,814,949,222,995,364,828 +898,912,723,464,723,160,194,344,710,113,167,710,195,163,822,735,198,877,224,698 +360,82,111,146,430,703,328,880,406,200,929,64,467,726,647,482,225,449,477,709 +694,81,5,513,590,212,168,399,117,366,59,99,888,354,131,912,177,558,831,594 +520,363,529,159,358,935,202,648,372,940,89,467,483,128,220,138,628,519,252,171 +71,101,514,937,510,946,320,402,480,91,486,584,687,91,113,228,80,648,525,308 +693,494,171,17,114,516,370,320,307,624,356,591,812,156,497,238,557,905,889,820 +301,426,994,218,62,205,797,583,236,552,686,91,760,230,509,823,475,467,160,698 +597,399,51,454,487,666,728,692,874,477,447,318,237,372,453,744,250,458,894,234 +626,95,800,195,702,789,684,571,829,105,147,712,365,75,248,293,234,140,134,166 +576,489,224,159,947,323,116,403,180,683,795,874,197,400,446,720,930,237,240,401 +679,492,22,468,98,594,474,224,328,197,471,471,366,784,472,448,210,686,224,943 +915,471,760,721,587,492,893,327,580,826,807,370,872,684,357,875,937,354,318,361 +246,835,582,831,470,888,881,826,22,739,296,231,784,722,228,144,513,488,879,195 +913,175,109,687,208,207,64,514,819,508,590,489,17,474,566,873,97,481,901,239 +77,192,105,501,70,699,255,136,824,503,655,504,256,194,715,944,326,946,647,448 +189,586,213,294,252,884,935,500,88,309,193,993,814,69,944,810,212,225,719,553 +463,403,568,793,833,921,307,497,593,552,586,741,65,643,66,692,763,143,765,785 +454,889,935,152,434,142,818,366,104,197,184,242,597,895,224,117,325,212,517,794 +717,154,62,135,795,405,743,9,498,219,177,707,103,625,554,61,303,228,194,697 +63,72,882,362,193,754,484,822,236,687,685,296,197,821,925,195,818,897,796,456 +584,463,489,209,232,480,907,919,453,354,281,784,92,938,592,99,646,813,818,700 +250,373,586,229,690,136,101,548,219,358,759,132,370,829,174,884,820,574,459,117 +575,453,945,631,219,301,398,128,787,250,112,594,919,723,808,302,94,812,292,518 +713,106,590,194,361,759,318,123,890,710,122,242,473,293,384,692,145,792,901,428 +132,940,325,931,559,761,907,901,521,92,723,115,815,367,730,487,689,369,573,554 +81,61,566,932,141,349,255,97,233,115,795,816,821,218,319,186,73,632,116,145 +743,629,246,246,800,457,202,534,702,77,739,735,188,934,623,71,912,247,252,100 +800,79,569,167,934,715,916,586,225,562,479,56,705,115,836,912,829,793,71,425 +362,485,689,788,487,301,882,86,373,767,902,600,214,132,825,170,884,629,877,100 +681,876,878,198,539,102,475,919,699,883,762,212,149,457,939,154,247,62,724,918 +915,95,896,832,708,278,826,470,451,512,560,690,71,172,739,181,515,514,144,504 +364,485,146,889,190,329,174,465,719,254,710,925,89,58,690,99,939,404,482,791 +933,51,927,453,597,179,454,403,890,690,495,57,473,690,679,878,175,57,739,320 +249,114,989,933,257,703,328,204,694,431,240,880,501,893,366,53,97,886,810,587 +792,826,823,75,261,91,144,892,140,222,448,373,580,308,581,482,899,578,114,628 +587,129,105,66,515,205,590,89,502,998,940,584,454,256,360,931,118,164,256,693 +877,744,242,329,461,394,568,449,700,89,792,625,597,503,196,65,828,814,431,914 +61,91,700,536,697,114,131,481,499,365,493,473,678,934,120,598,355,826,231,277 +876,307,216,712,928,518,573,363,303,690,708,628,872,836,207,139,163,65,666,467 +494,483,449,328,194,880,258,113,107,932,552,210,824,301,74,396,568,130,883,787 +144,707,507,597,60,197,129,698,555,320,329,791,942,792,530,96,91,596,936,684 +235,558,479,456,554,657,684,878,216,426,828,693,914,258,121,476,320,104,78,766 +830,558,161,536,183,63,626,686,920,273,820,180,794,705,140,825,216,562,648,713 +209,296,788,743,296,75,882,306,298,575,247,784,487,3,707,197,716,648,494,600 +320,703,306,181,707,622,247,626,177,574,666,460,910,401,724,117,370,231,710,302 +66,912,474,186,137,755,437,118,910,481,55,884,500,579,449,870,108,183,74,702 +898,398,128,431,700,936,623,500,51,591,789,127,89,145,164,998,179,736,704,194 +181,56,574,485,948,853,171,223,207,241,179,479,935,616,140,794,230,831,557,320 +282,695,61,919,743,481,877,885,160,126,130,595,71,448,589,398,810,631,212,98 +583,178,145,172,595,295,132,149,284,162,111,398,154,796,595,171,113,357,429,121 +875,447,180,65,301,425,168,949,706,104,790,448,590,823,120,581,730,362,320,907 +796,249,501,202,130,788,520,142,574,461,192,708,133,79,742,642,717,50,727,903 +175,301,110,685,117,466,186,927,632,742,451,328,169,683,103,931,514,359,72,227 +710,643,490,794,877,99,208,527,53,127,169,785,579,449,784,555,714,878,679,130 +643,13,167,178,828,423,227,623,566,299,486,499,680,702,96,584,364,534,189,941 +882,493,571,76,935,240,230,468,599,337,373,138,564,704,791,79,104,242,580,786 +766,766,240,916,759,580,453,164,325,909,743,604,216,648,92,745,909,122,62,244 +197,563,250,110,236,78,825,837,627,493,492,250,871,487,893,763,318,194,827,487 +308,362,888,147,489,7,132,474,58,309,160,235,325,109,895,237,400,692,82,872 +482,757,566,517,564,584,905,58,68,911,735,690,476,111,651,478,915,81,220,765 +569,405,826,504,369,711,165,119,745,885,204,215,83,285,402,829,66,148,254,167 +52,107,793,510,61,996,631,102,227,479,743,916,145,76,251,225,138,70,328,718 +67,569,104,642,493,705,321,896,476,813,370,882,579,425,235,120,486,933,504,0 +919,148,129,482,52,908,236,497,895,641,119,892,691,102,164,193,645,233,192,737 +302,235,80,875,569,596,179,208,58,476,235,250,190,168,160,185,297,926,354,448 +70,354,828,568,242,186,404,320,354,574,86,792,763,137,827,218,557,286,235,834 +301,298,637,901,505,873,765,498,565,230,536,826,516,570,233,474,786,129,162,145 +712,229,242,501,816,243,96,509,708,365,52,829,190,505,697,317,565,403,556,817 +941,820,113,512,877,641,899,74,474,69,228,143,700,164,147,297,559,584,75,499 +984,784,472,357,757,573,816,894,206,181,240,82,832,596,139,127,356,452,184,447 +89,895,258,169,208,883,629,315,892,902,233,137,598,929,502,580,450,119,942,199 +328,895,492,367,748,685,598,599,405,482,243,320,486,77,575,72,406,939,157,293 +188,943,662,195,553,683,709,483,179,562,178,665,944,824,517,90,933,325,117,898 +644,153,904,138,932,508,826,99,926,200,486,56,363,210,793,368,709,469,233,325 +785,300,58,833,915,643,447,731,491,585,454,491,405,486,204,360,929,99,255,302 +207,831,558,759,499,241,252,789,944,393,707,555,125,249,373,720,327,887,514,302 +131,826,481,795,710,577,474,423,54,144,152,72,584,827,109,284,96,78,700,153 +229,556,499,164,88,698,141,513,190,96,293,240,254,257,816,649,156,302,432,699 +424,187,479,244,690,570,505,100,154,648,166,125,292,458,810,926,714,898,569,197 +577,756,512,135,715,406,701,687,637,91,698,302,817,875,114,593,91,510,467,142 +473,460,182,112,777,101,878,78,215,161,222,565,624,203,318,883,491,573,306,821 +870,497,121,718,510,292,92,159,363,78,909,509,132,517,554,913,94,118,458,798 +369,505,351,308,101,201,882,720,788,765,931,818,220,945,702,181,815,895,517,628 +500,910,123,936,493,111,73,564,501,173,473,307,558,510,266,111,897,217,147,301 +766,700,899,517,83,139,118,666,89,129,122,826,599,468,492,849,686,949,695,111 +252,122,241,460,200,367,629,893,919,680,483,440,480,87,631,451,465,241,212,462 +565,711,121,918,424,484,899,722,498,243,792,787,158,329,702,775,357,189,189,824 +462,679,138,294,252,250,234,478,302,618,459,570,210,182,827,513,585,476,789,148 +891,105,181,163,256,116,125,737,588,889,534,471,993,226,932,581,187,788,135,459 +68,222,630,691,153,588,882,260,89,71,297,816,576,830,106,697,941,490,94,719 +52,449,128,204,482,211,931,911,242,698,479,818,495,703,181,183,825,561,656,832 +296,172,118,790,431,357,502,87,881,705,746,816,301,118,693,263,703,172,91,557 +406,556,52,302,248,155,534,220,467,224,483,257,121,741,761,885,279,237,398,784 +257,471,573,153,371,258,461,181,492,789,326,835,291,63,176,162,935,176,353,60 +880,914,515,362,497,137,465,70,235,511,306,194,521,924,740,815,466,305,792,98 +149,306,354,895,717,215,54,703,329,74,62,934,208,986,112,212,694,297,511,178 +589,517,516,367,328,68,678,557,785,834,68,97,744,198,400,876,88,986,906,690 +736,763,821,217,992,904,822,193,719,827,942,456,894,370,492,255,163,211,167,355 +795,135,83,765,484,260,760,150,699,495,138,108,563,306,563,198,577,794,256,503 +518,912,193,431,97,699,109,805,553,403,822,931,682,706,520,57,111,220,324,490 +187,101,498,508,895,101,225,592,455,697,560,185,155,511,703,558,688,113,70,656 +148,599,302,126,469,829,191,218,766,87,140,583,578,827,520,701,53,592,817,18 +645,646,152,469,123,222,746,897,984,127,360,745,789,874,898,788,578,111,368,578 +737,558,898,456,448,194,645,694,666,311,74,108,793,813,451,947,501,853,575,242 +988,212,920,72,693,95,471,882,144,79,643,50,587,829,505,562,237,496,885,827 +929,145,403,715,513,871,687,93,625,258,368,326,870,684,710,503,570,920,634,828 +853,198,501,790,904,486,252,609,593,119,714,137,166,51,297,593,701,560,472,685 +452,597,428,300,733,161,207,514,570,93,556,827,448,428,447,303,75,814,302,164 +205,144,492,214,498,710,121,598,650,533,534,823,247,712,83,678,494,172,937,623 +625,211,95,158,465,918,883,364,89,198,74,93,193,481,763,653,301,201,153,643 +134,921,458,789,353,796,173,534,398,88,151,87,300,763,237,456,366,933,358,572 +563,600,168,584,513,98,871,920,360,249,367,762,89,517,479,448,441,502,720,364 +823,492,484,794,872,874,338,181,693,372,77,306,791,508,785,508,472,933,50,756 +307,193,649,793,850,594,220,572,625,74,835,240,150,327,188,711,371,228,245,578 +626,232,497,691,327,943,636,202,321,698,790,682,447,577,371,593,132,820,491,898 +234,823,485,146,84,99,520,236,700,663,201,690,296,120,712,299,105,870,59,649 +448,765,62,297,462,258,660,482,920,591,689,890,821,211,76,586,50,874,99,644 +578,649,819,465,104,884,744,899,873,76,144,553,935,173,949,675,593,826,71,100 +573,163,451,329,215,398,200,650,368,906,354,164,721,297,718,789,4,371,309,136 +508,174,700,555,908,59,902,767,428,576,404,361,898,792,787,498,76,148,503,453 +192,882,896,124,207,299,558,215,822,207,227,80,517,64,338,877,111,564,86,678 +68,920,510,89,822,482,161,638,230,716,885,482,678,698,488,501,501,871,72,120 From e6f522dda8be40375ef15b48e868022368e2095d Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Tue, 15 Dec 2020 22:56:57 -0800 Subject: [PATCH 42/52] Completed day 16 --- 2020/days/day16.cpp | 209 ++++++++++++++++++++++++++++++++ 2020/inputs/day16.input | 260 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 469 insertions(+) create mode 100644 2020/days/day16.cpp create mode 100644 2020/inputs/day16.input diff --git a/2020/days/day16.cpp b/2020/days/day16.cpp new file mode 100644 index 0000000..6c1989c --- /dev/null +++ b/2020/days/day16.cpp @@ -0,0 +1,209 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +struct Rule { u64 r11; u64 r12; u64 r21; u64 r22; }; + +auto read_ticket(std::vector & ticket, const std::string & line) -> void { + auto start = usize(0); + auto end = usize(0); + while ((end = line.find(",", end + 1)) != std::string::npos) { + ticket.push_back(std::stoll(line.substr(start, end - start))); + start = end + 1; + } + end = line.size(); + ticket.push_back(std::stoll(line.substr(start, end - start))); +} + +auto matches_rule(const Rule & rule, u64 field) -> bool { + return (rule.r11 <= field && field <= rule.r12) || (rule.r21 <= field && field <= rule.r22); +} + +auto remove_if_exists(std::vector & v, u64 search) -> bool { + auto low = usize(0); + auto high = v.size(); + while (low < high) { + auto index = (low + high) / 2; + if (v[index] == search) { + v.erase(v.begin() + index); + return true; + } else if (search > v[index]) { + low = index + 1; + } else { + high = index; + } + } + return false; +} + +auto contains(std::vector & v, u64 search) -> bool { + auto low = usize(0); + auto high = v.size(); + while (low < high) { + auto index = (low + high) / 2; + if (v[index] == search) { + return true; + } else if (search > v[index]) { + low = index + 1; + } else { + high = index; + } + } + return false; +} + +auto day16() -> void { + auto find = std::vector(); + auto rules = std::vector(); + auto your_ticket = std::vector(); + auto tickets = std::vector>(); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day16.input"); + auto index = usize(0); + while (getline(file, line) && line != "") { + auto rule = Rule(); + auto start = line.find(":") + 2; + auto end = line.find("-"); + rule.r11 = std::stoll(line.substr(start, end - start)); + start = end + 1; + end = line.find(" ", end); + rule.r12 = std::stoll(line.substr(start, end - start)); + start = end + 4; + end = line.find("-", end); + rule.r21 = std::stoll(line.substr(start, end - start)); + start = end + 1; + end = line.size(); + rule.r22 = std::stoll(line.substr(start, end - start)); + rules.push_back(rule); + if (line.find("departure") != std::string::npos) { + find.push_back(index); + } + ++index; + } + getline(file, line); + getline(file, line); + read_ticket(your_ticket, line); + getline(file, line); + getline(file, line); + while (getline(file, line)) { + auto ticket = std::vector(); + read_ticket(ticket, line); + tickets.push_back(std::move(ticket)); + } + } + auto valid = std::vector>(); + { + auto foo = std::vector(your_ticket.size()); + for (auto i = usize(0); i < your_ticket.size(); ++i) { + foo[i] = i; + } + for (auto i = usize(0); i < rules.size(); ++i) { + valid.push_back(foo); + } + } + auto sum = u64(0); + for (auto k = usize(0); k < tickets.size(); ++k) { + const auto & ticket = tickets[k]; + auto invalid_ticket = false; + for (auto i = usize(0); i < ticket.size(); ++i) { + auto invalid_field = true; + for (auto j = usize(0); invalid_field && j < rules.size(); ++j) { + if (matches_rule(rules[j], ticket[i])) { + invalid_field = false; + } + } + if (invalid_field) { + sum += ticket[i]; + } + invalid_ticket = invalid_ticket || invalid_field; + } + if (invalid_ticket) { + tickets.erase(tickets.begin() + k); + --k; + } + } + print(sum); + + for (auto i = usize(0); i < tickets.size(); ++i) { + const auto & ticket = tickets[i]; + for (auto j = usize(0); j < valid.size(); ++j) { + auto & v = valid[j]; + for (auto k = usize(0); k < v.size(); ++k) { + if (!matches_rule(rules[j], ticket[v[k]])) { + v.erase(v.begin() + k); + --k; + } + } + } + } + for (auto i = usize(0); i < your_ticket.size(); ++i) { + auto cont_index = usize(0); + auto contained = usize(0); + for (auto j = usize(0); j < valid.size(); ++j) { + if (contains(valid[j], i)) { + cont_index = j; + ++contained; + } + } + if (contained == 1) { + for (auto j = usize(0); j < valid[cont_index].size(); ++j) { + if (valid[cont_index][j] != i) { + valid[cont_index].erase(valid[cont_index].begin() + j); + --j; + } + } + } + } + + auto loop = true; + while (loop) { + loop = false; + for (auto i = usize(0); i < valid.size(); ++i) { + if (valid[i].size() == 1) { + for (auto j = usize(0); j < valid.size(); ++j) { + if (j != i) { + auto temp = remove_if_exists(valid[j], valid[i][0]); + loop = temp || loop; + } + } + } + } + } + + auto product = u64(1); + for (auto i = usize(0); i < find.size(); ++i) { + product *= your_ticket[valid[find[i]][0]]; + } + print(product); +} diff --git a/2020/inputs/day16.input b/2020/inputs/day16.input new file mode 100644 index 0000000..3a28a2a --- /dev/null +++ b/2020/inputs/day16.input @@ -0,0 +1,260 @@ +departure location: 34-724 or 735-974 +departure station: 40-521 or 534-950 +departure platform: 40-329 or 353-973 +departure track: 37-258 or 268-964 +departure date: 32-650 or 665-964 +departure time: 39-373 or 398-950 +arrival location: 42-431 or 447-952 +arrival station: 36-536 or 552-972 +arrival platform: 45-666 or 678-952 +arrival track: 49-836 or 852-952 +class: 35-600 or 623-953 +duration: 50-920 or 929-950 +price: 35-853 or 870-973 +route: 34-309 or 318-965 +row: 42-267 or 292-962 +seat: 46-632 or 642-954 +train: 47-746 or 754-960 +type: 32-406 or 423-963 +wagon: 37-797 or 810-973 +zone: 35-766 or 784-952 + +your ticket: +113,53,97,59,139,73,89,109,67,71,79,127,149,107,137,83,131,101,61,103 + +nearby tickets: +688,200,60,127,239,85,167,91,792,373,724,244,451,659,133,471,240,649,402,554 +686,424,398,148,91,729,425,231,318,711,209,166,665,105,227,579,229,937,876,495 +699,583,291,592,426,173,819,131,158,814,325,496,625,215,568,831,212,456,137,83 +62,134,362,84,404,722,599,898,555,99,318,364,462,208,83,368,723,185,383,884 +100,573,721,722,320,528,250,206,534,585,797,158,626,201,567,206,54,520,362,892 +944,901,891,906,556,122,71,564,558,474,195,325,580,224,570,879,604,759,600,361 +936,887,732,888,693,763,933,424,835,642,299,174,475,360,150,120,117,294,70,495 +556,209,820,68,164,69,447,397,647,128,137,127,164,328,98,241,736,134,908,562 +627,573,562,740,627,70,294,784,884,91,813,579,354,141,820,351,501,372,138,937 +172,894,647,169,763,466,398,755,556,945,229,307,906,369,197,19,787,489,580,64 +690,107,566,116,360,709,627,369,104,298,931,474,644,477,300,98,799,300,427,518 +61,355,872,448,405,825,528,555,500,600,123,882,123,50,645,919,85,401,712,309 +898,829,929,888,236,146,696,484,904,928,203,167,229,590,484,208,536,157,903,896 +475,552,717,206,898,986,630,255,764,580,885,583,447,81,130,165,688,557,763,158 +459,253,590,760,210,307,789,830,560,221,711,406,470,62,274,577,947,79,932,719 +241,450,123,462,622,167,572,933,120,477,427,623,630,898,761,366,74,453,711,581 +152,823,190,56,207,831,586,650,737,520,57,304,292,759,593,523,590,223,735,836 +160,917,931,83,820,585,252,138,630,118,649,308,171,320,484,739,479,453,263,156 +134,904,686,147,234,821,518,894,116,690,828,696,248,689,918,71,207,891,344,328 +91,133,722,87,934,764,256,632,323,738,490,557,166,929,881,58,690,977,915,235 +746,984,86,710,112,584,205,592,179,796,209,174,447,190,123,455,231,786,893,715 +218,461,649,304,892,945,891,586,198,221,755,305,368,206,129,490,462,996,424,88 +497,108,595,560,160,428,827,78,629,801,370,815,453,853,579,707,893,818,592,224 +463,810,631,118,176,716,924,305,788,877,78,404,702,722,912,324,696,702,485,877 +875,919,461,485,578,595,755,109,793,511,589,931,56,213,920,119,594,594,558,923 +683,124,786,878,933,788,15,61,255,200,452,885,449,707,101,555,325,110,358,405 +70,488,830,913,833,680,158,819,881,583,144,477,182,136,131,56,678,931,881,433 +679,353,226,425,895,827,96,652,111,84,70,473,116,241,404,740,111,77,717,699 +568,885,930,820,415,211,300,877,460,196,481,568,162,888,478,155,743,723,51,190 +61,853,793,309,165,497,720,128,176,424,478,356,741,566,151,168,923,82,710,243 +757,898,167,149,592,251,202,787,627,726,757,462,52,220,786,763,757,64,644,361 +746,564,574,560,351,172,429,574,105,84,689,932,224,365,229,504,881,195,116,484 +574,930,120,165,390,881,108,567,875,577,887,492,209,152,423,484,106,821,917,466 +69,326,754,890,204,248,618,930,938,722,915,463,703,879,598,593,149,583,886,398 +691,272,628,713,559,471,887,902,889,144,585,324,53,572,118,486,217,796,77,899 +198,580,147,92,217,623,919,812,694,577,223,697,909,292,130,758,902,73,110,614 +577,80,744,51,594,513,424,755,116,307,254,914,938,74,561,599,641,835,648,553 +228,939,820,503,676,876,934,189,149,692,625,468,215,567,319,126,829,483,893,894 +758,163,297,553,292,192,128,269,309,564,695,509,896,937,294,70,736,156,402,576 +326,885,566,238,562,904,500,471,431,885,129,938,587,784,983,115,89,123,201,64 +647,918,735,894,428,365,84,535,361,70,977,791,939,872,84,318,431,81,650,99 +490,180,128,117,560,176,170,711,535,691,89,289,564,515,493,910,692,253,557,705 +226,760,309,144,795,758,501,672,909,718,499,555,324,449,454,570,84,241,361,295 +69,455,248,146,289,99,756,632,505,93,786,143,106,746,222,486,517,679,821,370 +816,903,646,353,724,678,149,515,718,321,355,701,221,115,611,942,235,218,252,943 +904,463,485,697,64,127,454,694,225,796,195,169,112,695,363,880,157,239,806,824 +909,430,70,940,626,893,580,174,568,72,518,59,703,444,67,208,187,243,766,477 +232,569,738,910,664,487,198,469,90,206,151,428,597,701,624,877,99,171,915,133 +697,58,563,320,598,179,262,716,222,364,494,932,908,592,946,490,121,370,708,75 +90,400,57,132,761,573,179,433,467,202,81,554,423,327,625,822,108,429,74,319 +233,536,833,564,493,96,358,242,571,56,939,61,813,159,634,507,189,63,176,161 +942,303,463,295,793,830,135,892,717,491,948,357,687,554,303,321,81,172,846,117 +552,893,448,766,406,830,367,821,598,792,877,320,144,158,934,424,453,940,923,755 +365,82,679,227,525,362,561,589,746,87,239,499,914,298,102,371,447,896,185,238 +937,946,228,913,466,154,498,67,717,169,217,186,212,808,153,490,103,756,50,74 +137,165,624,242,424,890,467,201,665,521,362,233,706,916,225,806,472,158,353,738 +810,934,370,920,891,498,649,86,681,308,934,630,116,518,51,118,181,737,764,639 +94,459,601,626,400,218,724,90,724,251,248,519,558,249,110,823,214,482,450,218 +304,71,885,765,96,315,710,204,292,565,53,477,120,558,688,81,904,191,144,201 +328,400,111,494,635,882,590,918,357,597,686,789,89,241,229,681,823,784,877,222 +62,240,518,254,520,151,449,719,320,509,432,574,518,887,353,588,300,814,56,485 +871,536,369,497,230,535,453,119,915,302,872,303,199,632,797,459,430,426,611,572 +211,55,889,741,557,600,565,258,737,407,70,745,632,325,428,949,949,424,832,702 +185,238,189,696,742,495,176,225,908,549,495,488,487,491,785,232,935,491,579,218 +225,141,101,294,687,301,682,361,690,239,563,697,575,457,510,633,820,680,66,647 +428,931,181,324,162,13,896,891,53,237,754,205,915,100,220,87,104,878,241,94 +204,758,126,595,117,462,699,488,65,676,355,535,178,185,324,229,423,708,763,167 +692,78,562,589,179,102,430,943,852,757,921,64,302,73,129,474,595,167,190,745 +360,72,119,247,250,675,210,884,429,136,810,934,294,567,565,207,320,515,454,452 +214,161,128,468,937,580,484,479,764,0,217,896,252,593,208,929,193,784,460,174 +76,490,568,558,711,22,702,625,721,695,692,494,256,244,123,705,427,578,101,63 +298,794,931,325,813,938,104,196,80,999,89,243,195,681,365,51,916,581,891,907 +643,365,555,93,740,888,492,232,744,680,84,171,17,762,122,207,324,180,300,319 +811,755,95,500,83,902,703,429,192,942,908,514,744,535,687,898,67,931,314,737 +817,939,78,944,741,685,516,69,141,60,156,920,816,882,942,916,78,797,673,686 +109,875,438,913,698,244,892,705,399,252,448,402,361,128,892,559,464,872,744,357 +902,784,629,95,224,323,50,993,231,679,150,920,937,168,450,118,594,243,786,785 +927,456,115,901,129,455,829,155,182,579,645,248,53,740,699,836,403,596,215,883 +201,948,914,735,593,121,562,87,190,946,709,501,107,512,595,322,710,232,279,947 +449,109,901,916,755,133,58,251,591,763,639,61,205,737,301,718,200,719,187,453 +143,496,104,483,939,402,890,82,518,937,562,133,201,52,250,610,215,227,53,513 +134,694,424,307,312,499,363,879,944,487,448,721,911,599,718,588,191,499,788,510 +466,903,881,149,698,184,12,209,164,736,102,890,468,228,195,465,174,79,481,758 +220,593,697,360,225,146,938,79,369,948,294,799,708,427,485,911,577,83,472,168 +82,717,709,89,240,231,269,295,816,586,836,256,940,309,251,139,489,292,92,573 +796,229,424,463,19,824,300,590,755,583,81,189,949,690,63,516,324,648,372,812 +257,76,789,703,824,362,215,578,809,190,202,132,297,490,886,908,700,102,632,121 +503,565,373,891,199,364,600,489,120,561,572,918,493,899,477,179,659,890,178,702 +128,227,256,204,897,644,578,944,87,597,240,367,169,113,976,483,253,790,470,684 +404,648,506,718,449,802,509,458,878,198,817,820,141,597,53,193,598,629,215,794 +240,911,139,897,429,326,200,692,811,260,871,649,913,70,494,212,353,137,79,593 +63,574,483,893,62,709,717,699,365,898,949,638,68,901,786,306,591,583,242,680 +63,621,650,108,453,520,594,642,218,590,91,947,819,159,104,170,241,907,896,98 +555,233,715,508,695,156,650,145,458,154,231,119,212,898,882,732,367,219,746,911 +835,930,126,64,693,213,359,718,765,745,727,493,706,184,875,297,162,645,941,488 +404,717,314,712,232,62,211,625,50,479,683,457,459,743,59,294,506,948,722,492 +944,87,98,625,236,257,536,648,599,721,358,920,598,142,157,443,644,428,161,95 +257,573,267,431,484,406,145,556,631,597,821,355,245,145,941,594,456,876,740,741 +920,454,217,701,577,124,470,324,826,837,624,711,518,592,465,795,759,294,498,701 +711,224,483,213,908,497,190,896,202,247,522,150,400,222,719,399,138,944,895,165 +353,576,785,629,211,240,256,514,557,163,355,191,882,638,739,111,121,499,360,218 +424,180,690,321,578,494,587,937,361,833,267,683,491,816,169,703,242,201,357,792 +738,134,739,300,593,786,460,743,936,814,569,681,789,64,327,126,264,812,191,431 +426,915,477,323,716,144,112,63,217,438,900,632,724,294,873,181,468,627,900,164 +479,802,563,121,151,906,192,900,426,718,185,552,946,183,830,239,589,194,481,94 +791,649,469,255,724,66,293,112,610,589,898,363,252,109,425,754,368,431,789,148 +754,665,381,908,735,451,308,737,935,226,706,205,460,244,582,153,178,493,137,702 +321,597,137,599,940,99,109,300,357,130,184,686,996,710,96,178,322,477,226,176 +153,890,836,24,888,643,737,902,597,572,504,486,573,878,251,124,184,600,685,217 +59,742,582,792,229,432,117,920,355,252,917,354,488,205,125,191,110,682,216,456 +324,367,186,203,912,564,870,881,553,365,605,476,326,828,586,154,400,104,579,431 +96,491,758,426,835,489,807,507,811,520,536,298,329,326,295,92,692,515,79,947 +535,682,139,232,938,595,552,824,71,630,831,558,258,448,814,949,222,995,364,828 +898,912,723,464,723,160,194,344,710,113,167,710,195,163,822,735,198,877,224,698 +360,82,111,146,430,703,328,880,406,200,929,64,467,726,647,482,225,449,477,709 +694,81,5,513,590,212,168,399,117,366,59,99,888,354,131,912,177,558,831,594 +520,363,529,159,358,935,202,648,372,940,89,467,483,128,220,138,628,519,252,171 +71,101,514,937,510,946,320,402,480,91,486,584,687,91,113,228,80,648,525,308 +693,494,171,17,114,516,370,320,307,624,356,591,812,156,497,238,557,905,889,820 +301,426,994,218,62,205,797,583,236,552,686,91,760,230,509,823,475,467,160,698 +597,399,51,454,487,666,728,692,874,477,447,318,237,372,453,744,250,458,894,234 +626,95,800,195,702,789,684,571,829,105,147,712,365,75,248,293,234,140,134,166 +576,489,224,159,947,323,116,403,180,683,795,874,197,400,446,720,930,237,240,401 +679,492,22,468,98,594,474,224,328,197,471,471,366,784,472,448,210,686,224,943 +915,471,760,721,587,492,893,327,580,826,807,370,872,684,357,875,937,354,318,361 +246,835,582,831,470,888,881,826,22,739,296,231,784,722,228,144,513,488,879,195 +913,175,109,687,208,207,64,514,819,508,590,489,17,474,566,873,97,481,901,239 +77,192,105,501,70,699,255,136,824,503,655,504,256,194,715,944,326,946,647,448 +189,586,213,294,252,884,935,500,88,309,193,993,814,69,944,810,212,225,719,553 +463,403,568,793,833,921,307,497,593,552,586,741,65,643,66,692,763,143,765,785 +454,889,935,152,434,142,818,366,104,197,184,242,597,895,224,117,325,212,517,794 +717,154,62,135,795,405,743,9,498,219,177,707,103,625,554,61,303,228,194,697 +63,72,882,362,193,754,484,822,236,687,685,296,197,821,925,195,818,897,796,456 +584,463,489,209,232,480,907,919,453,354,281,784,92,938,592,99,646,813,818,700 +250,373,586,229,690,136,101,548,219,358,759,132,370,829,174,884,820,574,459,117 +575,453,945,631,219,301,398,128,787,250,112,594,919,723,808,302,94,812,292,518 +713,106,590,194,361,759,318,123,890,710,122,242,473,293,384,692,145,792,901,428 +132,940,325,931,559,761,907,901,521,92,723,115,815,367,730,487,689,369,573,554 +81,61,566,932,141,349,255,97,233,115,795,816,821,218,319,186,73,632,116,145 +743,629,246,246,800,457,202,534,702,77,739,735,188,934,623,71,912,247,252,100 +800,79,569,167,934,715,916,586,225,562,479,56,705,115,836,912,829,793,71,425 +362,485,689,788,487,301,882,86,373,767,902,600,214,132,825,170,884,629,877,100 +681,876,878,198,539,102,475,919,699,883,762,212,149,457,939,154,247,62,724,918 +915,95,896,832,708,278,826,470,451,512,560,690,71,172,739,181,515,514,144,504 +364,485,146,889,190,329,174,465,719,254,710,925,89,58,690,99,939,404,482,791 +933,51,927,453,597,179,454,403,890,690,495,57,473,690,679,878,175,57,739,320 +249,114,989,933,257,703,328,204,694,431,240,880,501,893,366,53,97,886,810,587 +792,826,823,75,261,91,144,892,140,222,448,373,580,308,581,482,899,578,114,628 +587,129,105,66,515,205,590,89,502,998,940,584,454,256,360,931,118,164,256,693 +877,744,242,329,461,394,568,449,700,89,792,625,597,503,196,65,828,814,431,914 +61,91,700,536,697,114,131,481,499,365,493,473,678,934,120,598,355,826,231,277 +876,307,216,712,928,518,573,363,303,690,708,628,872,836,207,139,163,65,666,467 +494,483,449,328,194,880,258,113,107,932,552,210,824,301,74,396,568,130,883,787 +144,707,507,597,60,197,129,698,555,320,329,791,942,792,530,96,91,596,936,684 +235,558,479,456,554,657,684,878,216,426,828,693,914,258,121,476,320,104,78,766 +830,558,161,536,183,63,626,686,920,273,820,180,794,705,140,825,216,562,648,713 +209,296,788,743,296,75,882,306,298,575,247,784,487,3,707,197,716,648,494,600 +320,703,306,181,707,622,247,626,177,574,666,460,910,401,724,117,370,231,710,302 +66,912,474,186,137,755,437,118,910,481,55,884,500,579,449,870,108,183,74,702 +898,398,128,431,700,936,623,500,51,591,789,127,89,145,164,998,179,736,704,194 +181,56,574,485,948,853,171,223,207,241,179,479,935,616,140,794,230,831,557,320 +282,695,61,919,743,481,877,885,160,126,130,595,71,448,589,398,810,631,212,98 +583,178,145,172,595,295,132,149,284,162,111,398,154,796,595,171,113,357,429,121 +875,447,180,65,301,425,168,949,706,104,790,448,590,823,120,581,730,362,320,907 +796,249,501,202,130,788,520,142,574,461,192,708,133,79,742,642,717,50,727,903 +175,301,110,685,117,466,186,927,632,742,451,328,169,683,103,931,514,359,72,227 +710,643,490,794,877,99,208,527,53,127,169,785,579,449,784,555,714,878,679,130 +643,13,167,178,828,423,227,623,566,299,486,499,680,702,96,584,364,534,189,941 +882,493,571,76,935,240,230,468,599,337,373,138,564,704,791,79,104,242,580,786 +766,766,240,916,759,580,453,164,325,909,743,604,216,648,92,745,909,122,62,244 +197,563,250,110,236,78,825,837,627,493,492,250,871,487,893,763,318,194,827,487 +308,362,888,147,489,7,132,474,58,309,160,235,325,109,895,237,400,692,82,872 +482,757,566,517,564,584,905,58,68,911,735,690,476,111,651,478,915,81,220,765 +569,405,826,504,369,711,165,119,745,885,204,215,83,285,402,829,66,148,254,167 +52,107,793,510,61,996,631,102,227,479,743,916,145,76,251,225,138,70,328,718 +67,569,104,642,493,705,321,896,476,813,370,882,579,425,235,120,486,933,504,0 +919,148,129,482,52,908,236,497,895,641,119,892,691,102,164,193,645,233,192,737 +302,235,80,875,569,596,179,208,58,476,235,250,190,168,160,185,297,926,354,448 +70,354,828,568,242,186,404,320,354,574,86,792,763,137,827,218,557,286,235,834 +301,298,637,901,505,873,765,498,565,230,536,826,516,570,233,474,786,129,162,145 +712,229,242,501,816,243,96,509,708,365,52,829,190,505,697,317,565,403,556,817 +941,820,113,512,877,641,899,74,474,69,228,143,700,164,147,297,559,584,75,499 +984,784,472,357,757,573,816,894,206,181,240,82,832,596,139,127,356,452,184,447 +89,895,258,169,208,883,629,315,892,902,233,137,598,929,502,580,450,119,942,199 +328,895,492,367,748,685,598,599,405,482,243,320,486,77,575,72,406,939,157,293 +188,943,662,195,553,683,709,483,179,562,178,665,944,824,517,90,933,325,117,898 +644,153,904,138,932,508,826,99,926,200,486,56,363,210,793,368,709,469,233,325 +785,300,58,833,915,643,447,731,491,585,454,491,405,486,204,360,929,99,255,302 +207,831,558,759,499,241,252,789,944,393,707,555,125,249,373,720,327,887,514,302 +131,826,481,795,710,577,474,423,54,144,152,72,584,827,109,284,96,78,700,153 +229,556,499,164,88,698,141,513,190,96,293,240,254,257,816,649,156,302,432,699 +424,187,479,244,690,570,505,100,154,648,166,125,292,458,810,926,714,898,569,197 +577,756,512,135,715,406,701,687,637,91,698,302,817,875,114,593,91,510,467,142 +473,460,182,112,777,101,878,78,215,161,222,565,624,203,318,883,491,573,306,821 +870,497,121,718,510,292,92,159,363,78,909,509,132,517,554,913,94,118,458,798 +369,505,351,308,101,201,882,720,788,765,931,818,220,945,702,181,815,895,517,628 +500,910,123,936,493,111,73,564,501,173,473,307,558,510,266,111,897,217,147,301 +766,700,899,517,83,139,118,666,89,129,122,826,599,468,492,849,686,949,695,111 +252,122,241,460,200,367,629,893,919,680,483,440,480,87,631,451,465,241,212,462 +565,711,121,918,424,484,899,722,498,243,792,787,158,329,702,775,357,189,189,824 +462,679,138,294,252,250,234,478,302,618,459,570,210,182,827,513,585,476,789,148 +891,105,181,163,256,116,125,737,588,889,534,471,993,226,932,581,187,788,135,459 +68,222,630,691,153,588,882,260,89,71,297,816,576,830,106,697,941,490,94,719 +52,449,128,204,482,211,931,911,242,698,479,818,495,703,181,183,825,561,656,832 +296,172,118,790,431,357,502,87,881,705,746,816,301,118,693,263,703,172,91,557 +406,556,52,302,248,155,534,220,467,224,483,257,121,741,761,885,279,237,398,784 +257,471,573,153,371,258,461,181,492,789,326,835,291,63,176,162,935,176,353,60 +880,914,515,362,497,137,465,70,235,511,306,194,521,924,740,815,466,305,792,98 +149,306,354,895,717,215,54,703,329,74,62,934,208,986,112,212,694,297,511,178 +589,517,516,367,328,68,678,557,785,834,68,97,744,198,400,876,88,986,906,690 +736,763,821,217,992,904,822,193,719,827,942,456,894,370,492,255,163,211,167,355 +795,135,83,765,484,260,760,150,699,495,138,108,563,306,563,198,577,794,256,503 +518,912,193,431,97,699,109,805,553,403,822,931,682,706,520,57,111,220,324,490 +187,101,498,508,895,101,225,592,455,697,560,185,155,511,703,558,688,113,70,656 +148,599,302,126,469,829,191,218,766,87,140,583,578,827,520,701,53,592,817,18 +645,646,152,469,123,222,746,897,984,127,360,745,789,874,898,788,578,111,368,578 +737,558,898,456,448,194,645,694,666,311,74,108,793,813,451,947,501,853,575,242 +988,212,920,72,693,95,471,882,144,79,643,50,587,829,505,562,237,496,885,827 +929,145,403,715,513,871,687,93,625,258,368,326,870,684,710,503,570,920,634,828 +853,198,501,790,904,486,252,609,593,119,714,137,166,51,297,593,701,560,472,685 +452,597,428,300,733,161,207,514,570,93,556,827,448,428,447,303,75,814,302,164 +205,144,492,214,498,710,121,598,650,533,534,823,247,712,83,678,494,172,937,623 +625,211,95,158,465,918,883,364,89,198,74,93,193,481,763,653,301,201,153,643 +134,921,458,789,353,796,173,534,398,88,151,87,300,763,237,456,366,933,358,572 +563,600,168,584,513,98,871,920,360,249,367,762,89,517,479,448,441,502,720,364 +823,492,484,794,872,874,338,181,693,372,77,306,791,508,785,508,472,933,50,756 +307,193,649,793,850,594,220,572,625,74,835,240,150,327,188,711,371,228,245,578 +626,232,497,691,327,943,636,202,321,698,790,682,447,577,371,593,132,820,491,898 +234,823,485,146,84,99,520,236,700,663,201,690,296,120,712,299,105,870,59,649 +448,765,62,297,462,258,660,482,920,591,689,890,821,211,76,586,50,874,99,644 +578,649,819,465,104,884,744,899,873,76,144,553,935,173,949,675,593,826,71,100 +573,163,451,329,215,398,200,650,368,906,354,164,721,297,718,789,4,371,309,136 +508,174,700,555,908,59,902,767,428,576,404,361,898,792,787,498,76,148,503,453 +192,882,896,124,207,299,558,215,822,207,227,80,517,64,338,877,111,564,86,678 +68,920,510,89,822,482,161,638,230,716,885,482,678,698,488,501,501,871,72,120 From dcdb4a727432304211600802a150b0682ded0c90 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Wed, 16 Dec 2020 22:46:56 -0800 Subject: [PATCH 43/52] Completed day 17 --- 2020/days/day17.cpp | 163 ++++++++++++++++++++++++++++++++++++++++ 2020/inputs/day17.input | 8 ++ 2 files changed, 171 insertions(+) create mode 100644 2020/days/day17.cpp create mode 100644 2020/inputs/day17.input diff --git a/2020/days/day17.cpp b/2020/days/day17.cpp new file mode 100644 index 0000000..a016751 --- /dev/null +++ b/2020/days/day17.cpp @@ -0,0 +1,163 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +constexpr auto CYCLES = 6; +constexpr auto BUFFER = CYCLES + 1; + +auto neighbor3d_count(const auto & pocket, i32 x, i32 y, i32 z) -> usize { + auto count = usize(0); + for (auto i = i32(-1); i < 2; ++i) { + for (auto j = i32(-1); j < 2; ++j) { + for (auto k = i32(-1); k < 2; ++k) { + count += (i != 0 || j != 0 || k != 0) && pocket[x + i][y + j][z + k]; + } + } + } + return count; +} + +auto neighbor4d_count(const auto & pocket, i32 w, i32 x, i32 y, i32 z) -> usize { + auto count = usize(0); + for (auto i = i32(-1); i < 2; ++i) { + for (auto j = i32(-1); j < 2; ++j) { + for (auto k = i32(-1); k < 2; ++k) { + for (auto l = i32(-1); l < 2; ++l) { + count += (i != 0 || j != 0 || k != 0 || l != 0) && pocket[w + l][x + i][y + j][z + k]; + } + } + } + } + return count; +} + +auto day17() -> void { + auto pocket = std::vector>>>(); + { + auto lines = std::vector(); + auto line = std::string(); + auto file = std::ifstream("inputs/day17.input"); + while (getline(file, line)) { + lines.push_back(line); + } + + + pocket = std::vector>>>(BUFFER * 2 + 1); + for (auto w = usize(0); w < pocket.size(); ++w) { + pocket[w] = std::vector>>(lines[0].size() + BUFFER * 2); + for (auto i = usize(0); i < pocket[0].size(); ++i) { + auto vec = std::vector>(lines.size() + BUFFER * 2); + for (auto j = usize(0); j < vec.size(); ++j) { + vec[j] = std::vector(BUFFER * 2 + 1); + if (w == BUFFER && i >= BUFFER && i < BUFFER + lines[0].size() && j >= BUFFER && j < BUFFER + lines.size()) { + vec[j][BUFFER] = lines[j - BUFFER][i - BUFFER] == '#'; + } + } + pocket[w][i] = std::move(vec); + } + } + } + + { + auto pockets = std::array>>, 2>{ pocket[BUFFER], pocket[BUFFER] }; + auto bit = false; + for (auto i = usize(0); i < CYCLES; ++i) { + auto & read = pockets[bit]; + auto & write = pockets[bit = !bit]; + for (auto x = i32(1); x < read.size() - 1; ++x) { + for (auto y = i32(1); y < read[0].size() - 1; ++y) { + for (auto z = i32(1); z < read[0][0].size() - 1; ++z) { + auto neighbors = neighbor3d_count(read, x, y, z); + if (read[x][y][z] && (neighbors < 2 || neighbors > 3)) { + write[x][y][z] = false; + } else if (!read[x][y][z] && neighbors == 3) { + write[x][y][z] = true; + } else { + write[x][y][z] = read[x][y][z]; + } + } + } + } + } + + auto & pocket = pockets[bit]; + auto count = usize(0); + for (auto i = usize(0); i < pocket.size(); ++i) { + for (auto j = usize(0); j < pocket[0].size(); ++j) { + for (auto k = usize(0); k < pocket[0][0].size(); ++k) { + count += pocket[i][j][k]; + } + } + } + print(count); + } + + { + auto pockets = std::array>>>, 2>{ pocket, pocket }; + auto bit = false; + for (auto i = usize(0); i < CYCLES; ++i) { + auto & read = pockets[bit]; + auto & write = pockets[bit = !bit]; + for (auto w = i32(1); w < read.size() - 1; ++w) { + for (auto x = i32(1); x < read[0].size() - 1; ++x) { + for (auto y = i32(1); y < read[0][0].size() - 1; ++y) { + for (auto z = i32(1); z < read[0][0][0].size() - 1; ++z) { + auto neighbors = neighbor4d_count(read, w, x, y, z); + if (read[w][x][y][z] && (neighbors < 2 || neighbors > 3)) { + write[w][x][y][z] = false; + } else if (!read[w][x][y][z] && neighbors == 3) { + write[w][x][y][z] = true; + } else { + write[w][x][y][z] = read[w][x][y][z]; + } + } + } + } + } + } + + auto & pocket = pockets[bit]; + auto count = usize(0); + for (auto i = usize(0); i < pocket.size(); ++i) { + for (auto j = usize(0); j < pocket[0].size(); ++j) { + for (auto k = usize(0); k < pocket[0][0].size(); ++k) { + for (auto l = usize(0); l < pocket[0][0][0].size(); ++l) { + count += pocket[i][j][k][l]; + } + } + } + } + print(count); + } +} diff --git a/2020/inputs/day17.input b/2020/inputs/day17.input new file mode 100644 index 0000000..9883294 --- /dev/null +++ b/2020/inputs/day17.input @@ -0,0 +1,8 @@ +###...#. +.##.#### +.####.## +###.###. +.##.#### +#.##..#. +##.####. +.####.#. From 927b1a6091da2e21639dbed4265482991a0fc900 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Wed, 16 Dec 2020 22:46:56 -0800 Subject: [PATCH 44/52] Completed day 17 --- 2020/days/day17.cpp | 163 ++++++++++++++++++++++++++++++++++++++++ 2020/inputs/day17.input | 8 ++ 2 files changed, 171 insertions(+) create mode 100644 2020/days/day17.cpp create mode 100644 2020/inputs/day17.input diff --git a/2020/days/day17.cpp b/2020/days/day17.cpp new file mode 100644 index 0000000..a016751 --- /dev/null +++ b/2020/days/day17.cpp @@ -0,0 +1,163 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +constexpr auto CYCLES = 6; +constexpr auto BUFFER = CYCLES + 1; + +auto neighbor3d_count(const auto & pocket, i32 x, i32 y, i32 z) -> usize { + auto count = usize(0); + for (auto i = i32(-1); i < 2; ++i) { + for (auto j = i32(-1); j < 2; ++j) { + for (auto k = i32(-1); k < 2; ++k) { + count += (i != 0 || j != 0 || k != 0) && pocket[x + i][y + j][z + k]; + } + } + } + return count; +} + +auto neighbor4d_count(const auto & pocket, i32 w, i32 x, i32 y, i32 z) -> usize { + auto count = usize(0); + for (auto i = i32(-1); i < 2; ++i) { + for (auto j = i32(-1); j < 2; ++j) { + for (auto k = i32(-1); k < 2; ++k) { + for (auto l = i32(-1); l < 2; ++l) { + count += (i != 0 || j != 0 || k != 0 || l != 0) && pocket[w + l][x + i][y + j][z + k]; + } + } + } + } + return count; +} + +auto day17() -> void { + auto pocket = std::vector>>>(); + { + auto lines = std::vector(); + auto line = std::string(); + auto file = std::ifstream("inputs/day17.input"); + while (getline(file, line)) { + lines.push_back(line); + } + + + pocket = std::vector>>>(BUFFER * 2 + 1); + for (auto w = usize(0); w < pocket.size(); ++w) { + pocket[w] = std::vector>>(lines[0].size() + BUFFER * 2); + for (auto i = usize(0); i < pocket[0].size(); ++i) { + auto vec = std::vector>(lines.size() + BUFFER * 2); + for (auto j = usize(0); j < vec.size(); ++j) { + vec[j] = std::vector(BUFFER * 2 + 1); + if (w == BUFFER && i >= BUFFER && i < BUFFER + lines[0].size() && j >= BUFFER && j < BUFFER + lines.size()) { + vec[j][BUFFER] = lines[j - BUFFER][i - BUFFER] == '#'; + } + } + pocket[w][i] = std::move(vec); + } + } + } + + { + auto pockets = std::array>>, 2>{ pocket[BUFFER], pocket[BUFFER] }; + auto bit = false; + for (auto i = usize(0); i < CYCLES; ++i) { + auto & read = pockets[bit]; + auto & write = pockets[bit = !bit]; + for (auto x = i32(1); x < read.size() - 1; ++x) { + for (auto y = i32(1); y < read[0].size() - 1; ++y) { + for (auto z = i32(1); z < read[0][0].size() - 1; ++z) { + auto neighbors = neighbor3d_count(read, x, y, z); + if (read[x][y][z] && (neighbors < 2 || neighbors > 3)) { + write[x][y][z] = false; + } else if (!read[x][y][z] && neighbors == 3) { + write[x][y][z] = true; + } else { + write[x][y][z] = read[x][y][z]; + } + } + } + } + } + + auto & pocket = pockets[bit]; + auto count = usize(0); + for (auto i = usize(0); i < pocket.size(); ++i) { + for (auto j = usize(0); j < pocket[0].size(); ++j) { + for (auto k = usize(0); k < pocket[0][0].size(); ++k) { + count += pocket[i][j][k]; + } + } + } + print(count); + } + + { + auto pockets = std::array>>>, 2>{ pocket, pocket }; + auto bit = false; + for (auto i = usize(0); i < CYCLES; ++i) { + auto & read = pockets[bit]; + auto & write = pockets[bit = !bit]; + for (auto w = i32(1); w < read.size() - 1; ++w) { + for (auto x = i32(1); x < read[0].size() - 1; ++x) { + for (auto y = i32(1); y < read[0][0].size() - 1; ++y) { + for (auto z = i32(1); z < read[0][0][0].size() - 1; ++z) { + auto neighbors = neighbor4d_count(read, w, x, y, z); + if (read[w][x][y][z] && (neighbors < 2 || neighbors > 3)) { + write[w][x][y][z] = false; + } else if (!read[w][x][y][z] && neighbors == 3) { + write[w][x][y][z] = true; + } else { + write[w][x][y][z] = read[w][x][y][z]; + } + } + } + } + } + } + + auto & pocket = pockets[bit]; + auto count = usize(0); + for (auto i = usize(0); i < pocket.size(); ++i) { + for (auto j = usize(0); j < pocket[0].size(); ++j) { + for (auto k = usize(0); k < pocket[0][0].size(); ++k) { + for (auto l = usize(0); l < pocket[0][0][0].size(); ++l) { + count += pocket[i][j][k][l]; + } + } + } + } + print(count); + } +} diff --git a/2020/inputs/day17.input b/2020/inputs/day17.input new file mode 100644 index 0000000..9883294 --- /dev/null +++ b/2020/inputs/day17.input @@ -0,0 +1,8 @@ +###...#. +.##.#### +.####.## +###.###. +.##.#### +#.##..#. +##.####. +.####.#. From 9133abeffe62d2fa9b5ebf210d318291626c4dc9 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Thu, 17 Dec 2020 23:58:33 -0800 Subject: [PATCH 45/52] Completed day 18 --- 2020/days/day18.cpp | 128 ++++++++++++++ 2020/inputs/day18.input | 377 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 505 insertions(+) create mode 100644 2020/days/day18.cpp create mode 100644 2020/inputs/day18.input diff --git a/2020/days/day18.cpp b/2020/days/day18.cpp new file mode 100644 index 0000000..c459a7a --- /dev/null +++ b/2020/days/day18.cpp @@ -0,0 +1,128 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +auto evaluate_part1(const std::string & equation, usize & index) -> u64 { + auto value = u64(0); + auto operation = 0; + while (equation[index] != ')') { + if ('0' <= equation[index] && equation[index] <= '9') { + auto end = index; + while ('0' <= equation[++end] && equation[end] <= '9'); + if (operation == 0) { + value += std::stoll(equation.substr(index, end - index)); + } else { + value *= std::stoll(equation.substr(index, end - index)); + } + index = end; + } else if (equation[index] == '+') { + operation = 0; + index += 2; + } else if (equation[index] == '*') { + operation = 1; + index += 2; + } else if (equation[index] == '(') { + if (operation == 0) { + value += evaluate_part1(equation, ++index); + } else { + value *= evaluate_part1(equation, ++index); + } + } else if (equation[index] == ' ') { + ++index; + } + } + ++index; + return value; +} + +auto evaluate_part2(const std::string & equation, usize & index) -> u64; +auto evaluate_part2_addition(const std::string & equation, usize & index) -> u64; +auto evaluate_part2_factor(const std::string & equation, usize & index) -> u64; + +auto evaluate_part2(const std::string & equation, usize & index) -> u64 { + auto value1 = evaluate_part2_addition(equation, index); + if (++index < equation.size() && equation[index] == '*') { + auto value2 = evaluate_part2(equation, index += 2); + return value1 * value2; + } + --index; + return value1; +} + +auto evaluate_part2_addition(const std::string & equation, usize & index) -> u64 { + auto value1 = evaluate_part2_factor(equation, index); + if (++index < equation.size() && equation[index] == '+') { + auto value2 = evaluate_part2_addition(equation, index += 2); + return value1 + value2; + } + --index; + return value1; +} + +auto evaluate_part2_factor(const std::string & equation, usize & index) -> u64 { + auto value = u64(0); + if (equation[index] == '(') { + value = evaluate_part2(equation, ++index); + ++index; + } else { + auto end = index; + while ('0' <= equation[++end] && equation[end] <= '9'); + value = std::stoll(equation.substr(index, end - index)); + index = end; + } + return value; +} + +auto day18() -> void { + auto equations = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day18.input"); + while (getline(file, line)) { + equations.push_back(line + ')'); + } + } + auto sum = u64(0); + for (auto i = usize(0); i < equations.size(); ++i) { + auto index = usize(0); + sum += evaluate_part1(equations[i], index); + } + print(sum); + + sum = u64(0); + for (auto i = usize(0); i < equations.size(); ++i) { + auto index = usize(0); + sum += evaluate_part2_factor('(' + equations[i], index); + } + print(sum); +} diff --git a/2020/inputs/day18.input b/2020/inputs/day18.input new file mode 100644 index 0000000..ea3aedd --- /dev/null +++ b/2020/inputs/day18.input @@ -0,0 +1,377 @@ +9 * 8 + 2 + (4 * (2 * 2 + 9 * 2) * 9 * 3 * 8) + 8 * 5 +8 * (9 + 5 + 5 * 6 + 8 * 3) * 5 * 7 * 4 + 9 +(9 + (2 * 6 + 7 * 5)) * (7 + 7 * 5 + (6 + 2 + 6) * (7 * 8 * 8 + 9)) + 4 * 2 +((8 + 3 * 6 * 2) * 9 + 3) + 5 + 6 * 3 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* 7 * (6 * (6 + 3) * 7 + (9 * 4) + 7 + 6) +4 * 3 * (3 * 8 * 7 * 8 * 4 * (8 + 2)) * (7 * (4 * 4 * 5 * 7 + 4) + 6 + 4) + 8 +(2 + 3) * ((3 * 8) + 2 * 2 + 8 * 8) * (9 + 6) + 2 +4 * 6 + ((2 * 4 * 2 + 6 * 9) + 6) * 9 +9 * 8 * (2 * 7 + 6 * 7 + (8 + 8 * 4 + 9 * 7 + 6)) * 5 * (5 * (5 + 6 + 2) + (3 * 6 * 8 + 9 * 5)) +2 + 2 * (4 + 5 * (9 + 5 * 3 * 3) + 7 * 7 + 6) * 2 +2 + ((3 + 8 + 6 + 7) * 4 + 8 * 8 + 8) * (4 + 4 * 7 + 2 * 9 * 5) + 7 +8 * (7 + 6 * 7) * 2 * 5 + (9 + 5 + 9 + 9 * 6) + 9 +3 + (4 + (2 + 9 + 4 + 4 * 3 * 7) * (5 + 9 * 5 + 5)) + 2 * 7 * 4 + (2 * 4) +4 * (2 * (2 + 5) * 9 + 5 + 5 * 3) * (2 * 4 + 4 * (3 + 6 + 2)) +6 + ((8 + 4) * 3 * 8) +(9 * (8 + 3 * 2 * 9 * 7) + 9 + 5 + (8 * 8 + 8 * 5 * 3 * 4)) * (9 + 5 + 4 * 9) + 3 +2 * 8 + (8 * 4 + 2) * (5 * 5 + 6 + (6 * 4 * 4 * 4 * 3)) + 2 +7 * 4 * (7 * (3 * 4 + 3) + 8) + 9 + 2 * (6 + 7 + (5 + 4 * 2 + 4) * 6) +5 + (9 * (5 * 7 + 6)) * 4 * 2 +6 + 7 * (8 + 6) * 8 * ((4 + 7 * 5 + 2 * 3) + (2 * 3 * 5 * 6 + 9)) + 9 +6 * (2 + 5 + (8 * 6 * 5 * 4 + 7 * 9) * 8 + 2) + 8 + 5 + 5 +2 + 7 + 8 + (3 + (5 * 6 + 6) + 9) * 3 + (7 * (7 + 6) * 9 * (4 + 5 + 3 + 3) + 4) +7 * 8 + 2 + 3 + ((7 + 3 * 4 *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8 + 6 * 8 * (4 + (9 * 8) * 2) + 2 +3 + 7 +8 + 7 + 8 * (5 + 7 * 9 * 9 * 8) +6 + (3 + (5 * 3) + (9 + 6 * 9) * 4 + 8) +7 * 2 + (5 * 6 + 2 + 6 * 3 + (9 + 7 + 7 * 8 + 9 * 7)) * 8 * 7 * 7 +(6 + 3 * 5 * 6) + (2 * 2 * 5) + 8 * 3 * 3 + 5 +(2 * 8 + 6 * (6 + 3 * 2 + 7 * 7 + 6) * 5 + 5) * 3 +(6 * 9 + (5 + 9 * 8) + 2 * (6 * 8 * 8 + 6 + 3) * 7) * (7 + 3 * 5) +4 * 2 + 8 * 9 + 3 +8 * ((5 * 2 * 5 + 9 + 4) * 4 * 2) * 8 + (3 + 2 + 3 * 7 * 8 + 5) + 4 +9 * 9 * 5 +3 * 2 * 8 * (6 + 5 * 9 + 6) From 81fb25d7dda840e94dad1b0c490a0b37165e3560 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Thu, 17 Dec 2020 23:58:33 -0800 Subject: [PATCH 46/52] Completed day 18 --- 2020/days/day18.cpp | 128 ++++++++++++++ 2020/inputs/day18.input | 377 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 505 insertions(+) create mode 100644 2020/days/day18.cpp create mode 100644 2020/inputs/day18.input diff --git a/2020/days/day18.cpp b/2020/days/day18.cpp new file mode 100644 index 0000000..c459a7a --- /dev/null +++ b/2020/days/day18.cpp @@ -0,0 +1,128 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +auto evaluate_part1(const std::string & equation, usize & index) -> u64 { + auto value = u64(0); + auto operation = 0; + while (equation[index] != ')') { + if ('0' <= equation[index] && equation[index] <= '9') { + auto end = index; + while ('0' <= equation[++end] && equation[end] <= '9'); + if (operation == 0) { + value += std::stoll(equation.substr(index, end - index)); + } else { + value *= std::stoll(equation.substr(index, end - index)); + } + index = end; + } else if (equation[index] == '+') { + operation = 0; + index += 2; + } else if (equation[index] == '*') { + operation = 1; + index += 2; + } else if (equation[index] == '(') { + if (operation == 0) { + value += evaluate_part1(equation, ++index); + } else { + value *= evaluate_part1(equation, ++index); + } + } else if (equation[index] == ' ') { + ++index; + } + } + ++index; + return value; +} + +auto evaluate_part2(const std::string & equation, usize & index) -> u64; +auto evaluate_part2_addition(const std::string & equation, usize & index) -> u64; +auto evaluate_part2_factor(const std::string & equation, usize & index) -> u64; + +auto evaluate_part2(const std::string & equation, usize & index) -> u64 { + auto value1 = evaluate_part2_addition(equation, index); + if (++index < equation.size() && equation[index] == '*') { + auto value2 = evaluate_part2(equation, index += 2); + return value1 * value2; + } + --index; + return value1; +} + +auto evaluate_part2_addition(const std::string & equation, usize & index) -> u64 { + auto value1 = evaluate_part2_factor(equation, index); + if (++index < equation.size() && equation[index] == '+') { + auto value2 = evaluate_part2_addition(equation, index += 2); + return value1 + value2; + } + --index; + return value1; +} + +auto evaluate_part2_factor(const std::string & equation, usize & index) -> u64 { + auto value = u64(0); + if (equation[index] == '(') { + value = evaluate_part2(equation, ++index); + ++index; + } else { + auto end = index; + while ('0' <= equation[++end] && equation[end] <= '9'); + value = std::stoll(equation.substr(index, end - index)); + index = end; + } + return value; +} + +auto day18() -> void { + auto equations = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day18.input"); + while (getline(file, line)) { + equations.push_back(line + ')'); + } + } + auto sum = u64(0); + for (auto i = usize(0); i < equations.size(); ++i) { + auto index = usize(0); + sum += evaluate_part1(equations[i], index); + } + print(sum); + + sum = u64(0); + for (auto i = usize(0); i < equations.size(); ++i) { + auto index = usize(0); + sum += evaluate_part2_factor('(' + equations[i], index); + } + print(sum); +} diff --git a/2020/inputs/day18.input b/2020/inputs/day18.input new file mode 100644 index 0000000..ea3aedd --- /dev/null +++ b/2020/inputs/day18.input @@ -0,0 +1,377 @@ +9 * 8 + 2 + (4 * (2 * 2 + 9 * 2) * 9 * 3 * 8) + 8 * 5 +8 * (9 + 5 + 5 * 6 + 8 * 3) * 5 * 7 * 4 + 9 +(9 + (2 * 6 + 7 * 5)) * (7 + 7 * 5 + (6 + 2 + 6) * (7 * 8 * 8 + 9)) + 4 * 2 +((8 + 3 * 6 * 2) * 9 + 3) + 5 + 6 * 3 +6 * (9 + 6 * (7 + 4 + 2 + 5 + 6) * 7 + 3 * (5 * 8 * 6 + 6 * 7 * 8)) + (8 * 8 + 4) + (5 * (2 + 9) * 8) * 4 * 2 +(8 * 6 + 8) + 6 * 8 * (9 * (6 + 8 * 3 + 8) + (7 * 9 * 6 * 3) * 3 + 8 * 4) +3 * 4 * 8 * 7 + (4 + 5 + 8 * (3 + 3 + 3 * 6) + 4 + (3 * 8 * 8 * 6)) + (8 + 8 * (4 + 2 + 5 * 8 + 9)) +8 * ((2 + 8 * 8 * 2 + 3) * 8 + 7 * 4) * (5 + 6) + 4 * 7 +5 * (6 * 2 * 3 + 9) * (3 + 3 * (6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((5 * 2 * 5 + 9 + 4) * 4 * 2) * 8 + (3 + 2 + 3 * 7 * 8 + 5) + 4 +9 * 9 * 5 +3 * 2 * 8 * (6 + 5 * 9 + 6) From 0967ca880025f8ef1a18117f5b56a1d44ac0285d Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Sat, 19 Dec 2020 00:39:13 -0800 Subject: [PATCH 47/52] Completed day 19 --- 2020/days/day19.cpp | 195 +++++++++++++ 2020/inputs/day19.input | 587 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 782 insertions(+) create mode 100644 2020/days/day19.cpp create mode 100644 2020/inputs/day19.input diff --git a/2020/days/day19.cpp b/2020/days/day19.cpp new file mode 100644 index 0000000..9f3ed8c --- /dev/null +++ b/2020/days/day19.cpp @@ -0,0 +1,195 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +enum RuleType { Char, Sequence, Alternator }; + +struct Rule { + RuleType type; + char c; + std::vector list; + std::vector> or_list; + + explicit Rule(char c) noexcept : type(Char), c(c) {} + explicit Rule(std::vector && list) noexcept : type(Sequence), list(std::move(list)) {} + explicit Rule(std::vector> && or_list) noexcept : type(Alternator), or_list(std::move(or_list)) {} +}; + +auto extract_numbers(const std::string & list) -> std::vector { + auto nums = std::vector(); + auto end = usize(0); + auto start = usize(0); + while ((end = list.find(" ", ++end)) != std::string::npos) { + nums.push_back(std::stoll(list.substr(start, end - start))); + start = end + 1; + } + return std::move(nums); +} + +auto matches(const std::string & string, usize & index, std::unordered_map & rules, u64 rule_id, bool sub) -> bool; + +auto matches_list(const std::string & string, usize & index, std::unordered_map & rules, const std::vector & rule_ids, bool sub) -> bool { + auto local_index = index; + for (auto i = usize(0); i < rule_ids.size(); ++i) { + if (!matches(string, local_index, rules, rule_ids[i], true)) { + return false; + } + } + index = local_index; + return (sub || index == string.size()); +} + +auto matches(const std::string & string, usize & index, std::unordered_map & rules, u64 rule_id, bool sub) -> bool { + if (index >= string.size()) { + return false; + } + auto & rule = rules.find(rule_id)->second; + switch (rule.type) { + case Char: { + if (string[index] == rule.c) { + ++index; + return (sub || index == string.size()); + } else { + return false; + } + } + case Sequence: { + return matches_list(string, index, rules, rule.list, sub); + } + case Alternator: { + for (auto i = usize(0); i < rule.or_list.size(); ++i) { + auto local_index = index; + if (matches_list(string, local_index, rules, rule.or_list[i], sub)) { + index = local_index; + return true; + } + } + return false; + } + } + // むだ!makes the compiler happy though + return false; +} + +auto min_length(std::unordered_map & rules, u64 rule_id) -> usize; + +auto min_length_list(std::unordered_map & rules, const std::vector & rule_ids) -> usize { + auto len = usize(0); + for (auto i = usize(0); i < rule_ids.size(); ++i) { + len += min_length(rules, rule_ids[i]); + } + return len; +} + +auto min_length(std::unordered_map & rules, u64 rule_id) -> usize { + auto & rule = rules.find(rule_id)->second; + switch (rule.type) { + case Char: return 1; + case Sequence: return min_length_list(rules, rule.list); + case Alternator: { + auto min = min_length_list(rules, rule.or_list[0]); + for (auto i = usize(1); i < rule.or_list.size(); ++i) { + auto len = min_length_list(rules, rule.or_list[i]); + if (len < min) { + min = len; + } + } + return min; + } + } + // このもむだ! + return 0; +} + +auto day19() -> void { + auto rules = std::unordered_map(); + auto strings = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day19.input"); + getline(file, line); + while (line != "") { + auto end = line.find(":"); + auto id = std::stoll(line.substr(0, end)); + if ((end = line.find("\"")) != std::string::npos) { + rules.insert_or_assign(id, Rule(line[end + 1])); + } else if (line.find("|") != std::string::npos) { + end = line.find(":") + 2; + line = line.substr(end, line.size() - end) + " |"; + auto sequences = std::vector>(); + end = usize(0); + auto start = usize(0); + while ((end = line.find("|", ++end)) != std::string::npos) { + sequences.push_back(extract_numbers(line.substr(start, end - start))); + start = end + 2; + } + rules.insert_or_assign(id, Rule(std::move(sequences))); + } else { + end = line.find(":") + 2; + rules.insert_or_assign(id, Rule(extract_numbers(line.substr(end, line.size() - end) + ' '))); + } + getline(file, line); + } + while (getline(file, line)) { + strings.push_back(std::move(line)); + } + } + + auto successful = usize(0); + for (auto i = usize(0); i < strings.size(); ++i) { + auto index = usize(0); + successful += matches(strings[i], index, rules, 0, false); + } + print(successful); + + successful = usize(0); + auto min_length42 = min_length(rules, 42); + auto min_length31 = min_length(rules, 31); + for (auto i = usize(0); i < strings.size(); ++i) { + auto unsuccessful = true; + auto base = min_length42 * 2 + min_length31; + auto list = std::vector{ 42, 42, 31 }; + for (auto j = usize(0); unsuccessful && j * min_length42 + base <= strings[i].size(); ++j) { + auto copy = list; + for (auto k = usize(0); unsuccessful && k <= j; ++k) { + auto index = usize(0); + unsuccessful = !matches_list(strings[i], index, rules, copy, false); + copy.push_back(31); + } + list.insert(list.begin(), 42); + } + successful += !unsuccessful; + } + print(successful); +} diff --git a/2020/inputs/day19.input b/2020/inputs/day19.input new file mode 100644 index 0000000..bb765f9 --- /dev/null +++ b/2020/inputs/day19.input @@ -0,0 +1,587 @@ +27: 116 44 | 127 69 +19: 60 116 | 55 127 +91: 127 13 | 116 127 +11: 42 31 +30: 80 116 | 100 127 +53: 78 116 | 100 127 +47: 116 129 | 127 76 +21: 57 127 | 100 116 +26: 86 116 | 28 127 +86: 127 122 | 116 29 +74: 127 39 | 116 105 +41: 118 116 | 132 127 +13: 116 | 127 +115: 82 116 | 72 127 +100: 116 116 | 116 127 +5: 78 127 | 91 116 +31: 101 127 | 121 116 +134: 116 117 +73: 123 116 | 62 127 +69: 116 124 | 127 77 +28: 71 116 | 66 127 +14: 131 116 | 128 127 +111: 127 59 | 116 117 +6: 127 53 | 116 79 +104: 26 116 | 65 127 +61: 78 127 | 56 116 +67: 127 30 | 116 130 +32: 81 127 | 27 116 +2: 116 117 | 127 72 +128: 57 116 | 91 127 +81: 127 96 | 116 51 +38: 127 59 | 116 54 +36: 22 127 | 107 116 +35: 116 61 | 127 24 +7: 116 100 +18: 16 116 | 82 127 +116: "a" +54: 116 116 | 127 116 +84: 20 116 | 93 127 +92: 38 127 | 111 116 +64: 127 57 | 116 82 +105: 116 43 | 127 110 +44: 127 106 | 116 88 +93: 33 116 | 56 127 +82: 116 13 | 127 116 +75: 2 127 | 9 116 +65: 127 97 | 116 36 +4: 5 127 | 98 116 +1: 114 127 | 58 116 +122: 54 127 | 59 116 +70: 116 67 | 127 75 +117: 127 127 +68: 48 127 | 40 116 +97: 127 95 | 116 113 +132: 127 33 | 116 54 +51: 23 127 | 30 116 +119: 127 37 | 116 103 +63: 57 127 | 59 116 +34: 57 13 +48: 116 73 | 127 47 +23: 82 127 | 59 116 +66: 127 82 | 116 78 +95: 127 100 | 116 82 +123: 117 116 | 82 127 +24: 116 33 +120: 49 127 | 99 116 +103: 127 90 | 116 83 +102: 72 13 +58: 46 116 | 45 127 +106: 56 127 | 117 116 +85: 126 127 | 133 116 +3: 74 116 | 85 127 +20: 33 127 | 56 116 +127: "b" +45: 116 102 | 127 18 +126: 127 41 | 116 112 +94: 116 87 | 127 21 +114: 35 116 | 19 127 +0: 8 11 +99: 127 34 | 116 76 +80: 116 127 | 127 116 +50: 15 116 | 7 127 +55: 127 91 | 116 59 +90: 92 127 | 94 116 +25: 57 116 | 54 127 +124: 116 57 | 127 91 +77: 78 116 | 78 127 +56: 127 127 | 116 116 +79: 116 59 | 127 57 +12: 127 64 | 116 115 +130: 17 127 | 33 116 +8: 42 +60: 116 72 | 127 59 +113: 117 127 | 117 116 +131: 16 127 | 56 116 +46: 134 116 | 62 127 +83: 6 127 | 50 116 +33: 116 116 +88: 116 57 | 127 54 +118: 116 100 | 127 54 +125: 100 116 +121: 32 116 | 104 127 +29: 127 17 | 116 57 +101: 127 1 | 116 68 +22: 116 117 | 127 100 +43: 127 125 | 116 22 +10: 29 127 | 63 116 +112: 98 116 | 107 127 +87: 80 127 | 57 116 +129: 54 116 | 17 127 +98: 116 80 | 127 117 +57: 116 116 | 127 13 +107: 127 72 | 116 59 +40: 116 14 | 127 4 +39: 12 116 | 84 127 +133: 116 108 | 127 10 +71: 127 56 | 116 54 +76: 116 78 | 127 33 +15: 127 59 | 116 78 +42: 119 116 | 3 127 +9: 127 72 | 116 100 +72: 127 127 | 127 116 +17: 13 13 +16: 116 116 | 13 127 +49: 53 127 | 25 116 +62: 127 80 | 116 100 +52: 72 116 | 33 127 +37: 70 127 | 120 116 +110: 89 127 | 87 116 +96: 116 52 | 127 55 +78: 116 127 +108: 127 109 | 116 71 +109: 116 59 | 127 16 +59: 116 127 | 127 127 +89: 57 127 | 33 116 + +babababababababaabbbbbabaaabbabbabbabbaa +abbbbbaababbbabbbbbaaaaaaaababbbaabbabab +bbaaaaababababbaaaaabbababbabaabaaaaaaabaaaaaaaa +aabaabbaaaaaabaaaaaaabaabaabbbbb +bbaababbaaabaabaababbaaaabaababbaabbbaababbaaabababaabab +bbabbabbabaabbaabbbbaabbbbaabbaa +baaaabbbabaaababbababbbbababbbbbaaaabaabaabbbbaa +aaaabbabbaaaabbbaabaaabbaaabbbbababaabab +bbbaabaabbaabaaaaaababbbbaaaabbaaabaaabbbbbbbbbbbababbab +aabaabbaaabaaaabbbbaababbaabababaabbbbab +bbaabbbbbaaabbbbbabbbbaaaabaabbaabbaabbabbababbb +aaabaabaabaaababbabbabbb +abbababbabbababbaaaaaaab +ababbaaaabbabbabaaaabbaaaabaaabbbaabbbbaabbbabbbbbbaabbabbabbaaaababaabaabbabbaa +abbababaabbbabbbaaababbbabaaababbaababaabaaaaaaaaabababbabababab +baabbbbabaababbabaababbbababbbaa +aaabaabbbbbbaaaabaaaaabaaaaaabaaaababbaaaaaabaab +babababbabaaabbabbbbbbbabaaaabbaabababaaaabbbaab +aabaabbaabbabaababaaaaaabbbababaaabbbbab +aabaaabbbaabaabbabaaabbabbababaabbbbabbb +abababbaaaabbababaaaaabaaaaaabbaabbbaabb +bbaaabbbbaababaabbbaabbbabbbababbbbabbaa +babaaaaabbbbbbabbabaaaba +baaababbaabbbabbaaaababbababbabbbbbbbbbbaabbbaaaaaababbbbbaabbbb +bbbbaaabbaaaabaabbbbbbbabaaababaabbbbaaa +bbabbabbbbabaabbaaaaabab +baaababbbbbbaababaabaabbbbbbaaaaaaaaababaabbbaabaabaaaba +baababaaaababaaaaaaabbbaabbbbbaabaaababaaabbabaaaaabbaaa +abbbbbbbaaabaababaaabbaa +bbbabaaaabbabbbaaaaabaaabbbaabaabbbaaabbbabaaaba +abaabbaabaaabbabaaaaaaaa +aaabaabbaabaaaabaaaabbaabbabbaab +bbaabaaaabbaabaaababaabb +bbabaaababbaaabbbbabbabbabaaaaabbaaaabbbabbababbabbbbaaa +abbaaabbababbabbbaaaabbababaabab +aabababababbbaabaaabababababaaaaaaabbaaabbabaaba +abaaaaabbbbbbaabbaaaabababaaaabb +bbbbabbabababbbbaaaaaaba +aaaaaabbbaabbbababbabbbabaaabbbbabbabbaa +bbbababbbababbbbbbbbbabaabbaabaababbaaaabbababbb +abbabbabaaaabaaabaaabbbaabbaabababbbaabaaaaaaaabbaaababa +abbbabbbabaababbaababaabbabababbaaaaabaababaabaabaabbabbbabbbbbb +bbbaabbbbbbababbaaabbabaabbbbababbaababbabbabaaababaabbb +bbaaaaababbaaaaaabababaaaababbbabaabababbabbbaaa +aabbbabbbbabaabbabbaabba +ababbababbbbaaaabbabbaab +abbaaaababbbbbabbaaabaaabbabbabbbabababbabaabbba +bababaabbbaabaabbaaabbaa +bbbaaaabbababaabbbababab +babaabbbbaaababaababaaabbbaabbab +bbbabaaabaaaababbaabaaabbababbbbbaabbaab +abbbbbbbaababaabaabababb +abbbabaabababababbaaaaabaaabbabb +baaabbabbbbaababbbaabbba +bbbbaabababaabbabaabbbaaaababbab +abbaaaaaaabaaabbbaaabbababbaaaaa +aaaabbabaababbababbbbaababbbbaaa +abbbbbbbbbbaaabbbabbabbb +abaaababbababbbbbabaaaabbabbaabbaaaababb +bbaabbbabbbabbbbabaabbbb +babbaababbbbbbabaababaaabbaabaababaaaaba +bbbaaaabbbbbaaabbaabbaba +ababbaaabbbbbaabbbaabbbbbaabbbbb +baabbbabbaababbbbbbabbbb +abbaabaaaaaabbabbaaabbabababbaaaababbbbbaaaababb +bbbbbaabbbbaaabbbbabaaba +bababbaaaababaaabbbabbba +bbbbaabbaababaabababbbaa +bbbaaaaaabaabbabaabaabaa +bbbaaabbbbabbabbaababbbb +aabababababbaabaabbaaaaaabbabbabaabbabab +babbbabbaaababbbbbabaabbabaaaabb +aababaaabbbbbaaabaabbabb +bbbbbaaabaaabbababbaaaaaabaabaaa +bbaaaaaababaaabbaabbaaaa +baababbbaaaabbaaabaabbba +aababaaaabababaaaaaabbabababbbbb +bbaababaabbababbbbbbbaaaabbbaabbabbbaaaa +bababbbbaababaaabaabbbbb +bbaaaaaababaaaababababaaabaabbba +bbbaaaaaabbaabaaabbaabaaabbabaaababbbabaaabbaaababaaabbb +aabbbbbbbbbaaaaaaabbabbb +bbabaababbbaabaabaaaabbaabbabbbbbabaabbabbbababaaababbababbabbbabbabbbbabbabbbababbabbaababbaaaa +abaaababbabbbaabbabaabbaabaaabbaabbbaaabbaabbaabbbaaaabb +aabaabbbbbbaababbabbaababbbbbbaa +baabaaabbbbbbaaaabbbbbabaabbbaba +bbbbbbbabbaababbabababab +aaabaaabbbbbbababaaababbbbbbbbabaaababababbbbaaaabaababaaabaabababbaabba +abababaabbaabbbbaabbaaaa +bababbbbbbbbbaabbaaabbaa +abbbbbbaaabbbaaaaabbabab +baaaababbbbaaabbaaaaaabbababaabb +abbbbbabbbabaabbbabbaabb +aababbbabbbbaabbaababbaa +bbbbaabbbbaaaabaaabbabaa +abbaaaabbbaaabaabbbababbbbbbbbbabbbaababbaababbabababbabbbbabbbabbaaabba +aaabbabaababaaaaabababbaabbababbbbbbbababbbbbabb +abbbbbababbbaaabaabbaaba +abbbbbbaaabbaaabaabbbbbaaabbaababaaaaaaa +ababaaaaaaababbbaaabaaaa +babbbbaaabaaababbbbbbbaa +abaaaaabbabaaaabbbbbbbaa +bbbaaaabbbbbabbababbbbbb +baabbaaaabaabbaabbbbbbaaabaaabababbbbabaabbbabbaaaababbaaaababbaaabbaaababbbbaba +bababbbabaaababbbabbbbaaaaaabbbaabbabaab +bbbbaabbbababbbbabbbabbbaabbbbba +aaabbbbaabbbaaabaababbaa +aaabbabababbbabbbbbbabbb +ababaaabbbababaabbbbbbbbbabaaabbabbbbbbbababaabb +abbbaaababbbbabaabbaaaaabbbabbaaaaabbabb +baabbbababbabaaabbbbbaaaaaabaabaabaaabbababbaaab +aabaabbabababbbbbbbababbbbabbbabbbaaabba +baaababbbbbaabaabaabbaba +abbbbabaabbbaaabbaabbbabbbbbaaabbbababab +babaaabbabaabbababaaabaa +abaaabbabaaaaaababaaabababaaaaabaabababb +abbbabbbaaababbbababaaaabbabababbbaabbab +aaaaabaaabbbbbbbbaaabbbaabbbbbbabbaabbabaaabbaab +bbbbbbbabbbaaabbaaabaabaababbabaabaaabaaabaaabbb +abbbbbbaabbabbbabbbbabbabbbbabbaaaaababb +bbbbbaaababbbaabaabbbbbbbbbbbbbbbababaaa +abbbbbbbbbbbbaabaabbaaba +abbaaaababbbbbaaabbabbbaaabaabbabbbbbbbababaabaa +abaaabababbbbabaabbaabbaaabababaaabbbabbabbababaabbbaaaaabaabbaaaaaaabba +bbaaabbbaabaaabbbbbaaaaababbabab +baaabaaabaababbabbabaaabaaabbabb +bbbbabbaabababaaabbbaaba +aabbbabbbaabbbbaaaabaaab +abaaabbabbaabaabaababababbabaaabbbbbbabbabbbbbbbbbbbbbbbababbbaabbabbaababbaaaba +bbbaabbbabbbaaabbbbbbabaabaaaaba +abbbbabababbbaabaaaababa +abbabbbaabbbbbbbaaabaabbbbbbaabaaabbabaabaabbbbb +babbbabbbbbaaabbabbaaaaaabbaaaabbbbbbbbb +bbbbaaaaabbabababbaaabbaabaaabbaababababbbbabbbabbaaaabaabbaabaaabbababb +abbabbbabaabbbabaaabbaab +bbaababbbaababaaaabaabab +bbbbababaaabababbbabbbbbbabababaabbaabaababbaaab +baaaababaaaaabbaaaabbbbbbbaaaaabbabbababaaaabbbb +baaaaaabbbaaaaabaaabbaabbabbbaaababbabba +abbbbabababbaabaababbbab +aaabaabaaaabaaabbbbababbaabbaaaabbbabbaa +aaaaaabbbbaaabaaaaaaabaabbbabababaabbaaa +abbbbbbbabbbbabaaabbabaa +bbaaaaabbaababbabbbaabba +abbbbababaaababbbbbbabab +abbababbababbbabaabbaabbaaaaaaaaaaabaaaa +bababbbbbbaaaaaaabbbabba +baaabbabbbbbabbabaabbaababbbaaaa +baabaaababbbaaabbaabaaabaababbbbababaaba +aaaabbaabbbaabbbbaabaabbbaabbaaa +baaabaaaabbbbbabaaabaababaabababbaaababa +abbabbabbaaaaaabbaaaabaababaaaababbbaabb +bbaaaaaaaababbbaaabaaaabbaaaabaababaabaa +baaaaaabaaaabbbaaabbaaba +aababababbbbbaaababababbbbaaaaaabbaaabba +bbbaaabbbabababbbababbaaaaabbaaa +baababaabababaabbbaaaabb +bbaababbaababbbaaababbbb +aaaaaabbaabbbbbbbbaaaaabbaaaababbbbababbbbaaaababababaaaabbbbaab +baaabbabababbabababaabbaabbaabaaabaababbbbabaaabbabbbaaaaaababbabbabbbabaabbbaab +abbbaaabbababbbbabbbabba +aababaababbbbbbbabbababbbbbbbaba +abbbabbbbabaaabbbbaabbbbababbaaaaabababaabbaababbbbbbbaababbaabbbbbbbbaaabababbb +bbbaaaaaaababbabbbbbabaabaabbbabaabbbbbbbababbbb +baababbabaaabaaababaaabbbaabaabbbbbaaabbbabbabaaababaaba +aaabaaababbaaaaaaaabababbabaaaba +abaaababaabaaaabaaaabbbb +bbbaabaababbaababaaaaabaaaabaababbababab +bbbbbabaabbaaaaabaaaaabaabaabaab +baaaabaaabbabaabbbbbbbbb +bbaaaababbbbbbabbaababbaabababbabbbbaaaaabbbbbaababaabaabbbaaabaaaaababbababbbaaaaababba +bbbababbababbabbbabbbaabaabaaabbbababaabaabbaaaa +bbbbaabaaaaabbabbababbab +baabaaabbabaaaaababaaaba +abbbabaabaabbbbaabaababa +abbbbbaabbbbbbabbbbbaabbbaaababbabbabaaaaabababb +bbbbaaabaaababbbaaaaabab +bbbaaaaabbbbaabababbbbba +abbabbbaabbbabbbbaaaabbababbaaababbbaaaa +aaabbaaababbbabaaaababaa +ababaabbabaaaaaaaaaaababbbaaabbbbbbababababbabbaaaaabaabaaabbbab +baababaabbbaabaabababbaabaabbbbabbbbbabb +abbbabbbaabababaabbbaabb +baaaabbaaababaabaabaaabbabbabaabbaaabbbababbbaaa +baababaababbbbaabbaaaaaabbbbaaababaabbaaabaaaaabaaaaabbb +abbabbbbbaaabbbbabbbaaaa +abbbbabababaaaaaabbaaaaababbbbbabbbbabab +bbbaaabbabaaaaaaaaaaaabbababaaaabbaaaaabaabbaaaa +bbbbaabbbababbaaabababbabaaaabaabaabaaaa +baaababbabbaaaababbabbaa +abaaaaabbbabaaabaabaaaabaaabababbbaaababaaababaabbaaabab +bbbaaaabbababbbbababbbba +baaababbbababaababbbbabb +aaabbbbbabbabaababbaaaabbaabbaba +baabaabbaaababababbbbbaababababbaabaabbaaabaaababbabbbaabaabbabbaabbabba +baaaabbbbabaaaaabbabaaabaabaaaabbbaaaababbaaaabaabaabaaaabaabaaaabbbabbaaabbaaab +bababbbbbbbbaabbabbababbbabaaaaabbbabaab +baaabbababaabbababaabaab +abbaaabbbbbbaabaabbbbababababbbbababaaba +bbbbaabaabbaabbaabaabbbb +baababbbbbbbbababaaaabbbaaaaabbb +aaaabbabbabbaababbabaaababbaabab +aababbbabaabaabbbbbaabaabbabbbaa +abaabbaabbaabbbbaabbaabb +bbbaaaabaaabbbbabaaabaaabbababbbaabbbaab +abaabbaaaaabaabbbbbbbababbbbbababbbaabbbbbaabbba +baababbbbbbababbaaaaabaababbbbba +abbabaaaaababaabababbaaabbaaabbabaaabbaa +abaaabbaabababaaaabaaabbbababbbbbaabbbbbaabbabbaababbbab +bbaabbbbbbabbbbaabbaabaababbbaababbababbbbabbabaabbaabbbaabbaaaa +baabababababaaaaaabbabba +babababbbbaaabaaabaabbbb +abbabaaaaaaaabaaabaaabbababbbbaabababaabaaaaaaaaaabbbbbaaaaabababbababba +bbabbabbabaaabbaaabbabab +aabbbbbbbbaababbbaaabaaaaabaaaba +bbaababbabbaaaabababaaba +bbabaabbbaabbbbbabaaabaabbbbbbaa +bbbabaaabbbaaaababababbaabaaababbbbaaabbbbbabbaabbabaababaaababa +abababaaaababbbababbabab +bbbbbabaabbababbbbabbabbaabbaaaa +babbaabababaaaabbbaabbaa +bbbaabbbbababababbabbaab +bbbaabaaabaaaaaaababbbbbbbaaaabababbabababbaaabbababaabbabbaabaabbbabbaa +bbbbabbabababbaaaaaabaab +babbbaabbababbabaaababbbaaababbaaabbaabb +abaabbababaababbabbbaaabbbbbabbb +bbbabaaabaaaabbababbbabbabbbabbbabbbbbbabbabbaaa +bbabaabbaaabaabaabbabbabaabaaabbaabbbbaa +bbababaabaaaaaabbabbbbaabbaabaabaabbbababbaabbba +abbaaabbbaaabbbbbabbbabbaaabbbaa +bbbabaaaabaaabbaabbabbaa +abbbbbbaabbabaaaababbbab +abbbabbbaaaabaaaabbbbbaababaaaababbabbbaaabbbbba +abbabaabbaaabaaaaabaabbbaaabaabaabbbaaaa +bbbaaaaaabbaaaaabaabbbaaabaaaababaaaaabb +baabbbbabababbbabababaabbaaabbabaabbbbaa +aabaabbbabbabbabbabbabba +babbbabbbbbaabbbaababbbabbabaaababbaabab +bbbaabaaaaaabaaaabbbabaababaaaaababaabaaaabbaaabbabbabbb +aabaabbbbaabababaaaaabbb +baababaabaaabbabbaaabbaa +abababbabaabbbabbbaaaabaabbaabbabbbbabbb +abbbabbbabbababbbababaaa +bbabbbbaabababbaabbabaabababbaaaaabbabaabbbbabab +aaabbabababbbabbaabbbbab +bbaabababbaaabbbaabbbbab +baaabbaababbbbbaaabaaabaabaabbbababbaaab +bababbbbbbbbaabbbbbbabaa +bbaaaabaaaaabaaaabbababaaabbbaab +aaabbaabaaaabbabbbaaabababbbbababbbaababbbaaaabbabaabbab +ababbaabaabbbbbbbabaaaabaaaaaaab +baaabbbaaaabbabaababbbab +bbbbaababaabaaababbbabbbbaaabbbbaaaaaabbbabaabaaaabbabbb +bababbaaaaaabaaabbbaababaaaaabbaabbaaaaaaabaaaaaabaabbbbbabbbbababbbaabb +aaabbababaaabbbbabbaaaaaaaaabbbaaaabbbaababaabbb +aabaaaabaaaabbbabababababbbbaabaaabaaaaa +aaaabbaaabbabbbaabbabaaababababbabbabaaaabbaabbb +aaaabbbbbbababbaabbbaabbbabbbbaaabbaaabbbababbaabbbababbabbbababbaababbbaababbaaaaababbb +babababbbbabaabbbbaaaabb +abaabbabaaabaababbababaabbabaaababbbbaaa +aaaaabaabaaaabaaaaabbaaa +baaabbbaabbaaabbaababaabbbaaaaaaabbbaabb +babaaaabbaabbbabbbbabaab +baaababbbbbbbaaaaaaaabaaababbbabaaaaabab +bbbaabaabaabbbabbbaabbba +aaaaabbbabaabbbaabaaabbaabbbbbabaaaabaabaabbabbbbbbabbbbbbabbbbaaaaabbaa +abaaaaabbabbaababbaababbaaaaabaaababbaaaaaaabbbbbaabbaaa +babaaaabbbaababbbaabbaaa +babbbbaaabaabbaababaaaabbbababaabbbbbbaababaabaa +baaaaaababababaabbbabbba +bbaaabaabbaaabaaaabaabbaabbaabbaaabbaaaa +aaabbbbbaaabaababbbbbaababbbaaababbabbbabbbbbbbbaaaababbabbbaaba +bbaabaabbbbbbaaabababbab +baaabbbbbbbbbabbbaaaaabb +aabbbabbbaaaabbbaabaaabbaaabaabaabaabbbbbaabaaba +abbaaaaabbbbbaaaaaaabbbababbabba +bababbbaababbabaababaaab +bababbaaabbbbbabbbabbaab +bbabaabbaaabaababbbbabbaaaaabbbaaaabbbbabbabbaab +bbabaabbbaaaabbaabbbbbaababbbbaaaabbbbba +babaaaabbababababbaaaabababbaaab +bbbbaabaaabababaaabbbbbababbbababaaaaaabbbaabbabaaabbbaa +baaabbbbabbababaabababbaabbaabababaabaaa +bbabaaabaababababaaaababbbbbbbababbaababaabbbaab +bbbbbabbaababaaabbbbbababbbababa +bbbabaaaaabbbbbbbaabbaab +bbbbabbaabbbbbababaaabbaaaabbbbbbbbbbabababbaabb +abbabbabbbbbabbabaaaaaaa +bbaabaabbabbbbaabbbabbaababbbababbababbbbbbbabbb +abababbbaaaababbbabbaabb +bbabaabbaaaaabaaabbabaabaabaaaba +bbabbbbaaaabababbbabbbbb +bbaaaaabaaabbabaabbaabaaaabbbabaaabaaaaa +baaaaaabaabaaabbbaabababaaabaaababaaabbbbabaabaabaabbaba +bbbababbbaababbabaaaabaabbbaabaaabababbbababbbbb +bbaababbbabbbabbaababbbababababbbbbaaaba +baaabababbabbabbabbbbabbbabaaabaaabbaabababbbbbbbaabbbaa +ababaaaabbbbbabaabaabbabababbabbaabbabba +bbabbabbbabababaaabbaaba +baaabbbaabababbbbaabbabbaabbaabbbababbbaabbaaabbbabaaabbaaabbbab +aabababaabaaabbaaaaababb +babaabbaaaabbbbbaaababaa +aaabaaababbbbabbabbabaababababab +abaaaaaabbabbabbababbaabbabaabaa +aaaaabaaabababaabbababba +babbaabbaaaabababbabbbbbaaaababa +bbaabbbbbababaababaabbbb +bbaaaaaabbbbaabbbbbaaabbaaabbaabaababbbb +bbabbbbaaababbaaabbabbaaabbbaabaaababbab +bababababaaaabaaabababbb +baaabbbaaabaaaaaaabbbbba +baabbbbabbbaabaaaaaabbababbaaaaabbaaabbb +babaabbabbbbbabaabaaaaaabbbabbaaabaabbba +babababbbabbbbaaabbaaaababaaaaabababbaaaaaabbbabababbbabababbbbbbbbbabbb +aabaabbbaaabbbbaabbabbabbabbababbaaaaabb +baaabaaabaaabbabaaaabbabbbaabbaaabaabaaa +aaabaababbbbbbabaabbbbbbaaaabaab +aabbabbbbbbbbbbbababbbabaaabbbaa +bbbaabbbababbababbbbaaabbababbbabbababba +bbabbbbabaaabaaababababbaabbaaaa +abbabbabbaaababbbbbaaaba +baaabbbabbbbabbabbbbabbb +abbbabaabbaabaaabbbaaaababbababbabbbaaaaaabbaabb +bbbbbaaabababbbabbbaaaba +baaaababbbaababbaababbaa +baabbbbabbaabaaaaabbaaba +abbbabaabbbaababbbabaaabaaaabbaabbabaaba +bbababaabbbabaaabababbbbabaaabbb +ababbaaaabbbbbabbbabaaba +bbbbaabbbbbaaaabbbaabbbaaaabbabb +bbbbbbababbabbbbabbaaaababbbbbbbbbabbbbb +abbaababbbaabbaaaaabbbababaababaabaaabaaaaaababb +baaabaaabbbbabbababababaaabaaabbabbaaabbbaabbabb +baabbbaaaaaaabbaabaaaaababbabbabbbaaabab +ababababbabbaabbbabbabbbbabaaaaaaaaabbbb +baababbabbbaabbbabaaabbaabbbabba +bbaabbbbbbaababbbabababbbbbaaabbabbaaaaabbbbbbbbbbbbabaaabbbaaaa +baaaaabaaabaaaabaaabbbbaababbaabbbbbbabaaababbaa +abaabbaaabaababbbbaabbaa +baaabaaabbaaaaaababaabab +bbbbaaabbabababbbbaaabba +aaaaaabbababbabbabbabababbabaabbaabbabbbbbbaaababbabbaba +bbbbbabababaaaabaabbaaaa +baaaabaaaaabbbbbbababbbbbbbaabbbbaaabaabababbbaa +bbaaaabaabbbbbaabbaaabaaaababaaabaaaabaababbaaab +bbaabbbbbbaaaabaaaabbbbbbbaaabaaababbaaaabbaaaabaabaaabaabbbabbaababbbab +bbbbaababaaabaaaaabbbbba +aaabbbbaabababaabbaababaaaabababaaaaaaaa +bbaabaabaaaabbbabababbaaabbbbbaabbabaabaaaabbbab +aaabaaabbbaabaaabaaabbababaabbabbbabbbaa +abbabaababbabbbabbbaaabbbbbababa +aaabbbbbaabaabbababbbbba +baaaabaabbaababbababbbba +bbbbbbabbabbbaaaababababaababbbaaababbbabaabbbbaabaabbaaabbbbaaa +abbabaabbaaabaaabaabbaaabaabbaaababbbbbbbbbbaabaabaabbab +abbbbbbbbbbababaaaabaaaaabaababaababbbbababbaaaa +ababbabababbbaababbabbbaabbabbbbbbabbaaa +baaaabaababaabbabbaaaaaabbbaaaaaabaaabababaaaabbbabbaaaa +abbbbbaababbbaababbaaabbbbaaabbbbbababab +aabaabbaabbbbbababaabaaaabbaaabaabbaaababbbbabaaabbababbabbbbabaabbbaaaaaaabaabb +babbaababababababbaabbba +abbabaabaababbbababaabaa +bbaabaaabaabababbaabababbaaababbbbbaaaabbabbbbbbababbbbaababbbbbbabbbaba +aaabaaabbbaaabbbbbaaabaabaaaababbbabbbabababababbbbabbaa +bbbbbbaaabbbabaababaabaaababbbabaaabbbbababaaaabbbbbbbbabaaababbbaaabaabbbbbabbaaaabaaba +aaabbbbabbbaabaaabbaabaabaaababaaabbbaab +abbaaabbbbbbaabbbaababaababbbbba +bbaaaaabbbbabaaabaaabaab +bbbaaaaababababbbaaabbbbbaababbabaabaaaaababbbbabbababba +ababbaaabbbbbbbaabaaaaaababaabaaabaaabaa +baababbbbaaababbaabbbbba +babbabbbabbabbaabababbbbaaaabbbbbbbbaaabbabbaabaaababbab +bbabbabbabbaaaabbaabbbaaaaabaaababbbbbabbabbabba +bbbbaabababababbbabaabab +abbbbabbababbaabaabbabab +aaabaabbbbbabaaaaababbab +baaaaabaabaaabbabbaabbbbbaaabbaa +bbbbaabaababbababbbabbab +aababaaabbbbbbbabbbababbbabbaabbabaaabbb +aabbbaaaaaaaabaabaaaaaabaabbbbbbaabababb +aaaaaabbbaabaabbaabbabba +aaaaabbaaaabaabbabaababa +aaabababbbbaaabbabbaaabbbbbaaaaababaaaaaababbababbbabaab +abaababbabaabbabbbbaababbbaabbba +aababaaabbbbbabaabbabbbbabbabbbbaaabbbbbabbababbbbaaabababaaaaba +aaabaaababbababbaaaabbbabbbbabaaaabbbaba +bbababbbaaabbaababaabbbbaaaabbbabaaaabbababbabbbabbaaaaaabbaaabababaabba +aaaabbaabaaaaaabbababbbbaababbaa +abaababbaaabbbbabbaabaabbbbbaabaababbbabbabbaaab +aababbbbaabbaaaabbaabbabababbabaaabaaaaabaaaabbbabababab +babbbabbbbbaaabbaabbabbb +bbaaaaaaaabbbabbaabaabbabbbbaaaabbababba +bababbbbbbbaabbbbbbabbab +bbbaaabbabbbbbaaababbbbb +abbbbbbbbbbbbaabaabbabbabbbbbabbaabbabbaabaabaababbbabbbbbbbbbaabbbabaaaabbbaaba +aabbbbbbaaaaaabbbbbbaaababbbbbabbbaabaaabbbbbbbb +bbaabababaababbbaaabbbab +bbbbbabbbbbbaabababbabbb +bbabbabbabababbaaaababbbbaabababbaabbabb +aabbbbbbbaaabbabaaabbbbbbaabbaaaaaaabbbb +bababbbaababbaabbaaababbabbabbbbbababbbaaaabbbbbabbabbaa +aabbbaaaaaaabaaaaababaaababbbbabaabaabab +abbaabaaaaabaaabbbaaabbbaaabbbbbbbbbbbaaaabbaabaababbbbb +bbbabbbababababaabbabbbaaaaaabaaaaaaabaabbbbaabaaabbabaabaababbbaaaaabaaabbbbbbbbaaabbaabaaaabaa +baabaaabbaabbbaaaaabbbaa +babaaaaaabbabbababbbabba +bbbbaabbbbabbbbaaaabbbbb +aabaaabbbabbbabbbbabaabbaabbbabbbbaaabaabababaaabbabbaaaabbaabbaaabababb +bababababbbbaaaabaabbbbaaababbaaaaabbaab +bababaabbaaaababaaaaaaba +abbababbbabbaabababbbbaaaabababaaaabababbababaaa +abbaabaaabbabaabbbaaabbbbaaabbbb +abaaababbbaababbabbbabbbaaababaa +bababbbbabbbbababbbabbab +baaabbbababbbabbaabbbbba +aaaabbbabbaaabaaaabbbaaabbababba +bbbaaaabbbabbbbaabbbabba +abaaaaabbbbaaaaabbabaaabaabbabbababbbbbb +aaaaabbaaaabababbbbaaaba +ababaaaaabaabbabbbbaababbbbbbbaababbaaaa +babbbabbabaaaaaabababababaabaababbbabbaa +aaaaaabbaaabaababbaaabba +baabbbaabbababaabbbbaaaabbaabaabbabaabbbaaaababa +abbabaaabaaaabbbaaaaabbb +aababbbaabbbbbabbbababaabbbaabababbbabaaabbbbaab +abbabaaababbabaaabbabbabbaabbbab +bbabbbbaabbbbbabbbaabaabaaabaababbbabaababaaabbbabbaabba +abaabbbabaabbabababaaabbbaabbabaaaababaababbbaabaababbab +abababbabbbababbabbbbabbbabaabab +aaaaabbabaaabaaaabaaabaa +aaabbbbabbabbabbababaaaaaaaaabaabaabbbbb +ababbababbbbabbabbbaaaaabbabbaba +abbbbbbababbbbaaabbabaabaabababb +bbaaabaaaaaabaababaabbabababbaaabbaababbaaabaababbaababbaabababbbaaababaaabbaaabbbbbbaaa +aaaabaaabaababbbabbbbbbaabaabaaa +bbaabaabaababaaaabbbabaabbaabbab +abbbabaaaaaaaabbaababbbaabaaaaababaaaaaabbaabbaa +abbabbababbbabbbabbbabbbaaaabaaabbaabbaaabbbabbabbbbbbbb +bababaabaababbbaabbababaababaaab +bbaaabaaababbaaabbaabbba +aabaabbaabaaaaaabbababbb +ababbbbbbbbbbabbbabbaabbbbbaabababababbabbaabbabaaaabbbbabbbbaab +abaabbaaabbababaabbbaabb +ababaaaaabbabbbababaaaba +baabaabbabaabbaabaababaaabbbbbbbaababaaabaaabbaaabaabbbb +baaabbabaaabbbbbaababaabbabaaabaaaababaa +bbaaabbbbbbbaaabaaaaaaba +aabaaaababbaaaabbbbbbabbaabbaaba +abaabbababbaaaabbababbbaaaabbabb +bbaaababbaabbbababaaaaabbababaabaaaabbaaababbaaaaaaaababaaabbaab +aababbbabababbbaabbbabba From 3e07100d3c83b722c4faf39615ff3a73167c9b4d Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Sat, 19 Dec 2020 00:39:13 -0800 Subject: [PATCH 48/52] Completed day 19 --- 2020/days/day19.cpp | 195 +++++++++++++ 2020/inputs/day19.input | 587 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 782 insertions(+) create mode 100644 2020/days/day19.cpp create mode 100644 2020/inputs/day19.input diff --git a/2020/days/day19.cpp b/2020/days/day19.cpp new file mode 100644 index 0000000..9f3ed8c --- /dev/null +++ b/2020/days/day19.cpp @@ -0,0 +1,195 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +enum RuleType { Char, Sequence, Alternator }; + +struct Rule { + RuleType type; + char c; + std::vector list; + std::vector> or_list; + + explicit Rule(char c) noexcept : type(Char), c(c) {} + explicit Rule(std::vector && list) noexcept : type(Sequence), list(std::move(list)) {} + explicit Rule(std::vector> && or_list) noexcept : type(Alternator), or_list(std::move(or_list)) {} +}; + +auto extract_numbers(const std::string & list) -> std::vector { + auto nums = std::vector(); + auto end = usize(0); + auto start = usize(0); + while ((end = list.find(" ", ++end)) != std::string::npos) { + nums.push_back(std::stoll(list.substr(start, end - start))); + start = end + 1; + } + return std::move(nums); +} + +auto matches(const std::string & string, usize & index, std::unordered_map & rules, u64 rule_id, bool sub) -> bool; + +auto matches_list(const std::string & string, usize & index, std::unordered_map & rules, const std::vector & rule_ids, bool sub) -> bool { + auto local_index = index; + for (auto i = usize(0); i < rule_ids.size(); ++i) { + if (!matches(string, local_index, rules, rule_ids[i], true)) { + return false; + } + } + index = local_index; + return (sub || index == string.size()); +} + +auto matches(const std::string & string, usize & index, std::unordered_map & rules, u64 rule_id, bool sub) -> bool { + if (index >= string.size()) { + return false; + } + auto & rule = rules.find(rule_id)->second; + switch (rule.type) { + case Char: { + if (string[index] == rule.c) { + ++index; + return (sub || index == string.size()); + } else { + return false; + } + } + case Sequence: { + return matches_list(string, index, rules, rule.list, sub); + } + case Alternator: { + for (auto i = usize(0); i < rule.or_list.size(); ++i) { + auto local_index = index; + if (matches_list(string, local_index, rules, rule.or_list[i], sub)) { + index = local_index; + return true; + } + } + return false; + } + } + // むだ!makes the compiler happy though + return false; +} + +auto min_length(std::unordered_map & rules, u64 rule_id) -> usize; + +auto min_length_list(std::unordered_map & rules, const std::vector & rule_ids) -> usize { + auto len = usize(0); + for (auto i = usize(0); i < rule_ids.size(); ++i) { + len += min_length(rules, rule_ids[i]); + } + return len; +} + +auto min_length(std::unordered_map & rules, u64 rule_id) -> usize { + auto & rule = rules.find(rule_id)->second; + switch (rule.type) { + case Char: return 1; + case Sequence: return min_length_list(rules, rule.list); + case Alternator: { + auto min = min_length_list(rules, rule.or_list[0]); + for (auto i = usize(1); i < rule.or_list.size(); ++i) { + auto len = min_length_list(rules, rule.or_list[i]); + if (len < min) { + min = len; + } + } + return min; + } + } + // このもむだ! + return 0; +} + +auto day19() -> void { + auto rules = std::unordered_map(); + auto strings = std::vector(); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day19.input"); + getline(file, line); + while (line != "") { + auto end = line.find(":"); + auto id = std::stoll(line.substr(0, end)); + if ((end = line.find("\"")) != std::string::npos) { + rules.insert_or_assign(id, Rule(line[end + 1])); + } else if (line.find("|") != std::string::npos) { + end = line.find(":") + 2; + line = line.substr(end, line.size() - end) + " |"; + auto sequences = std::vector>(); + end = usize(0); + auto start = usize(0); + while ((end = line.find("|", ++end)) != std::string::npos) { + sequences.push_back(extract_numbers(line.substr(start, end - start))); + start = end + 2; + } + rules.insert_or_assign(id, Rule(std::move(sequences))); + } else { + end = line.find(":") + 2; + rules.insert_or_assign(id, Rule(extract_numbers(line.substr(end, line.size() - end) + ' '))); + } + getline(file, line); + } + while (getline(file, line)) { + strings.push_back(std::move(line)); + } + } + + auto successful = usize(0); + for (auto i = usize(0); i < strings.size(); ++i) { + auto index = usize(0); + successful += matches(strings[i], index, rules, 0, false); + } + print(successful); + + successful = usize(0); + auto min_length42 = min_length(rules, 42); + auto min_length31 = min_length(rules, 31); + for (auto i = usize(0); i < strings.size(); ++i) { + auto unsuccessful = true; + auto base = min_length42 * 2 + min_length31; + auto list = std::vector{ 42, 42, 31 }; + for (auto j = usize(0); unsuccessful && j * min_length42 + base <= strings[i].size(); ++j) { + auto copy = list; + for (auto k = usize(0); unsuccessful && k <= j; ++k) { + auto index = usize(0); + unsuccessful = !matches_list(strings[i], index, rules, copy, false); + copy.push_back(31); + } + list.insert(list.begin(), 42); + } + successful += !unsuccessful; + } + print(successful); +} diff --git a/2020/inputs/day19.input b/2020/inputs/day19.input new file mode 100644 index 0000000..bb765f9 --- /dev/null +++ b/2020/inputs/day19.input @@ -0,0 +1,587 @@ +27: 116 44 | 127 69 +19: 60 116 | 55 127 +91: 127 13 | 116 127 +11: 42 31 +30: 80 116 | 100 127 +53: 78 116 | 100 127 +47: 116 129 | 127 76 +21: 57 127 | 100 116 +26: 86 116 | 28 127 +86: 127 122 | 116 29 +74: 127 39 | 116 105 +41: 118 116 | 132 127 +13: 116 | 127 +115: 82 116 | 72 127 +100: 116 116 | 116 127 +5: 78 127 | 91 116 +31: 101 127 | 121 116 +134: 116 117 +73: 123 116 | 62 127 +69: 116 124 | 127 77 +28: 71 116 | 66 127 +14: 131 116 | 128 127 +111: 127 59 | 116 117 +6: 127 53 | 116 79 +104: 26 116 | 65 127 +61: 78 127 | 56 116 +67: 127 30 | 116 130 +32: 81 127 | 27 116 +2: 116 117 | 127 72 +128: 57 116 | 91 127 +81: 127 96 | 116 51 +38: 127 59 | 116 54 +36: 22 127 | 107 116 +35: 116 61 | 127 24 +7: 116 100 +18: 16 116 | 82 127 +116: "a" +54: 116 116 | 127 116 +84: 20 116 | 93 127 +92: 38 127 | 111 116 +64: 127 57 | 116 82 +105: 116 43 | 127 110 +44: 127 106 | 116 88 +93: 33 116 | 56 127 +82: 116 13 | 127 116 +75: 2 127 | 9 116 +65: 127 97 | 116 36 +4: 5 127 | 98 116 +1: 114 127 | 58 116 +122: 54 127 | 59 116 +70: 116 67 | 127 75 +117: 127 127 +68: 48 127 | 40 116 +97: 127 95 | 116 113 +132: 127 33 | 116 54 +51: 23 127 | 30 116 +119: 127 37 | 116 103 +63: 57 127 | 59 116 +34: 57 13 +48: 116 73 | 127 47 +23: 82 127 | 59 116 +66: 127 82 | 116 78 +95: 127 100 | 116 82 +123: 117 116 | 82 127 +24: 116 33 +120: 49 127 | 99 116 +103: 127 90 | 116 83 +102: 72 13 +58: 46 116 | 45 127 +106: 56 127 | 117 116 +85: 126 127 | 133 116 +3: 74 116 | 85 127 +20: 33 127 | 56 116 +127: "b" +45: 116 102 | 127 18 +126: 127 41 | 116 112 +94: 116 87 | 127 21 +114: 35 116 | 19 127 +0: 8 11 +99: 127 34 | 116 76 +80: 116 127 | 127 116 +50: 15 116 | 7 127 +55: 127 91 | 116 59 +90: 92 127 | 94 116 +25: 57 116 | 54 127 +124: 116 57 | 127 91 +77: 78 116 | 78 127 +56: 127 127 | 116 116 +79: 116 59 | 127 57 +12: 127 64 | 116 115 +130: 17 127 | 33 116 +8: 42 +60: 116 72 | 127 59 +113: 117 127 | 117 116 +131: 16 127 | 56 116 +46: 134 116 | 62 127 +83: 6 127 | 50 116 +33: 116 116 +88: 116 57 | 127 54 +118: 116 100 | 127 54 +125: 100 116 +121: 32 116 | 104 127 +29: 127 17 | 116 57 +101: 127 1 | 116 68 +22: 116 117 | 127 100 +43: 127 125 | 116 22 +10: 29 127 | 63 116 +112: 98 116 | 107 127 +87: 80 127 | 57 116 +129: 54 116 | 17 127 +98: 116 80 | 127 117 +57: 116 116 | 127 13 +107: 127 72 | 116 59 +40: 116 14 | 127 4 +39: 12 116 | 84 127 +133: 116 108 | 127 10 +71: 127 56 | 116 54 +76: 116 78 | 127 33 +15: 127 59 | 116 78 +42: 119 116 | 3 127 +9: 127 72 | 116 100 +72: 127 127 | 127 116 +17: 13 13 +16: 116 116 | 13 127 +49: 53 127 | 25 116 +62: 127 80 | 116 100 +52: 72 116 | 33 127 +37: 70 127 | 120 116 +110: 89 127 | 87 116 +96: 116 52 | 127 55 +78: 116 127 +108: 127 109 | 116 71 +109: 116 59 | 127 16 +59: 116 127 | 127 127 +89: 57 127 | 33 116 + +babababababababaabbbbbabaaabbabbabbabbaa +abbbbbaababbbabbbbbaaaaaaaababbbaabbabab +bbaaaaababababbaaaaabbababbabaabaaaaaaabaaaaaaaa +aabaabbaaaaaabaaaaaaabaabaabbbbb +bbaababbaaabaabaababbaaaabaababbaabbbaababbaaabababaabab +bbabbabbabaabbaabbbbaabbbbaabbaa +baaaabbbabaaababbababbbbababbbbbaaaabaabaabbbbaa +aaaabbabbaaaabbbaabaaabbaaabbbbababaabab +bbbaabaabbaabaaaaaababbbbaaaabbaaabaaabbbbbbbbbbbababbab +aabaabbaaabaaaabbbbaababbaabababaabbbbab +bbaabbbbbaaabbbbbabbbbaaaabaabbaabbaabbabbababbb +aaabaabaabaaababbabbabbb +abbababbabbababbaaaaaaab +ababbaaaabbabbabaaaabbaaaabaaabbbaabbbbaabbbabbbbbbaabbabbabbaaaababaabaabbabbaa +abbababaabbbabbbaaababbbabaaababbaababaabaaaaaaaaabababbabababab +baabbbbabaababbabaababbbababbbaa +aaabaabbbbbbaaaabaaaaabaaaaaabaaaababbaaaaaabaab +babababbabaaabbabbbbbbbabaaaabbaabababaaaabbbaab +aabaabbaabbabaababaaaaaabbbababaaabbbbab +aabaaabbbaabaabbabaaabbabbababaabbbbabbb +abababbaaaabbababaaaaabaaaaaabbaabbbaabb +bbaaabbbbaababaabbbaabbbabbbababbbbabbaa +babaaaaabbbbbbabbabaaaba +baaababbaabbbabbaaaababbababbabbbbbbbbbbaabbbaaaaaababbbbbaabbbb +bbbbaaabbaaaabaabbbbbbbabaaababaabbbbaaa +bbabbabbbbabaabbaaaaabab +baaababbbbbbaababaabaabbbbbbaaaaaaaaababaabbbaabaabaaaba +baababaaaababaaaaaaabbbaabbbbbaabaaababaaabbabaaaaabbaaa +abbbbbbbaaabaababaaabbaa +bbbabaaaabbabbbaaaaabaaabbbaabaabbbaaabbbabaaaba +abaabbaabaaabbabaaaaaaaa +aaabaabbaabaaaabaaaabbaabbabbaab +bbaabaaaabbaabaaababaabb +bbabaaababbaaabbbbabbabbabaaaaabbaaaabbbabbababbabbbbaaa +abbaaabbababbabbbaaaabbababaabab +aabababababbbaabaaabababababaaaaaaabbaaabbabaaba +abaaaaabbbbbbaabbaaaabababaaaabb +bbbbabbabababbbbaaaaaaba +aaaaaabbbaabbbababbabbbabaaabbbbabbabbaa +bbbababbbababbbbbbbbbabaabbaabaababbaaaabbababbb +abbabbabaaaabaaabaaabbbaabbaabababbbaabaaaaaaaabbaaababa +abbbabbbabaababbaababaabbabababbaaaaabaababaabaabaabbabbbabbbbbb +bbbaabbbbbbababbaaabbabaabbbbababbaababbabbabaaababaabbb +bbaaaaababbaaaaaabababaaaababbbabaabababbabbbaaa +aabbbabbbbabaabbabbaabba +ababbababbbbaaaabbabbaab +abbaaaababbbbbabbaaabaaabbabbabbbabababbabaabbba +bababaabbbaabaabbaaabbaa +bbbaaaabbababaabbbababab +babaabbbbaaababaababaaabbbaabbab +bbbabaaabaaaababbaabaaabbababbbbbaabbaab +abbbbbbbaababaabaabababb +abbbabaabababababbaaaaabaaabbabb +baaabbabbbbaababbbaabbba +bbbbaabababaabbabaabbbaaaababbab +abbaaaaaaabaaabbbaaabbababbaaaaa +aaaabbabaababbababbbbaababbbbaaa +abbbbbbbbbbaaabbbabbabbb +abaaababbababbbbbabaaaabbabbaabbaaaababb +bbaabbbabbbabbbbabaabbbb +babbaababbbbbbabaababaaabbaabaababaaaaba +bbbaaaabbbbbaaabbaabbaba +ababbaaabbbbbaabbbaabbbbbaabbbbb +baabbbabbaababbbbbbabbbb +abbaabaaaaaabbabbaaabbabababbaaaababbbbbaaaababb +bbbbbaabbbbaaabbbbabaaba +bababbaaaababaaabbbabbba +bbbbaabbaababaabababbbaa +bbbaaaaaabaabbabaabaabaa +bbbaaabbbbabbabbaababbbb +aabababababbaabaabbaaaaaabbabbabaabbabab +babbbabbaaababbbbbabaabbabaaaabb +aababaaabbbbbaaabaabbabb +bbbbbaaabaaabbababbaaaaaabaabaaa +bbaaaaaababaaabbaabbaaaa +baababbbaaaabbaaabaabbba +aababaaaabababaaaaaabbabababbbbb +bbaababaabbababbbbbbbaaaabbbaabbabbbaaaa +bababbbbaababaaabaabbbbb +bbaaaaaababaaaababababaaabaabbba +bbbaaaaaabbaabaaabbaabaaabbabaaababbbabaaabbaaababaaabbb +aabbbbbbbbbaaaaaaabbabbb +bbabaababbbaabaabaaaabbaabbabbbbbabaabbabbbababaaababbababbabbbabbabbbbabbabbbababbabbaababbaaaa +abaaababbabbbaabbabaabbaabaaabbaabbbaaabbaabbaabbbaaaabb +aabaabbbbbbaababbabbaababbbbbbaa +baabaaabbbbbbaaaabbbbbabaabbbaba +bbbbbbbabbaababbabababab +aaabaaabbbbbbababaaababbbbbbbbabaaababababbbbaaaabaababaaabaabababbaabba +abababaabbaabbbbaabbaaaa +bababbbbbbbbbaabbaaabbaa +abbbbbbaaabbbaaaaabbabab +baaaababbbbaaabbaaaaaabbababaabb +abbbbbabbbabaabbbabbaabb +aababbbabbbbaabbaababbaa +bbbbaabbbbaaaabaaabbabaa +abbaaaabbbaaabaabbbababbbbbbbbbabbbaababbaababbabababbabbbbabbbabbaaabba +aaabbabaababaaaaabababbaabbababbbbbbbababbbbbabb +abbbbbababbbaaabaabbaaba +abbbbbbaaabbaaabaabbbbbaaabbaababaaaaaaa +ababaaaaaaababbbaaabaaaa +babbbbaaabaaababbbbbbbaa +abaaaaabbabaaaabbbbbbbaa +bbbaaaabbbbbabbababbbbbb +baabbaaaabaabbaabbbbbbaaabaaabababbbbabaabbbabbaaaababbaaaababbaaabbaaababbbbaba +bababbbabaaababbbabbbbaaaaaabbbaabbabaab +bbbbaabbbababbbbabbbabbbaabbbbba +aaabbbbaabbbaaabaababbaa +aaabbabababbbabbbbbbabbb +ababaaabbbababaabbbbbbbbbabaaabbabbbbbbbababaabb +abbbaaababbbbabaabbaaaaabbbabbaaaaabbabb +baabbbababbabaaabbbbbaaaaaabaabaabaaabbababbaaab +aabaabbabababbbbbbbababbbbabbbabbbaaabba +baaababbbbbaabaabaabbaba +abbbbabaabbbaaabbaabbbabbbbbaaabbbababab +babaaabbabaabbababaaabaa +abaaabbabaaaaaababaaabababaaaaabaabababb +abbbabbbaaababbbababaaaabbabababbbaabbab +aaaaabaaabbbbbbbbaaabbbaabbbbbbabbaabbabaaabbaab +bbbbbbbabbbaaabbaaabaabaababbabaabaaabaaabaaabbb +abbbbbbaabbabbbabbbbabbabbbbabbaaaaababb +bbbbbaaababbbaabaabbbbbbbbbbbbbbbababaaa +abbbbbbbbbbbbaabaabbaaba +abbaaaababbbbbaaabbabbbaaabaabbabbbbbbbababaabaa +abaaabababbbbabaabbaabbaaabababaaabbbabbabbababaabbbaaaaabaabbaaaaaaabba +bbaaabbbaabaaabbbbbaaaaababbabab +baaabaaabaababbabbabaaabaaabbabb +bbbbabbaabababaaabbbaaba +aabbbabbbaabbbbaaaabaaab +abaaabbabbaabaabaababababbabaaabbbbbbabbabbbbbbbbbbbbbbbababbbaabbabbaababbaaaba +bbbaabbbabbbaaabbbbbbabaabaaaaba +abbbbabababbbaabaaaababa +abbabbbaabbbbbbbaaabaabbbbbbaabaaabbabaabaabbbbb +babbbabbbbbaaabbabbaaaaaabbaaaabbbbbbbbb +bbbbaaaaabbabababbaaabbaabaaabbaababababbbbabbbabbaaaabaabbaabaaabbababb +abbabbbabaabbbabaaabbaab +bbaababbbaababaaaabaabab +bbbbababaaabababbbabbbbbbabababaabbaabaababbaaab +baaaababaaaaabbaaaabbbbbbbaaaaabbabbababaaaabbbb +baaaaaabbbaaaaabaaabbaabbabbbaaababbabba +abbbbabababbaabaababbbab +aaabaabaaaabaaabbbbababbaabbaaaabbbabbaa +aaaaaabbbbaaabaaaaaaabaabbbabababaabbaaa +abbbbbbbabbbbabaaabbabaa +bbaaaaabbaababbabbbaabba +abbbbababaaababbbbbbabab +abbababbababbbabaabbaabbaaaaaaaaaaabaaaa +bababbbbbbaaaaaaabbbabba +baaabbabbbbbabbabaabbaababbbaaaa +baabaaababbbaaabbaabaaabaababbbbababaaba +aaaabbaabbbaabbbbaabaabbbaabbaaa +baaabaaaabbbbbabaaabaababaabababbaaababa +abbabbabbaaaaaabbaaaabaababaaaababbbaabb +bbaaaaaaaababbbaaabaaaabbaaaabaababaabaa +baaaaaabaaaabbbaaabbaaba +aababababbbbbaaababababbbbaaaaaabbaaabba +bbbaaabbbabababbbababbaaaaabbaaa +baababaabababaabbbaaaabb +bbaababbaababbbaaababbbb +aaaaaabbaabbbbbbbbaaaaabbaaaababbbbababbbbaaaababababaaaabbbbaab +baaabbabababbabababaabbaabbaabaaabaababbbbabaaabbabbbaaaaaababbabbabbbabaabbbaab +abbbaaabbababbbbabbbabba +aababaababbbbbbbabbababbbbbbbaba +abbbabbbbabaaabbbbaabbbbababbaaaaabababaabbaababbbbbbbaababbaabbbbbbbbaaabababbb +bbbaaaaaaababbabbbbbabaabaabbbabaabbbbbbbababbbb +baababbabaaabaaababaaabbbaabaabbbbbaaabbbabbabaaababaaba +aaabaaababbaaaaaaaabababbabaaaba +abaaababaabaaaabaaaabbbb +bbbaabaababbaababaaaaabaaaabaababbababab +bbbbbabaabbaaaaabaaaaabaabaabaab +baaaabaaabbabaabbbbbbbbb +bbaaaababbbbbbabbaababbaabababbabbbbaaaaabbbbbaababaabaabbbaaabaaaaababbababbbaaaaababba +bbbababbababbabbbabbbaabaabaaabbbababaabaabbaaaa +bbbbaabaaaaabbabbababbab +baabaaabbabaaaaababaaaba +abbbabaabaabbbbaabaababa +abbbbbaabbbbbbabbbbbaabbbaaababbabbabaaaaabababb +bbbbaaabaaababbbaaaaabab +bbbaaaaabbbbaabababbbbba +abbabbbaabbbabbbbaaaabbababbaaababbbaaaa +aaabbaaababbbabaaaababaa +ababaabbabaaaaaaaaaaababbbaaabbbbbbababababbabbaaaaabaabaaabbbab +baababaabbbaabaabababbaabaabbbbabbbbbabb +abbbabbbaabababaabbbaabb +baaaabbaaababaabaabaaabbabbabaabbaaabbbababbbaaa +baababaababbbbaabbaaaaaabbbbaaababaabbaaabaaaaabaaaaabbb +abbabbbbbaaabbbbabbbaaaa +abbbbabababaaaaaabbaaaaababbbbbabbbbabab +bbbaaabbabaaaaaaaaaaaabbababaaaabbaaaaabaabbaaaa +bbbbaabbbababbaaabababbabaaaabaabaabaaaa +baaababbabbaaaababbabbaa +abaaaaabbbabaaabaabaaaabaaabababbbaaababaaababaabbaaabab +bbbaaaabbababbbbababbbba +baaababbbababaababbbbabb +aaabbbbbabbabaababbaaaabbaabbaba +baabaabbaaababababbbbbaababababbaabaabbaaabaaababbabbbaabaabbabbaabbabba +baaaabbbbabaaaaabbabaaabaabaaaabbbaaaababbaaaabaabaabaaaabaabaaaabbbabbaaabbaaab +bababbbbbbbbaabbabbababbbabaaaaabbbabaab +baaabbababaabbababaabaab +abbaaabbbbbbaabaabbbbababababbbbababaaba +bbbbaabaabbaabbaabaabbbb +baababbbbbbbbababaaaabbbaaaaabbb +aaaabbabbabbaababbabaaababbaabab +aababbbabaabaabbbbbaabaabbabbbaa +abaabbaabbaabbbbaabbaabb +bbbaaaabaaabbbbabaaabaaabbababbbaabbbaab +abaabbaaaaabaabbbbbbbababbbbbababbbaabbbbbaabbba +baababbbbbbababbaaaaabaababbbbba +abbabaaaaababaabababbaaabbaaabbabaaabbaa +abaaabbaabababaaaabaaabbbababbbbbaabbbbbaabbabbaababbbab +bbaabbbbbbabbbbaabbaabaababbbaababbababbbbabbabaabbaabbbaabbaaaa +baabababababaaaaaabbabba +babababbbbaaabaaabaabbbb +abbabaaaaaaaabaaabaaabbababbbbaabababaabaaaaaaaaaabbbbbaaaaabababbababba +bbabbabbabaaabbaaabbabab +aabbbbbbbbaababbbaaabaaaaabaaaba +bbaababbabbaaaabababaaba +bbabaabbbaabbbbbabaaabaabbbbbbaa +bbbabaaabbbaaaababababbaabaaababbbbaaabbbbbabbaabbabaababaaababa +abababaaaababbbababbabab +bbbbbabaabbababbbbabbabbaabbaaaa +babbaabababaaaabbbaabbaa +bbbaabbbbababababbabbaab +bbbaabaaabaaaaaaababbbbbbbaaaabababbabababbaaabbababaabbabbaabaabbbabbaa +bbbbabbabababbaaaaaabaab +babbbaabbababbabaaababbbaaababbaaabbaabb +abaabbababaababbabbbaaabbbbbabbb +bbbabaaabaaaabbababbbabbabbbabbbabbbbbbabbabbaaa +bbabaabbaaabaabaabbabbabaabaaabbaabbbbaa +bbababaabaaaaaabbabbbbaabbaabaabaabbbababbaabbba +abbaaabbbaaabbbbbabbbabbaaabbbaa +bbbabaaaabaaabbaabbabbaa +abbbbbbaabbabaaaababbbab +abbbabbbaaaabaaaabbbbbaababaaaababbabbbaaabbbbba +abbabaabbaaabaaaaabaabbbaaabaabaabbbaaaa +bbbaaaaaabbaaaaabaabbbaaabaaaababaaaaabb +baabbbbabababbbabababaabbaaabbabaabbbbaa +aabaabbbabbabbabbabbabba +babbbabbbbbaabbbaababbbabbabaaababbaabab +bbbaabaaaaaabaaaabbbabaababaaaaababaabaaaabbaaabbabbabbb +aabaabbbbaabababaaaaabbb +baababaabaaabbabbaaabbaa +abababbabaabbbabbbaaaabaabbaabbabbbbabbb +abbbabbbabbababbbababaaa +bbabbbbaabababbaabbabaabababbaaaaabbabaabbbbabab +aaabbabababbbabbaabbbbab +bbaabababbaaabbbaabbbbab +baaabbaababbbbbaaabaaabaabaabbbababbaaab +bababbbbbbbbaabbbbbbabaa +bbaaaabaaaaabaaaabbababaaabbbaab +aaabbaabaaaabbabbbaaabababbbbababbbaababbbaaaabbabaabbab +ababbaabaabbbbbbbabaaaabaaaaaaab +baaabbbaaaabbabaababbbab +bbbbaababaabaaababbbabbbbaaabbbbaaaaaabbbabaabaaaabbabbb +bababbaaaaaabaaabbbaababaaaaabbaabbaaaaaaabaaaaaabaabbbbbabbbbababbbaabb +aaabbababaaabbbbabbaaaaaaaaabbbaaaabbbaababaabbb +aabaaaabaaaabbbabababababbbbaabaaabaaaaa +aaaabbaaabbabbbaabbabaaababababbabbabaaaabbaabbb +aaaabbbbbbababbaabbbaabbbabbbbaaabbaaabbbababbaabbbababbabbbababbaababbbaababbaaaaababbb +babababbbbabaabbbbaaaabb +abaabbabaaabaababbababaabbabaaababbbbaaa +aaaaabaabaaaabaaaaabbaaa +baaabbbaabbaaabbaababaabbbaaaaaaabbbaabb +babaaaabbaabbbabbbbabaab +baaababbbbbbbaaaaaaaabaaababbbabaaaaabab +bbbaabaabaabbbabbbaabbba +aaaaabbbabaabbbaabaaabbaabbbbbabaaaabaabaabbabbbbbbabbbbbbabbbbaaaaabbaa +abaaaaabbabbaababbaababbaaaaabaaababbaaaaaaabbbbbaabbaaa +babaaaabbbaababbbaabbaaa +babbbbaaabaabbaababaaaabbbababaabbbbbbaababaabaa +baaaaaababababaabbbabbba +bbaaabaabbaaabaaaabaabbaabbaabbaaabbaaaa +aaabbbbbaaabaababbbbbaababbbaaababbabbbabbbbbbbbaaaababbabbbaaba +bbaabaabbbbbbaaabababbab +baaabbbbbbbbbabbbaaaaabb +aabbbabbbaaaabbbaabaaabbaaabaabaabaabbbbbaabaaba +abbaaaaabbbbbaaaaaaabbbababbabba +bababbbaababbabaababaaab +bababbaaabbbbbabbbabbaab +bbabaabbaaabaababbbbabbaaaaabbbaaaabbbbabbabbaab +bbabaabbbaaaabbaabbbbbaababbbbaaaabbbbba +babaaaabbababababbaaaabababbaaab +bbbbaabaaabababaaabbbbbababbbababaaaaaabbbaabbabaaabbbaa +baaabbbbabbababaabababbaabbaabababaabaaa +bbabaaabaababababaaaababbbbbbbababbaababaabbbaab +bbbbbabbaababaaabbbbbababbbababa +bbbabaaaaabbbbbbbaabbaab +bbbbabbaabbbbbababaaabbaaaabbbbbbbbbbabababbaabb +abbabbabbbbbabbabaaaaaaa +bbaabaabbabbbbaabbbabbaababbbababbababbbbbbbabbb +abababbbaaaababbbabbaabb +bbabaabbaaaaabaaabbabaabaabaaaba +bbabbbbaaaabababbbabbbbb +bbaaaaabaaabbabaabbaabaaaabbbabaaabaaaaa +baaaaaabaabaaabbbaabababaaabaaababaaabbbbabaabaabaabbaba +bbbababbbaababbabaaaabaabbbaabaaabababbbababbbbb +bbaababbbabbbabbaababbbababababbbbbaaaba +baaabababbabbabbabbbbabbbabaaabaaabbaabababbbbbbbaabbbaa +ababaaaabbbbbabaabaabbabababbabbaabbabba +bbabbabbbabababaaabbaaba +baaabbbaabababbbbaabbabbaabbaabbbababbbaabbaaabbbabaaabbaaabbbab +aabababaabaaabbaaaaababb +babaabbaaaabbbbbaaababaa +aaabaaababbbbabbabbabaababababab +abaaaaaabbabbabbababbaabbabaabaa +aaaaabaaabababaabbababba +babbaabbaaaabababbabbbbbaaaababa +bbaabbbbbababaababaabbbb +bbaaaaaabbbbaabbbbbaaabbaaabbaabaababbbb +bbabbbbaaababbaaabbabbaaabbbaabaaababbab +bababababaaaabaaabababbb +baaabbbaaabaaaaaaabbbbba +baabbbbabbbaabaaaaaabbababbaaaaabbaaabbb +babaabbabbbbbabaabaaaaaabbbabbaaabaabbba +babababbbabbbbaaabbaaaababaaaaabababbaaaaaabbbabababbbabababbbbbbbbbabbb +aabaabbbaaabbbbaabbabbabbabbababbaaaaabb +baaabaaabaaabbabaaaabbabbbaabbaaabaabaaa +aaabaababbbbbbabaabbbbbbaaaabaab +aabbabbbbbbbbbbbababbbabaaabbbaa +bbbaabbbababbababbbbaaabbababbbabbababba +bbabbbbabaaabaaababababbaabbaaaa +abbabbabbaaababbbbbaaaba +baaabbbabbbbabbabbbbabbb +abbbabaabbaabaaabbbaaaababbababbabbbaaaaaabbaabb +bbbbbaaabababbbabbbaaaba +baaaababbbaababbaababbaa +baabbbbabbaabaaaaabbaaba +abbbabaabbbaababbbabaaabaaaabbaabbabaaba +bbababaabbbabaaabababbbbabaaabbb +ababbaaaabbbbbabbbabaaba +bbbbaabbbbbaaaabbbaabbbaaaabbabb +bbbbbbababbabbbbabbaaaababbbbbbbbbabbbbb +abbaababbbaabbaaaaabbbababaababaabaaabaaaaaababb +baaabaaabbbbabbababababaaabaaabbabbaaabbbaabbabb +baabbbaaaaaaabbaabaaaaababbabbabbbaaabab +ababababbabbaabbbabbabbbbabaaaaaaaaabbbb +baababbabbbaabbbabaaabbaabbbabba +bbaabbbbbbaababbbabababbbbbaaabbabbaaaaabbbbbbbbbbbbabaaabbbaaaa +baaaaabaaabaaaabaaabbbbaababbaabbbbbbabaaababbaa +abaabbaaabaababbbbaabbaa +baaabaaabbaaaaaababaabab +bbbbaaabbabababbbbaaabba +aaaaaabbababbabbabbabababbabaabbaabbabbbbbbaaababbabbaba +bbbbbabababaaaabaabbaaaa +baaaabaaaaabbbbbbababbbbbbbaabbbbaaabaabababbbaa +bbaaaabaabbbbbaabbaaabaaaababaaabaaaabaababbaaab +bbaabbbbbbaaaabaaaabbbbbbbaaabaaababbaaaabbaaaabaabaaabaabbbabbaababbbab +bbbbaababaaabaaaaabbbbba +aaabbbbaabababaabbaababaaaabababaaaaaaaa +bbaabaabaaaabbbabababbaaabbbbbaabbabaabaaaabbbab +aaabaaabbbaabaaabaaabbababaabbabbbabbbaa +abbabaababbabbbabbbaaabbbbbababa +aaabbbbbaabaabbababbbbba +baaaabaabbaababbababbbba +bbbbbbabbabbbaaaababababaababbbaaababbbabaabbbbaabaabbaaabbbbaaa +abbabaabbaaabaaabaabbaaabaabbaaababbbbbbbbbbaabaabaabbab +abbbbbbbbbbababaaaabaaaaabaababaababbbbababbaaaa +ababbabababbbaababbabbbaabbabbbbbbabbaaa +baaaabaababaabbabbaaaaaabbbaaaaaabaaabababaaaabbbabbaaaa +abbbbbaababbbaababbaaabbbbaaabbbbbababab +aabaabbaabbbbbababaabaaaabbaaabaabbaaababbbbabaaabbababbabbbbabaabbbaaaaaaabaabb +babbaababababababbaabbba +abbabaabaababbbababaabaa +bbaabaaabaabababbaabababbaaababbbbbaaaabbabbbbbbababbbbaababbbbbbabbbaba +aaabaaabbbaaabbbbbaaabaabaaaababbbabbbabababababbbbabbaa +bbbbbbaaabbbabaababaabaaababbbabaaabbbbababaaaabbbbbbbbabaaababbbaaabaabbbbbabbaaaabaaba +aaabbbbabbbaabaaabbaabaabaaababaaabbbaab +abbaaabbbbbbaabbbaababaababbbbba +bbaaaaabbbbabaaabaaabaab +bbbaaaaababababbbaaabbbbbaababbabaabaaaaababbbbabbababba +ababbaaabbbbbbbaabaaaaaababaabaaabaaabaa +baababbbbaaababbaabbbbba +babbabbbabbabbaabababbbbaaaabbbbbbbbaaabbabbaabaaababbab +bbabbabbabbaaaabbaabbbaaaaabaaababbbbbabbabbabba +bbbbaabababababbbabaabab +abbbbabbababbaabaabbabab +aaabaabbbbbabaaaaababbab +baaaaabaabaaabbabbaabbbbbaaabbaa +bbbbaabaababbababbbabbab +aababaaabbbbbbbabbbababbbabbaabbabaaabbb +aabbbaaaaaaaabaabaaaaaabaabbbbbbaabababb +aaaaaabbbaabaabbaabbabba +aaaaabbaaaabaabbabaababa +aaabababbbbaaabbabbaaabbbbbaaaaababaaaaaababbababbbabaab +abaababbabaabbabbbbaababbbaabbba +aababaaabbbbbabaabbabbbbabbabbbbaaabbbbbabbababbbbaaabababaaaaba +aaabaaababbababbaaaabbbabbbbabaaaabbbaba +bbababbbaaabbaababaabbbbaaaabbbabaaaabbababbabbbabbaaaaaabbaaabababaabba +aaaabbaabaaaaaabbababbbbaababbaa +abaababbaaabbbbabbaabaabbbbbaabaababbbabbabbaaab +aababbbbaabbaaaabbaabbabababbabaaabaaaaabaaaabbbabababab +babbbabbbbbaaabbaabbabbb +bbaaaaaaaabbbabbaabaabbabbbbaaaabbababba +bababbbbbbbaabbbbbbabbab +bbbaaabbabbbbbaaababbbbb +abbbbbbbbbbbbaabaabbabbabbbbbabbaabbabbaabaabaababbbabbbbbbbbbaabbbabaaaabbbaaba +aabbbbbbaaaaaabbbbbbaaababbbbbabbbaabaaabbbbbbbb +bbaabababaababbbaaabbbab +bbbbbabbbbbbaabababbabbb +bbabbabbabababbaaaababbbbaabababbaabbabb +aabbbbbbbaaabbabaaabbbbbbaabbaaaaaaabbbb +bababbbaababbaabbaaababbabbabbbbbababbbaaaabbbbbabbabbaa +aabbbaaaaaaabaaaaababaaababbbbabaabaabab +abbaabaaaaabaaabbbaaabbbaaabbbbbbbbbbbaaaabbaabaababbbbb +bbbabbbababababaabbabbbaaaaaabaaaaaaabaabbbbaabaaabbabaabaababbbaaaaabaaabbbbbbbbaaabbaabaaaabaa +baabaaabbaabbbaaaaabbbaa +babaaaaaabbabbababbbabba +bbbbaabbbbabbbbaaaabbbbb +aabaaabbbabbbabbbbabaabbaabbbabbbbaaabaabababaaabbabbaaaabbaabbaaabababb +bababababbbbaaaabaabbbbaaababbaaaaabbaab +bababaabbaaaababaaaaaaba +abbababbbabbaabababbbbaaaabababaaaabababbababaaa +abbaabaaabbabaabbbaaabbbbaaabbbb +abaaababbbaababbabbbabbbaaababaa +bababbbbabbbbababbbabbab +baaabbbababbbabbaabbbbba +aaaabbbabbaaabaaaabbbaaabbababba +bbbaaaabbbabbbbaabbbabba +abaaaaabbbbaaaaabbabaaabaabbabbababbbbbb +aaaaabbaaaabababbbbaaaba +ababaaaaabaabbabbbbaababbbbbbbaababbaaaa +babbbabbabaaaaaabababababaabaababbbabbaa +aaaaaabbaaabaababbaaabba +baabbbaabbababaabbbbaaaabbaabaabbabaabbbaaaababa +abbabaaabaaaabbbaaaaabbb +aababbbaabbbbbabbbababaabbbaabababbbabaaabbbbaab +abbabaaababbabaaabbabbabbaabbbab +bbabbbbaabbbbbabbbaabaabaaabaababbbabaababaaabbbabbaabba +abaabbbabaabbabababaaabbbaabbabaaaababaababbbaabaababbab +abababbabbbababbabbbbabbbabaabab +aaaaabbabaaabaaaabaaabaa +aaabbbbabbabbabbababaaaaaaaaabaabaabbbbb +ababbababbbbabbabbbaaaaabbabbaba +abbbbbbababbbbaaabbabaabaabababb +bbaaabaaaaaabaababaabbabababbaaabbaababbaaabaababbaababbaabababbbaaababaaabbaaabbbbbbaaa +aaaabaaabaababbbabbbbbbaabaabaaa +bbaabaabaababaaaabbbabaabbaabbab +abbbabaaaaaaaabbaababbbaabaaaaababaaaaaabbaabbaa +abbabbababbbabbbabbbabbbaaaabaaabbaabbaaabbbabbabbbbbbbb +bababaabaababbbaabbababaababaaab +bbaaabaaababbaaabbaabbba +aabaabbaabaaaaaabbababbb +ababbbbbbbbbbabbbabbaabbbbbaabababababbabbaabbabaaaabbbbabbbbaab +abaabbaaabbababaabbbaabb +ababaaaaabbabbbababaaaba +baabaabbabaabbaabaababaaabbbbbbbaababaaabaaabbaaabaabbbb +baaabbabaaabbbbbaababaabbabaaabaaaababaa +bbaaabbbbbbbaaabaaaaaaba +aabaaaababbaaaabbbbbbabbaabbaaba +abaabbababbaaaabbababbbaaaabbabb +bbaaababbaabbbababaaaaabbababaabaaaabbaaababbaaaaaaaababaaabbaab +aababbbabababbbaabbbabba From 6b74fe74aa7a27596314c2e9c0a6bb66343a72b4 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Wed, 23 Dec 2020 16:35:27 -0800 Subject: [PATCH 49/52] Completed day 23 --- 2020/days/day23.cpp | 105 ++++++++++++++++++++++++++++++++++++++++ 2020/inputs/day23.input | 1 + 2 files changed, 106 insertions(+) create mode 100644 2020/days/day23.cpp create mode 100644 2020/inputs/day23.input diff --git a/2020/days/day23.cpp b/2020/days/day23.cpp new file mode 100644 index 0000000..f3cc3b4 --- /dev/null +++ b/2020/days/day23.cpp @@ -0,0 +1,105 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +constexpr auto CUP_COUNT = 9; + +auto day23() -> void { + auto start = usize(0); + auto nums = std::array(); + auto big_nums = std::vector(1000000); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day23.input"); + getline(file, line); + for (auto i = usize(0); i < CUP_COUNT; ++i) { + nums[line[i] - '1'] = line[(i + 1) % CUP_COUNT] - '1'; + } + start = line[0] - '1'; + for (auto i = usize(0); i < CUP_COUNT; ++i) { + if (nums[i] != start) { + big_nums[i] = nums[i]; + } else { + big_nums[i] = CUP_COUNT; + } + } + for (auto i = CUP_COUNT; i < big_nums.size() - 1; ++i) { + big_nums[i] = i + 1; + } + big_nums[big_nums.size() - 1] = start; + } + + auto begin = usize(0); + auto end = usize(0); + + // Part 1 + auto current = start; + for (auto i = usize(0); i < 100; ++i) { + begin = nums[current]; + end = nums[nums[begin]]; + nums[current] = nums[end]; + auto destination = current; + while ( + begin == (destination = (destination + CUP_COUNT - 1) % CUP_COUNT) + || nums[begin] == destination + || end == destination + ); + nums[end] = nums[destination]; + nums[destination] = begin; + current = nums[current]; + } + auto out = std::array{ 0 }; + for (auto i = nums[0], j = usize(0); i != 0; i = nums[i], ++j) { + out[j] = (i + '1'); + } + print(&out[0]); + + // Part 2 + current = start; + for (auto i = usize(0); i < 10000000; ++i) { + begin = big_nums[current]; + end = big_nums[big_nums[begin]]; + big_nums[current] = big_nums[end]; + auto destination = current; + while ( + begin == (destination = (destination + big_nums.size() - 1) % big_nums.size()) + || big_nums[begin] == destination + || end == destination + ); + big_nums[end] = big_nums[destination]; + big_nums[destination] = begin; + current = big_nums[current]; + } + print(((big_nums[0] + 1) * (big_nums[big_nums[0]] + 1))); +} diff --git a/2020/inputs/day23.input b/2020/inputs/day23.input new file mode 100644 index 0000000..f5a2d22 --- /dev/null +++ b/2020/inputs/day23.input @@ -0,0 +1 @@ +247819356 From 426e8425368112b29280cd438cfaef6f748c6ce6 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Wed, 23 Dec 2020 16:35:27 -0800 Subject: [PATCH 50/52] Completed day 23 --- 2020/days/day23.cpp | 105 ++++++++++++++++++++++++++++++++++++++++ 2020/inputs/day23.input | 1 + 2 files changed, 106 insertions(+) create mode 100644 2020/days/day23.cpp create mode 100644 2020/inputs/day23.input diff --git a/2020/days/day23.cpp b/2020/days/day23.cpp new file mode 100644 index 0000000..f3cc3b4 --- /dev/null +++ b/2020/days/day23.cpp @@ -0,0 +1,105 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +constexpr auto CUP_COUNT = 9; + +auto day23() -> void { + auto start = usize(0); + auto nums = std::array(); + auto big_nums = std::vector(1000000); + { + auto line = std::string(); + auto file = std::ifstream("inputs/day23.input"); + getline(file, line); + for (auto i = usize(0); i < CUP_COUNT; ++i) { + nums[line[i] - '1'] = line[(i + 1) % CUP_COUNT] - '1'; + } + start = line[0] - '1'; + for (auto i = usize(0); i < CUP_COUNT; ++i) { + if (nums[i] != start) { + big_nums[i] = nums[i]; + } else { + big_nums[i] = CUP_COUNT; + } + } + for (auto i = CUP_COUNT; i < big_nums.size() - 1; ++i) { + big_nums[i] = i + 1; + } + big_nums[big_nums.size() - 1] = start; + } + + auto begin = usize(0); + auto end = usize(0); + + // Part 1 + auto current = start; + for (auto i = usize(0); i < 100; ++i) { + begin = nums[current]; + end = nums[nums[begin]]; + nums[current] = nums[end]; + auto destination = current; + while ( + begin == (destination = (destination + CUP_COUNT - 1) % CUP_COUNT) + || nums[begin] == destination + || end == destination + ); + nums[end] = nums[destination]; + nums[destination] = begin; + current = nums[current]; + } + auto out = std::array{ 0 }; + for (auto i = nums[0], j = usize(0); i != 0; i = nums[i], ++j) { + out[j] = (i + '1'); + } + print(&out[0]); + + // Part 2 + current = start; + for (auto i = usize(0); i < 10000000; ++i) { + begin = big_nums[current]; + end = big_nums[big_nums[begin]]; + big_nums[current] = big_nums[end]; + auto destination = current; + while ( + begin == (destination = (destination + big_nums.size() - 1) % big_nums.size()) + || big_nums[begin] == destination + || end == destination + ); + big_nums[end] = big_nums[destination]; + big_nums[destination] = begin; + current = big_nums[current]; + } + print(((big_nums[0] + 1) * (big_nums[big_nums[0]] + 1))); +} diff --git a/2020/inputs/day23.input b/2020/inputs/day23.input new file mode 100644 index 0000000..f5a2d22 --- /dev/null +++ b/2020/inputs/day23.input @@ -0,0 +1 @@ +247819356 From 3b0619a2ca0cb47047e8797e1c1dd5d55cdaab86 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Sun, 6 Oct 2024 21:15:16 +0000 Subject: [PATCH 51/52] Piss poor attempt at AoC 2021 and I'm 3 years late publishing it :/ --- 2021/Makefile | 17 + 2021/days/day1.cpp | 54 + 2021/inputs/day1.input | 2000 ++++++++++++++++++++++++++++++++++++ 2021/misc/day.cpp.template | 23 + 2021/misc/main.cpp | 36 + 2021/misc/main_test.cpp | 66 ++ 2021/misc/print.hpp | 31 + 2021/misc/types.cpp | 47 + 2021/misc/types.hpp | 70 ++ 9 files changed, 2344 insertions(+) create mode 100644 2021/Makefile create mode 100644 2021/days/day1.cpp create mode 100644 2021/inputs/day1.input create mode 100644 2021/misc/day.cpp.template create mode 100644 2021/misc/main.cpp create mode 100644 2021/misc/main_test.cpp create mode 100644 2021/misc/print.hpp create mode 100644 2021/misc/types.cpp create mode 100644 2021/misc/types.hpp diff --git a/2021/Makefile b/2021/Makefile new file mode 100644 index 0000000..2978a55 --- /dev/null +++ b/2021/Makefile @@ -0,0 +1,17 @@ +day%.out: out/types.o misc/main.cpp days/day%.cpp + g++ -O3 -std=c++2a $(flags) -Dcurrent_day=$(@:.out=) days/$(@:out=cpp) misc/main.cpp out/types.o -o $@ + +day%_test.out: out/types.o misc/main_test.cpp days/day%.cpp + g++ -O3 -std=c++2a $(flags) -DTEST_BUILD -Dcurrent_day=$(@:_test.out=) days/$(@:_test.out=.cpp) misc/main_test.cpp out/types.o -o $@ + +days/day%.cpp: + cp 'misc/day.cpp.template' $@ + sed -i -e "s/current_day/$(shell basename $@ | cut -f 1 -d '.')/g" $@ + +out/types.o: misc/types.hpp misc/types.cpp + mkdir -p out/ + g++ -std=c++2a $(flags) -c misc/types.cpp -o $@ + +.PHONY: clean +clean: + rm -f out/* day*.out day*.output diff --git a/2021/days/day1.cpp b/2021/days/day1.cpp new file mode 100644 index 0000000..4f8c65c --- /dev/null +++ b/2021/days/day1.cpp @@ -0,0 +1,54 @@ +/***************************** + * + * Copyright (c) 2021 Gnarwhal + * + *****************************/ + +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +auto current_day() -> void { + { + auto line = std::string(); + auto file = std::ifstream("inputs/day1.input"); + getline(file, line); + auto value = stoi(line); + auto increases = 0; + while (getline(file, line)) { + auto new_value = stoi(line); + increases += new_value > value; + value = new_value; + } + + std::cout << increases << std::endl; + } + + { + auto line = std::string(); + auto file = std::ifstream("inputs/day1.input"); + getline(file, line); + auto index = 2; + auto values = std::vector{ 0, 0 }; + while (getline(file, line)) { + auto new_value = stoi(line); + values.push_back(0); + values[index - 2] += new_value; + values[index - 1] += new_value; + values[index ] += new_value; + ++index; + } + + auto increases = 0; + for (auto i = 3; i < values.size(); ++i) { + increases += values[i - 1] < values[i]; + } + + std::cout << increases << std::endl; + } +} + diff --git a/2021/inputs/day1.input b/2021/inputs/day1.input new file mode 100644 index 0000000..bc99d0b --- /dev/null +++ b/2021/inputs/day1.input @@ -0,0 +1,2000 @@ +199 +227 +229 +230 +233 +228 +231 +226 +237 +259 +262 +265 +266 +265 +269 +276 +278 +279 +281 +287 +305 +316 +314 +320 +313 +314 +315 +329 +346 +357 +370 +369 +360 +384 +383 +401 +402 +403 +404 +403 +406 +408 +406 +401 +393 +395 +416 +418 +408 +411 +412 +416 +417 +404 +421 +436 +437 +436 +420 +388 +405 +403 +371 +376 +378 +374 +378 +377 +403 +411 +444 +424 +417 +416 +419 +436 +415 +413 +429 +446 +462 +463 +464 +467 +466 +475 +483 +478 +487 +488 +469 +470 +472 +473 +460 +463 +465 +477 +487 +508 +506 +509 +512 +513 +519 +525 +531 +498 +506 +504 +506 +507 +509 +510 +512 +537 +553 +536 +533 +524 +525 +526 +527 +530 +531 +533 +537 +538 +537 +539 +544 +552 +550 +576 +560 +556 +561 +552 +560 +572 +573 +572 +571 +573 +578 +581 +582 +578 +541 +546 +537 +545 +556 +565 +566 +571 +561 +573 +579 +578 +581 +600 +603 +604 +597 +598 +599 +598 +599 +580 +585 +586 +596 +597 +602 +593 +598 +599 +604 +608 +609 +616 +615 +613 +622 +625 +620 +632 +636 +628 +633 +640 +621 +620 +638 +646 +647 +648 +647 +654 +655 +663 +652 +664 +668 +669 +668 +663 +667 +659 +658 +666 +670 +685 +703 +706 +705 +706 +727 +730 +729 +735 +743 +749 +750 +751 +756 +774 +776 +767 +778 +777 +790 +791 +794 +798 +801 +804 +812 +818 +819 +818 +821 +825 +818 +829 +832 +835 +849 +848 +863 +859 +863 +871 +870 +869 +873 +875 +878 +874 +896 +903 +890 +891 +905 +912 +913 +911 +917 +941 +943 +944 +940 +943 +945 +947 +948 +953 +930 +932 +933 +948 +936 +937 +941 +947 +952 +957 +951 +953 +954 +958 +979 +982 +971 +974 +979 +984 +988 +989 +986 +987 +992 +998 +1013 +1024 +1022 +1023 +1014 +1019 +1042 +1048 +1047 +1060 +1056 +1067 +1054 +1053 +1061 +1063 +1068 +1074 +1104 +1105 +1107 +1119 +1126 +1127 +1129 +1143 +1145 +1146 +1151 +1159 +1183 +1185 +1192 +1183 +1185 +1182 +1180 +1198 +1215 +1221 +1224 +1227 +1230 +1262 +1289 +1291 +1294 +1297 +1300 +1303 +1321 +1323 +1329 +1331 +1341 +1362 +1369 +1370 +1388 +1389 +1393 +1407 +1386 +1380 +1381 +1378 +1398 +1402 +1399 +1422 +1433 +1449 +1451 +1449 +1462 +1454 +1455 +1452 +1471 +1472 +1487 +1477 +1459 +1463 +1461 +1463 +1473 +1489 +1482 +1516 +1527 +1521 +1522 +1527 +1529 +1531 +1538 +1550 +1553 +1548 +1549 +1545 +1548 +1543 +1546 +1549 +1572 +1576 +1581 +1575 +1584 +1602 +1604 +1605 +1606 +1611 +1610 +1623 +1618 +1614 +1622 +1613 +1608 +1611 +1638 +1632 +1643 +1649 +1652 +1655 +1652 +1653 +1654 +1658 +1659 +1661 +1667 +1695 +1710 +1719 +1726 +1727 +1725 +1726 +1736 +1741 +1763 +1752 +1769 +1770 +1767 +1768 +1769 +1771 +1799 +1798 +1810 +1813 +1816 +1826 +1837 +1842 +1841 +1848 +1853 +1823 +1836 +1835 +1837 +1836 +1839 +1838 +1840 +1841 +1839 +1843 +1844 +1862 +1873 +1877 +1880 +1882 +1881 +1895 +1891 +1896 +1899 +1893 +1894 +1892 +1894 +1895 +1921 +1920 +1922 +1928 +1925 +1933 +1943 +1942 +1936 +1941 +1919 +1912 +1914 +1922 +1918 +1934 +1932 +1946 +1949 +1955 +1964 +1974 +1977 +1978 +1983 +1984 +1986 +1990 +2005 +2022 +2026 +2032 +2031 +2029 +2031 +2035 +2041 +2042 +2043 +2053 +2054 +2058 +2062 +2063 +2055 +2049 +2021 +2022 +2054 +2052 +2084 +2076 +2079 +2090 +2088 +2093 +2095 +2093 +2091 +2089 +2095 +2096 +2102 +2127 +2129 +2132 +2117 +2125 +2131 +2132 +2126 +2134 +2140 +2137 +2138 +2136 +2137 +2141 +2153 +2152 +2170 +2177 +2147 +2159 +2161 +2160 +2173 +2176 +2194 +2205 +2206 +2213 +2231 +2232 +2242 +2243 +2217 +2224 +2225 +2230 +2226 +2214 +2212 +2227 +2230 +2237 +2238 +2241 +2264 +2283 +2288 +2308 +2309 +2311 +2312 +2314 +2316 +2317 +2318 +2321 +2326 +2324 +2325 +2321 +2324 +2322 +2325 +2327 +2335 +2369 +2370 +2374 +2375 +2344 +2347 +2348 +2341 +2346 +2355 +2356 +2371 +2368 +2370 +2375 +2378 +2379 +2370 +2363 +2365 +2366 +2363 +2364 +2372 +2374 +2392 +2399 +2397 +2384 +2400 +2401 +2402 +2401 +2400 +2402 +2412 +2422 +2423 +2426 +2424 +2425 +2421 +2422 +2440 +2441 +2451 +2442 +2443 +2444 +2446 +2451 +2452 +2450 +2458 +2457 +2490 +2496 +2506 +2507 +2508 +2511 +2531 +2536 +2537 +2539 +2529 +2530 +2561 +2562 +2592 +2595 +2584 +2601 +2603 +2589 +2586 +2588 +2586 +2596 +2613 +2616 +2618 +2621 +2629 +2637 +2638 +2619 +2621 +2619 +2631 +2621 +2619 +2624 +2628 +2634 +2636 +2637 +2626 +2632 +2623 +2630 +2629 +2630 +2633 +2620 +2629 +2635 +2614 +2617 +2612 +2613 +2609 +2601 +2604 +2611 +2602 +2607 +2611 +2639 +2646 +2647 +2618 +2613 +2614 +2635 +2642 +2649 +2653 +2652 +2628 +2629 +2631 +2636 +2639 +2649 +2665 +2667 +2666 +2665 +2668 +2672 +2673 +2675 +2693 +2694 +2696 +2701 +2702 +2703 +2700 +2716 +2718 +2719 +2718 +2719 +2722 +2723 +2715 +2726 +2737 +2757 +2758 +2759 +2762 +2760 +2765 +2759 +2763 +2764 +2774 +2785 +2786 +2802 +2803 +2802 +2824 +2833 +2834 +2830 +2832 +2842 +2828 +2829 +2836 +2838 +2813 +2811 +2798 +2799 +2796 +2805 +2808 +2807 +2811 +2812 +2811 +2812 +2793 +2787 +2802 +2805 +2804 +2822 +2825 +2837 +2835 +2842 +2838 +2849 +2840 +2841 +2853 +2854 +2863 +2877 +2886 +2864 +2866 +2846 +2860 +2840 +2842 +2844 +2866 +2867 +2870 +2856 +2860 +2861 +2860 +2872 +2877 +2881 +2883 +2881 +2883 +2880 +2881 +2882 +2880 +2902 +2903 +2904 +2937 +2939 +2938 +2945 +2954 +2950 +2966 +2967 +2976 +2980 +2982 +2976 +2986 +2997 +2996 +2994 +3004 +3007 +3008 +3016 +3014 +3054 +3078 +3095 +3114 +3115 +3120 +3107 +3109 +3124 +3140 +3144 +3150 +3163 +3165 +3164 +3158 +3172 +3175 +3174 +3184 +3188 +3198 +3193 +3224 +3226 +3227 +3252 +3273 +3280 +3289 +3291 +3290 +3291 +3279 +3281 +3282 +3281 +3298 +3302 +3289 +3304 +3295 +3312 +3314 +3327 +3328 +3337 +3348 +3349 +3340 +3348 +3351 +3350 +3351 +3350 +3345 +3339 +3343 +3344 +3329 +3354 +3356 +3358 +3363 +3365 +3373 +3376 +3383 +3384 +3388 +3389 +3390 +3397 +3398 +3401 +3409 +3411 +3412 +3411 +3418 +3428 +3430 +3432 +3418 +3410 +3418 +3424 +3425 +3426 +3430 +3439 +3441 +3422 +3423 +3425 +3426 +3428 +3429 +3436 +3448 +3447 +3443 +3445 +3468 +3482 +3483 +3499 +3506 +3513 +3518 +3523 +3524 +3525 +3529 +3532 +3529 +3565 +3577 +3576 +3577 +3576 +3539 +3557 +3554 +3563 +3562 +3564 +3565 +3586 +3583 +3590 +3589 +3580 +3581 +3574 +3599 +3597 +3609 +3610 +3611 +3614 +3613 +3611 +3612 +3611 +3598 +3596 +3597 +3585 +3568 +3569 +3550 +3561 +3563 +3551 +3552 +3555 +3553 +3554 +3553 +3552 +3555 +3557 +3560 +3585 +3591 +3604 +3609 +3640 +3641 +3645 +3644 +3643 +3646 +3644 +3664 +3653 +3660 +3667 +3664 +3665 +3668 +3670 +3649 +3640 +3639 +3647 +3654 +3650 +3648 +3654 +3651 +3652 +3653 +3654 +3655 +3671 +3660 +3671 +3675 +3679 +3680 +3681 +3686 +3690 +3691 +3693 +3695 +3698 +3697 +3699 +3708 +3712 +3714 +3712 +3711 +3716 +3731 +3732 +3736 +3753 +3755 +3756 +3767 +3747 +3746 +3733 +3711 +3722 +3718 +3721 +3722 +3723 +3724 +3727 +3731 +3732 +3741 +3743 +3750 +3751 +3738 +3741 +3739 +3740 +3756 +3755 +3751 +3750 +3755 +3757 +3773 +3778 +3781 +3782 +3768 +3772 +3766 +3770 +3778 +3792 +3798 +3801 +3803 +3801 +3812 +3833 +3873 +3868 +3865 +3866 +3906 +3910 +3897 +3907 +3910 +3898 +3914 +3917 +3908 +3912 +3920 +3934 +3930 +3934 +3935 +3937 +3942 +3943 +3948 +3964 +3978 +3985 +3986 +3993 +3995 +4014 +4021 +4024 +4025 +4024 +4027 +4028 +4043 +4047 +4049 +4036 +4039 +4038 +4037 +4045 +4040 +4041 +4043 +4035 +4046 +4063 +4054 +4055 +4064 +4067 +4060 +4061 +4062 +4069 +4070 +4063 +4064 +4077 +4065 +4074 +4076 +4078 +4091 +4100 +4104 +4105 +4106 +4107 +4115 +4110 +4112 +4113 +4114 +4115 +4092 +4093 +4107 +4109 +4108 +4112 +4143 +4144 +4145 +4146 +4145 +4144 +4126 +4130 +4134 +4149 +4151 +4161 +4162 +4160 +4146 +4170 +4188 +4196 +4194 +4193 +4196 +4197 +4198 +4200 +4205 +4218 +4228 +4216 +4224 +4226 +4241 +4245 +4247 +4251 +4245 +4244 +4266 +4259 +4262 +4269 +4270 +4275 +4281 +4298 +4305 +4309 +4311 +4325 +4328 +4346 +4347 +4357 +4360 +4359 +4357 +4391 +4396 +4391 +4397 +4395 +4405 +4410 +4412 +4433 +4420 +4421 +4422 +4423 +4431 +4437 +4447 +4451 +4458 +4457 +4458 +4456 +4455 +4458 +4460 +4431 +4432 +4431 +4441 +4444 +4436 +4408 +4406 +4414 +4415 +4413 +4422 +4449 +4430 +4428 +4397 +4395 +4396 +4398 +4396 +4399 +4406 +4413 +4422 +4421 +4429 +4431 +4430 +4462 +4460 +4480 +4482 +4486 +4484 +4483 +4497 +4493 +4496 +4506 +4504 +4497 +4498 +4503 +4513 +4525 +4533 +4547 +4560 +4561 +4563 +4562 +4572 +4571 +4575 +4557 +4561 +4562 +4550 +4552 +4543 +4537 +4534 +4542 +4561 +4563 +4562 +4583 +4582 +4591 +4592 +4597 +4601 +4599 +4600 +4610 +4601 +4612 +4630 +4616 +4619 +4623 +4624 +4636 +4638 +4645 +4651 +4655 +4660 +4659 +4658 +4657 +4658 +4661 +4670 +4665 +4656 +4664 +4666 +4667 +4669 +4696 +4701 +4712 +4711 +4719 +4679 +4680 +4686 +4684 +4685 +4689 +4682 +4686 +4688 +4687 +4688 +4687 +4693 +4672 +4670 +4667 +4673 +4643 +4644 +4653 +4668 +4669 +4672 +4685 +4663 +4665 +4672 +4696 +4698 +4701 +4699 +4687 +4690 +4687 +4684 +4685 +4687 +4689 +4685 +4692 +4690 +4696 +4702 +4703 +4704 +4717 +4718 +4719 +4711 +4717 +4719 +4726 +4722 +4736 +4735 +4739 +4748 +4741 +4738 +4736 +4737 +4736 +4740 +4748 +4749 +4757 +4760 +4768 +4754 +4756 +4772 +4773 +4775 +4770 +4766 +4769 +4762 +4771 +4773 +4775 +4776 +4778 +4782 +4770 +4763 +4765 +4764 +4765 +4764 +4777 +4780 +4786 +4797 +4803 +4812 +4811 +4818 +4823 +4820 +4821 +4831 +4834 +4862 +4865 +4856 +4857 +4863 +4860 +4861 +4858 +4846 +4848 +4852 +4853 +4854 +4856 +4832 +4833 +4832 +4830 +4826 +4833 +4851 +4852 +4855 +4856 +4857 +4852 +4854 +4860 +4863 +4887 +4878 +4879 +4880 +4893 +4888 +4891 +4892 +4896 +4897 +4900 +4905 +4903 +4909 +4927 +4942 +4946 +4952 +4970 +4971 +4987 +4990 +4991 +4990 +4989 +4988 +4989 +4995 +4996 +5004 +5003 +5005 +5009 +4997 +4981 +4977 +4979 +4982 +4984 +4994 +5005 +5009 +5008 +5036 +5034 +5033 +5030 +5032 +5034 +5030 +5031 +5034 +5070 +5072 +5071 +5073 +5077 +5078 +5070 +5084 +5085 +5091 +5071 +5080 +5075 +5070 +5067 +5072 +5075 +5082 +5085 +5091 +5104 +5120 +5123 +5122 +5105 +5120 +5128 +5116 +5118 +5122 +5120 +5140 +5142 +5145 +5148 +5152 +5153 +5154 +5157 +5172 +5179 +5177 +5185 +5191 +5200 +5201 +5207 +5205 +5206 +5198 +5205 +5186 +5188 +5197 +5194 +5203 +5204 +5205 +5208 +5214 +5220 +5219 +5224 +5227 +5241 +5233 +5253 +5283 +5287 +5291 +5289 +5296 +5297 +5294 +5288 +5289 +5290 +5278 +5290 +5288 +5294 +5295 +5294 +5292 +5289 +5299 +5283 +5285 +5290 +5289 +5291 +5302 +5304 +5305 +5315 +5316 +5323 +5337 +5341 +5345 +5346 +5358 +5361 +5367 +5348 +5354 +5344 +5339 +5342 +5341 +5354 +5356 +5355 +5354 +5355 +5356 +5342 +5348 +5350 +5351 +5355 +5378 +5380 +5404 +5405 +5407 +5417 +5419 +5411 +5412 +5413 +5416 +5420 +5391 +5377 +5386 +5387 +5390 +5383 +5385 +5384 +5390 +5389 +5390 +5409 +5414 +5424 +5427 +5428 +5430 +5443 +5435 +5430 +5427 +5428 +5422 +5452 +5460 +5464 +5465 +5472 +5473 +5481 +5480 +5481 +5482 +5483 +5493 +5495 +5492 +5501 +5517 +5519 +5527 +5532 +5529 +5532 +5542 +5532 +5550 +5551 +5560 +5543 +5549 +5555 +5554 +5555 +5552 +5562 +5563 +5564 +5566 +5568 +5571 +5549 +5556 +5557 +5563 +5564 +5567 +5563 +5570 +5559 +5580 +5585 +5568 +5569 +5562 +5578 +5579 +5565 +5567 +5583 +5584 +5592 +5590 +5593 +5595 +5594 +5597 +5582 +5588 +5594 +5596 +5598 +5597 +5595 +5605 +5593 +5590 +5599 +5603 +5597 +5632 +5621 +5624 +5628 +5634 +5662 +5663 +5666 +5674 +5678 +5677 +5678 +5679 +5680 +5681 +5687 +5690 +5685 +5684 +5683 +5689 +5690 +5691 +5689 +5694 +5698 +5701 +5698 +5733 +5757 +5767 +5794 +5812 +5804 +5802 +5810 +5826 +5856 +5855 +5860 +5861 +5846 +5865 +5885 +5874 +5883 +5888 +5892 +5894 +5877 +5840 +5841 +5814 +5815 +5818 +5821 +5822 +5819 +5818 +5842 +5849 +5850 +5851 +5854 +5856 +5854 +5851 +5864 +5866 +5867 +5871 +5874 +5879 +5888 +5886 +5890 +5894 +5889 +5875 +5863 +5847 +5857 +5853 +5858 +5859 +5862 +5867 +5862 +5866 +5874 +5875 +5894 +5897 +5877 +5886 +5887 +5891 +5881 +5886 +5885 +5886 +5887 +5888 +5892 +5891 +5903 +5902 +5901 +5902 +5903 +5908 +5905 +5912 +5914 +5920 +5927 +5916 +5917 +5918 +5921 +5931 +5939 +5942 +5943 +5949 +5962 +5990 +5985 +5982 +5980 +5979 +5990 +5995 +6012 +6029 +6038 +6050 +6051 +6057 +6052 +6061 +6060 +6050 +6058 +6059 +6060 +6064 +6065 +6092 +6091 +6090 +6089 +6085 +6101 +6107 +6110 +6109 +6120 +6117 +6110 diff --git a/2021/misc/day.cpp.template b/2021/misc/day.cpp.template new file mode 100644 index 0000000..c2f20b4 --- /dev/null +++ b/2021/misc/day.cpp.template @@ -0,0 +1,23 @@ +/***************************** + * + * Copyright (c) 2020 Gnarwhal + * + *****************************/ + +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +auto current_day() -> void { + { + auto line = std::string(); + auto file = std::ifstream("inputs/current_day.input"); + while (getline(file, line)) { + + } + } +} diff --git a/2021/misc/main.cpp b/2021/misc/main.cpp new file mode 100644 index 0000000..c4752db --- /dev/null +++ b/2021/misc/main.cpp @@ -0,0 +1,36 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include "types.hpp" + +extern auto current_day() -> void; + +auto main(i32 argc, char * argv[]) -> i32 { + current_day(); + + return 0; +} + diff --git a/2021/misc/main_test.cpp b/2021/misc/main_test.cpp new file mode 100644 index 0000000..0d8954d --- /dev/null +++ b/2021/misc/main_test.cpp @@ -0,0 +1,66 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include + +#include "types.hpp" + +extern auto current_day() -> void; + +auto main(i32 argc, char * argv[]) -> i32 { + auto TEST_CYCLES = 1; + if (argc >= 2) { + TEST_CYCLES = std::stoi(argv[1]); + } + + std::cout << "Starting test with " << TEST_CYCLES << " iterations..." << std::endl; + auto begin1 = std::chrono::high_resolution_clock::now(); + + for (auto i = usize(0); i < TEST_CYCLES; ++i) { + current_day(); + } + + auto end1 = std::chrono::high_resolution_clock::now(); + + if (argc >= 3) { + if (argv[2] == std::string("millis")) { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " milliseconds"<< std::endl; + } else if (argv[2] == std::string("nanos")) { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " nanoseconds"<< std::endl; + } else if (argv[2] == std::string("micros")) { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " microsenconds"<< std::endl; + } else { + std::cout << "Unkown time scale '" << argv[2] << "'" << std::endl; + } + } else { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " microseconds"<< std::endl; + } + + return 0; +} + diff --git a/2021/misc/print.hpp b/2021/misc/print.hpp new file mode 100644 index 0000000..5960cd8 --- /dev/null +++ b/2021/misc/print.hpp @@ -0,0 +1,31 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#ifndef TEST_BUILD +#define print(x) std::cout << (x) << std::endl +#else +#define print(x) +#endif diff --git a/2021/misc/types.cpp b/2021/misc/types.cpp new file mode 100644 index 0000000..cc4d3da --- /dev/null +++ b/2021/misc/types.cpp @@ -0,0 +1,47 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include "types.hpp" + +constexpr auto operator "" _u8 (unsigned long long int num) noexcept -> u8 { return u8(num); } +constexpr auto operator "" _i8 (unsigned long long int num) noexcept -> i8 { return u8(num); } +constexpr auto operator "" _u16 (unsigned long long int num) noexcept -> u16 { return u16(num); } +constexpr auto operator "" _i16 (unsigned long long int num) noexcept -> i16 { return i16(num); } +constexpr auto operator "" _u32 (unsigned long long int num) noexcept -> u32 { return u32(num); } +constexpr auto operator "" _i32 (unsigned long long int num) noexcept -> i32 { return i32(num); } +constexpr auto operator "" _u64 (unsigned long long int num) noexcept -> u64 { return u64(num); } +constexpr auto operator "" _i64 (unsigned long long int num) noexcept -> i64 { return i64(num); } +constexpr auto operator "" _usize(unsigned long long int num) noexcept -> usize { return usize(num); } + +constexpr auto operator "" _c8 (char c) noexcept -> c8 { return c8(c); } +constexpr auto operator "" _c16(char c) noexcept -> c16 { return c16(c); } +constexpr auto operator "" _c32(char c) noexcept -> c32 { return c32(c); } +constexpr auto operator "" _c8 (unsigned long long int c) noexcept -> c8 { return c8(c); } +constexpr auto operator "" _c16(unsigned long long int c) noexcept -> c16 { return c16(c); } +constexpr auto operator "" _c32(unsigned long long int c) noexcept -> c32 { return c32(c); } + +constexpr auto operator "" _f32(long double num) noexcept -> f32 { return (f32) num; } +constexpr auto operator "" _f64(long double num) noexcept -> f64 { return (f64) num; } diff --git a/2021/misc/types.hpp b/2021/misc/types.hpp new file mode 100644 index 0000000..bc94dab --- /dev/null +++ b/2021/misc/types.hpp @@ -0,0 +1,70 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#ifndef GNARWHAL_REDWOOD_TYPES +#define GNARWHAL_REDWOOD_TYPES + +#include +#include + +using u8 = std::uint8_t; +using i8 = std::int8_t; +using u16 = std::uint16_t; +using i16 = std::int16_t; +using u32 = std::uint32_t; +using i32 = std::int32_t; +using u64 = std::uint64_t; +using i64 = std::int64_t; +using usize = std::size_t; + +constexpr auto operator "" _u8 (unsigned long long int num) noexcept -> u8; +constexpr auto operator "" _i8 (unsigned long long int num) noexcept -> i8; +constexpr auto operator "" _u16 (unsigned long long int num) noexcept -> u16; +constexpr auto operator "" _i16 (unsigned long long int num) noexcept -> i16; +constexpr auto operator "" _u32 (unsigned long long int num) noexcept -> u32; +constexpr auto operator "" _i32 (unsigned long long int num) noexcept -> i32; +constexpr auto operator "" _u64 (unsigned long long int num) noexcept -> u64; +constexpr auto operator "" _i64 (unsigned long long int num) noexcept -> i64; +constexpr auto operator "" _usize(unsigned long long int num) noexcept -> usize; + +using c8 = u8; +using c16 = u16; +using c32 = u32; + +constexpr auto operator "" _c8 (char c) noexcept -> c8; +constexpr auto operator "" _c16(char c) noexcept -> c16; +constexpr auto operator "" _c32(char c) noexcept -> c32; +constexpr auto operator "" _c8 (unsigned long long int c) noexcept -> c8; +constexpr auto operator "" _c16(unsigned long long int c) noexcept -> c16; +constexpr auto operator "" _c32(unsigned long long int c) noexcept -> c32; + +using f32 = float; +using f64 = double; + +constexpr auto operator "" _f32(long double num) noexcept -> f32; +constexpr auto operator "" _f64(long double num) noexcept -> f64; + +#endif // GNARWHAL_REDWOOD_TYPES From c69deb2ae752cfac9fc8107875851d227ed353f1 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Sun, 6 Oct 2024 21:15:16 +0000 Subject: [PATCH 52/52] Piss poor attempt at AoC 2021 and I'm 3 years late publishing it :/ --- 2021/Makefile | 17 + 2021/days/day1.cpp | 54 + 2021/inputs/day1.input | 2000 ++++++++++++++++++++++++++++++++++++ 2021/misc/day.cpp.template | 23 + 2021/misc/main.cpp | 36 + 2021/misc/main_test.cpp | 66 ++ 2021/misc/print.hpp | 31 + 2021/misc/types.cpp | 47 + 2021/misc/types.hpp | 70 ++ 9 files changed, 2344 insertions(+) create mode 100644 2021/Makefile create mode 100644 2021/days/day1.cpp create mode 100644 2021/inputs/day1.input create mode 100644 2021/misc/day.cpp.template create mode 100644 2021/misc/main.cpp create mode 100644 2021/misc/main_test.cpp create mode 100644 2021/misc/print.hpp create mode 100644 2021/misc/types.cpp create mode 100644 2021/misc/types.hpp diff --git a/2021/Makefile b/2021/Makefile new file mode 100644 index 0000000..2978a55 --- /dev/null +++ b/2021/Makefile @@ -0,0 +1,17 @@ +day%.out: out/types.o misc/main.cpp days/day%.cpp + g++ -O3 -std=c++2a $(flags) -Dcurrent_day=$(@:.out=) days/$(@:out=cpp) misc/main.cpp out/types.o -o $@ + +day%_test.out: out/types.o misc/main_test.cpp days/day%.cpp + g++ -O3 -std=c++2a $(flags) -DTEST_BUILD -Dcurrent_day=$(@:_test.out=) days/$(@:_test.out=.cpp) misc/main_test.cpp out/types.o -o $@ + +days/day%.cpp: + cp 'misc/day.cpp.template' $@ + sed -i -e "s/current_day/$(shell basename $@ | cut -f 1 -d '.')/g" $@ + +out/types.o: misc/types.hpp misc/types.cpp + mkdir -p out/ + g++ -std=c++2a $(flags) -c misc/types.cpp -o $@ + +.PHONY: clean +clean: + rm -f out/* day*.out day*.output diff --git a/2021/days/day1.cpp b/2021/days/day1.cpp new file mode 100644 index 0000000..4f8c65c --- /dev/null +++ b/2021/days/day1.cpp @@ -0,0 +1,54 @@ +/***************************** + * + * Copyright (c) 2021 Gnarwhal + * + *****************************/ + +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +auto current_day() -> void { + { + auto line = std::string(); + auto file = std::ifstream("inputs/day1.input"); + getline(file, line); + auto value = stoi(line); + auto increases = 0; + while (getline(file, line)) { + auto new_value = stoi(line); + increases += new_value > value; + value = new_value; + } + + std::cout << increases << std::endl; + } + + { + auto line = std::string(); + auto file = std::ifstream("inputs/day1.input"); + getline(file, line); + auto index = 2; + auto values = std::vector{ 0, 0 }; + while (getline(file, line)) { + auto new_value = stoi(line); + values.push_back(0); + values[index - 2] += new_value; + values[index - 1] += new_value; + values[index ] += new_value; + ++index; + } + + auto increases = 0; + for (auto i = 3; i < values.size(); ++i) { + increases += values[i - 1] < values[i]; + } + + std::cout << increases << std::endl; + } +} + diff --git a/2021/inputs/day1.input b/2021/inputs/day1.input new file mode 100644 index 0000000..bc99d0b --- /dev/null +++ b/2021/inputs/day1.input @@ -0,0 +1,2000 @@ +199 +227 +229 +230 +233 +228 +231 +226 +237 +259 +262 +265 +266 +265 +269 +276 +278 +279 +281 +287 +305 +316 +314 +320 +313 +314 +315 +329 +346 +357 +370 +369 +360 +384 +383 +401 +402 +403 +404 +403 +406 +408 +406 +401 +393 +395 +416 +418 +408 +411 +412 +416 +417 +404 +421 +436 +437 +436 +420 +388 +405 +403 +371 +376 +378 +374 +378 +377 +403 +411 +444 +424 +417 +416 +419 +436 +415 +413 +429 +446 +462 +463 +464 +467 +466 +475 +483 +478 +487 +488 +469 +470 +472 +473 +460 +463 +465 +477 +487 +508 +506 +509 +512 +513 +519 +525 +531 +498 +506 +504 +506 +507 +509 +510 +512 +537 +553 +536 +533 +524 +525 +526 +527 +530 +531 +533 +537 +538 +537 +539 +544 +552 +550 +576 +560 +556 +561 +552 +560 +572 +573 +572 +571 +573 +578 +581 +582 +578 +541 +546 +537 +545 +556 +565 +566 +571 +561 +573 +579 +578 +581 +600 +603 +604 +597 +598 +599 +598 +599 +580 +585 +586 +596 +597 +602 +593 +598 +599 +604 +608 +609 +616 +615 +613 +622 +625 +620 +632 +636 +628 +633 +640 +621 +620 +638 +646 +647 +648 +647 +654 +655 +663 +652 +664 +668 +669 +668 +663 +667 +659 +658 +666 +670 +685 +703 +706 +705 +706 +727 +730 +729 +735 +743 +749 +750 +751 +756 +774 +776 +767 +778 +777 +790 +791 +794 +798 +801 +804 +812 +818 +819 +818 +821 +825 +818 +829 +832 +835 +849 +848 +863 +859 +863 +871 +870 +869 +873 +875 +878 +874 +896 +903 +890 +891 +905 +912 +913 +911 +917 +941 +943 +944 +940 +943 +945 +947 +948 +953 +930 +932 +933 +948 +936 +937 +941 +947 +952 +957 +951 +953 +954 +958 +979 +982 +971 +974 +979 +984 +988 +989 +986 +987 +992 +998 +1013 +1024 +1022 +1023 +1014 +1019 +1042 +1048 +1047 +1060 +1056 +1067 +1054 +1053 +1061 +1063 +1068 +1074 +1104 +1105 +1107 +1119 +1126 +1127 +1129 +1143 +1145 +1146 +1151 +1159 +1183 +1185 +1192 +1183 +1185 +1182 +1180 +1198 +1215 +1221 +1224 +1227 +1230 +1262 +1289 +1291 +1294 +1297 +1300 +1303 +1321 +1323 +1329 +1331 +1341 +1362 +1369 +1370 +1388 +1389 +1393 +1407 +1386 +1380 +1381 +1378 +1398 +1402 +1399 +1422 +1433 +1449 +1451 +1449 +1462 +1454 +1455 +1452 +1471 +1472 +1487 +1477 +1459 +1463 +1461 +1463 +1473 +1489 +1482 +1516 +1527 +1521 +1522 +1527 +1529 +1531 +1538 +1550 +1553 +1548 +1549 +1545 +1548 +1543 +1546 +1549 +1572 +1576 +1581 +1575 +1584 +1602 +1604 +1605 +1606 +1611 +1610 +1623 +1618 +1614 +1622 +1613 +1608 +1611 +1638 +1632 +1643 +1649 +1652 +1655 +1652 +1653 +1654 +1658 +1659 +1661 +1667 +1695 +1710 +1719 +1726 +1727 +1725 +1726 +1736 +1741 +1763 +1752 +1769 +1770 +1767 +1768 +1769 +1771 +1799 +1798 +1810 +1813 +1816 +1826 +1837 +1842 +1841 +1848 +1853 +1823 +1836 +1835 +1837 +1836 +1839 +1838 +1840 +1841 +1839 +1843 +1844 +1862 +1873 +1877 +1880 +1882 +1881 +1895 +1891 +1896 +1899 +1893 +1894 +1892 +1894 +1895 +1921 +1920 +1922 +1928 +1925 +1933 +1943 +1942 +1936 +1941 +1919 +1912 +1914 +1922 +1918 +1934 +1932 +1946 +1949 +1955 +1964 +1974 +1977 +1978 +1983 +1984 +1986 +1990 +2005 +2022 +2026 +2032 +2031 +2029 +2031 +2035 +2041 +2042 +2043 +2053 +2054 +2058 +2062 +2063 +2055 +2049 +2021 +2022 +2054 +2052 +2084 +2076 +2079 +2090 +2088 +2093 +2095 +2093 +2091 +2089 +2095 +2096 +2102 +2127 +2129 +2132 +2117 +2125 +2131 +2132 +2126 +2134 +2140 +2137 +2138 +2136 +2137 +2141 +2153 +2152 +2170 +2177 +2147 +2159 +2161 +2160 +2173 +2176 +2194 +2205 +2206 +2213 +2231 +2232 +2242 +2243 +2217 +2224 +2225 +2230 +2226 +2214 +2212 +2227 +2230 +2237 +2238 +2241 +2264 +2283 +2288 +2308 +2309 +2311 +2312 +2314 +2316 +2317 +2318 +2321 +2326 +2324 +2325 +2321 +2324 +2322 +2325 +2327 +2335 +2369 +2370 +2374 +2375 +2344 +2347 +2348 +2341 +2346 +2355 +2356 +2371 +2368 +2370 +2375 +2378 +2379 +2370 +2363 +2365 +2366 +2363 +2364 +2372 +2374 +2392 +2399 +2397 +2384 +2400 +2401 +2402 +2401 +2400 +2402 +2412 +2422 +2423 +2426 +2424 +2425 +2421 +2422 +2440 +2441 +2451 +2442 +2443 +2444 +2446 +2451 +2452 +2450 +2458 +2457 +2490 +2496 +2506 +2507 +2508 +2511 +2531 +2536 +2537 +2539 +2529 +2530 +2561 +2562 +2592 +2595 +2584 +2601 +2603 +2589 +2586 +2588 +2586 +2596 +2613 +2616 +2618 +2621 +2629 +2637 +2638 +2619 +2621 +2619 +2631 +2621 +2619 +2624 +2628 +2634 +2636 +2637 +2626 +2632 +2623 +2630 +2629 +2630 +2633 +2620 +2629 +2635 +2614 +2617 +2612 +2613 +2609 +2601 +2604 +2611 +2602 +2607 +2611 +2639 +2646 +2647 +2618 +2613 +2614 +2635 +2642 +2649 +2653 +2652 +2628 +2629 +2631 +2636 +2639 +2649 +2665 +2667 +2666 +2665 +2668 +2672 +2673 +2675 +2693 +2694 +2696 +2701 +2702 +2703 +2700 +2716 +2718 +2719 +2718 +2719 +2722 +2723 +2715 +2726 +2737 +2757 +2758 +2759 +2762 +2760 +2765 +2759 +2763 +2764 +2774 +2785 +2786 +2802 +2803 +2802 +2824 +2833 +2834 +2830 +2832 +2842 +2828 +2829 +2836 +2838 +2813 +2811 +2798 +2799 +2796 +2805 +2808 +2807 +2811 +2812 +2811 +2812 +2793 +2787 +2802 +2805 +2804 +2822 +2825 +2837 +2835 +2842 +2838 +2849 +2840 +2841 +2853 +2854 +2863 +2877 +2886 +2864 +2866 +2846 +2860 +2840 +2842 +2844 +2866 +2867 +2870 +2856 +2860 +2861 +2860 +2872 +2877 +2881 +2883 +2881 +2883 +2880 +2881 +2882 +2880 +2902 +2903 +2904 +2937 +2939 +2938 +2945 +2954 +2950 +2966 +2967 +2976 +2980 +2982 +2976 +2986 +2997 +2996 +2994 +3004 +3007 +3008 +3016 +3014 +3054 +3078 +3095 +3114 +3115 +3120 +3107 +3109 +3124 +3140 +3144 +3150 +3163 +3165 +3164 +3158 +3172 +3175 +3174 +3184 +3188 +3198 +3193 +3224 +3226 +3227 +3252 +3273 +3280 +3289 +3291 +3290 +3291 +3279 +3281 +3282 +3281 +3298 +3302 +3289 +3304 +3295 +3312 +3314 +3327 +3328 +3337 +3348 +3349 +3340 +3348 +3351 +3350 +3351 +3350 +3345 +3339 +3343 +3344 +3329 +3354 +3356 +3358 +3363 +3365 +3373 +3376 +3383 +3384 +3388 +3389 +3390 +3397 +3398 +3401 +3409 +3411 +3412 +3411 +3418 +3428 +3430 +3432 +3418 +3410 +3418 +3424 +3425 +3426 +3430 +3439 +3441 +3422 +3423 +3425 +3426 +3428 +3429 +3436 +3448 +3447 +3443 +3445 +3468 +3482 +3483 +3499 +3506 +3513 +3518 +3523 +3524 +3525 +3529 +3532 +3529 +3565 +3577 +3576 +3577 +3576 +3539 +3557 +3554 +3563 +3562 +3564 +3565 +3586 +3583 +3590 +3589 +3580 +3581 +3574 +3599 +3597 +3609 +3610 +3611 +3614 +3613 +3611 +3612 +3611 +3598 +3596 +3597 +3585 +3568 +3569 +3550 +3561 +3563 +3551 +3552 +3555 +3553 +3554 +3553 +3552 +3555 +3557 +3560 +3585 +3591 +3604 +3609 +3640 +3641 +3645 +3644 +3643 +3646 +3644 +3664 +3653 +3660 +3667 +3664 +3665 +3668 +3670 +3649 +3640 +3639 +3647 +3654 +3650 +3648 +3654 +3651 +3652 +3653 +3654 +3655 +3671 +3660 +3671 +3675 +3679 +3680 +3681 +3686 +3690 +3691 +3693 +3695 +3698 +3697 +3699 +3708 +3712 +3714 +3712 +3711 +3716 +3731 +3732 +3736 +3753 +3755 +3756 +3767 +3747 +3746 +3733 +3711 +3722 +3718 +3721 +3722 +3723 +3724 +3727 +3731 +3732 +3741 +3743 +3750 +3751 +3738 +3741 +3739 +3740 +3756 +3755 +3751 +3750 +3755 +3757 +3773 +3778 +3781 +3782 +3768 +3772 +3766 +3770 +3778 +3792 +3798 +3801 +3803 +3801 +3812 +3833 +3873 +3868 +3865 +3866 +3906 +3910 +3897 +3907 +3910 +3898 +3914 +3917 +3908 +3912 +3920 +3934 +3930 +3934 +3935 +3937 +3942 +3943 +3948 +3964 +3978 +3985 +3986 +3993 +3995 +4014 +4021 +4024 +4025 +4024 +4027 +4028 +4043 +4047 +4049 +4036 +4039 +4038 +4037 +4045 +4040 +4041 +4043 +4035 +4046 +4063 +4054 +4055 +4064 +4067 +4060 +4061 +4062 +4069 +4070 +4063 +4064 +4077 +4065 +4074 +4076 +4078 +4091 +4100 +4104 +4105 +4106 +4107 +4115 +4110 +4112 +4113 +4114 +4115 +4092 +4093 +4107 +4109 +4108 +4112 +4143 +4144 +4145 +4146 +4145 +4144 +4126 +4130 +4134 +4149 +4151 +4161 +4162 +4160 +4146 +4170 +4188 +4196 +4194 +4193 +4196 +4197 +4198 +4200 +4205 +4218 +4228 +4216 +4224 +4226 +4241 +4245 +4247 +4251 +4245 +4244 +4266 +4259 +4262 +4269 +4270 +4275 +4281 +4298 +4305 +4309 +4311 +4325 +4328 +4346 +4347 +4357 +4360 +4359 +4357 +4391 +4396 +4391 +4397 +4395 +4405 +4410 +4412 +4433 +4420 +4421 +4422 +4423 +4431 +4437 +4447 +4451 +4458 +4457 +4458 +4456 +4455 +4458 +4460 +4431 +4432 +4431 +4441 +4444 +4436 +4408 +4406 +4414 +4415 +4413 +4422 +4449 +4430 +4428 +4397 +4395 +4396 +4398 +4396 +4399 +4406 +4413 +4422 +4421 +4429 +4431 +4430 +4462 +4460 +4480 +4482 +4486 +4484 +4483 +4497 +4493 +4496 +4506 +4504 +4497 +4498 +4503 +4513 +4525 +4533 +4547 +4560 +4561 +4563 +4562 +4572 +4571 +4575 +4557 +4561 +4562 +4550 +4552 +4543 +4537 +4534 +4542 +4561 +4563 +4562 +4583 +4582 +4591 +4592 +4597 +4601 +4599 +4600 +4610 +4601 +4612 +4630 +4616 +4619 +4623 +4624 +4636 +4638 +4645 +4651 +4655 +4660 +4659 +4658 +4657 +4658 +4661 +4670 +4665 +4656 +4664 +4666 +4667 +4669 +4696 +4701 +4712 +4711 +4719 +4679 +4680 +4686 +4684 +4685 +4689 +4682 +4686 +4688 +4687 +4688 +4687 +4693 +4672 +4670 +4667 +4673 +4643 +4644 +4653 +4668 +4669 +4672 +4685 +4663 +4665 +4672 +4696 +4698 +4701 +4699 +4687 +4690 +4687 +4684 +4685 +4687 +4689 +4685 +4692 +4690 +4696 +4702 +4703 +4704 +4717 +4718 +4719 +4711 +4717 +4719 +4726 +4722 +4736 +4735 +4739 +4748 +4741 +4738 +4736 +4737 +4736 +4740 +4748 +4749 +4757 +4760 +4768 +4754 +4756 +4772 +4773 +4775 +4770 +4766 +4769 +4762 +4771 +4773 +4775 +4776 +4778 +4782 +4770 +4763 +4765 +4764 +4765 +4764 +4777 +4780 +4786 +4797 +4803 +4812 +4811 +4818 +4823 +4820 +4821 +4831 +4834 +4862 +4865 +4856 +4857 +4863 +4860 +4861 +4858 +4846 +4848 +4852 +4853 +4854 +4856 +4832 +4833 +4832 +4830 +4826 +4833 +4851 +4852 +4855 +4856 +4857 +4852 +4854 +4860 +4863 +4887 +4878 +4879 +4880 +4893 +4888 +4891 +4892 +4896 +4897 +4900 +4905 +4903 +4909 +4927 +4942 +4946 +4952 +4970 +4971 +4987 +4990 +4991 +4990 +4989 +4988 +4989 +4995 +4996 +5004 +5003 +5005 +5009 +4997 +4981 +4977 +4979 +4982 +4984 +4994 +5005 +5009 +5008 +5036 +5034 +5033 +5030 +5032 +5034 +5030 +5031 +5034 +5070 +5072 +5071 +5073 +5077 +5078 +5070 +5084 +5085 +5091 +5071 +5080 +5075 +5070 +5067 +5072 +5075 +5082 +5085 +5091 +5104 +5120 +5123 +5122 +5105 +5120 +5128 +5116 +5118 +5122 +5120 +5140 +5142 +5145 +5148 +5152 +5153 +5154 +5157 +5172 +5179 +5177 +5185 +5191 +5200 +5201 +5207 +5205 +5206 +5198 +5205 +5186 +5188 +5197 +5194 +5203 +5204 +5205 +5208 +5214 +5220 +5219 +5224 +5227 +5241 +5233 +5253 +5283 +5287 +5291 +5289 +5296 +5297 +5294 +5288 +5289 +5290 +5278 +5290 +5288 +5294 +5295 +5294 +5292 +5289 +5299 +5283 +5285 +5290 +5289 +5291 +5302 +5304 +5305 +5315 +5316 +5323 +5337 +5341 +5345 +5346 +5358 +5361 +5367 +5348 +5354 +5344 +5339 +5342 +5341 +5354 +5356 +5355 +5354 +5355 +5356 +5342 +5348 +5350 +5351 +5355 +5378 +5380 +5404 +5405 +5407 +5417 +5419 +5411 +5412 +5413 +5416 +5420 +5391 +5377 +5386 +5387 +5390 +5383 +5385 +5384 +5390 +5389 +5390 +5409 +5414 +5424 +5427 +5428 +5430 +5443 +5435 +5430 +5427 +5428 +5422 +5452 +5460 +5464 +5465 +5472 +5473 +5481 +5480 +5481 +5482 +5483 +5493 +5495 +5492 +5501 +5517 +5519 +5527 +5532 +5529 +5532 +5542 +5532 +5550 +5551 +5560 +5543 +5549 +5555 +5554 +5555 +5552 +5562 +5563 +5564 +5566 +5568 +5571 +5549 +5556 +5557 +5563 +5564 +5567 +5563 +5570 +5559 +5580 +5585 +5568 +5569 +5562 +5578 +5579 +5565 +5567 +5583 +5584 +5592 +5590 +5593 +5595 +5594 +5597 +5582 +5588 +5594 +5596 +5598 +5597 +5595 +5605 +5593 +5590 +5599 +5603 +5597 +5632 +5621 +5624 +5628 +5634 +5662 +5663 +5666 +5674 +5678 +5677 +5678 +5679 +5680 +5681 +5687 +5690 +5685 +5684 +5683 +5689 +5690 +5691 +5689 +5694 +5698 +5701 +5698 +5733 +5757 +5767 +5794 +5812 +5804 +5802 +5810 +5826 +5856 +5855 +5860 +5861 +5846 +5865 +5885 +5874 +5883 +5888 +5892 +5894 +5877 +5840 +5841 +5814 +5815 +5818 +5821 +5822 +5819 +5818 +5842 +5849 +5850 +5851 +5854 +5856 +5854 +5851 +5864 +5866 +5867 +5871 +5874 +5879 +5888 +5886 +5890 +5894 +5889 +5875 +5863 +5847 +5857 +5853 +5858 +5859 +5862 +5867 +5862 +5866 +5874 +5875 +5894 +5897 +5877 +5886 +5887 +5891 +5881 +5886 +5885 +5886 +5887 +5888 +5892 +5891 +5903 +5902 +5901 +5902 +5903 +5908 +5905 +5912 +5914 +5920 +5927 +5916 +5917 +5918 +5921 +5931 +5939 +5942 +5943 +5949 +5962 +5990 +5985 +5982 +5980 +5979 +5990 +5995 +6012 +6029 +6038 +6050 +6051 +6057 +6052 +6061 +6060 +6050 +6058 +6059 +6060 +6064 +6065 +6092 +6091 +6090 +6089 +6085 +6101 +6107 +6110 +6109 +6120 +6117 +6110 diff --git a/2021/misc/day.cpp.template b/2021/misc/day.cpp.template new file mode 100644 index 0000000..c2f20b4 --- /dev/null +++ b/2021/misc/day.cpp.template @@ -0,0 +1,23 @@ +/***************************** + * + * Copyright (c) 2020 Gnarwhal + * + *****************************/ + +#include +#include +#include +#include + +#include "../misc/types.hpp" +#include "../misc/print.hpp" + +auto current_day() -> void { + { + auto line = std::string(); + auto file = std::ifstream("inputs/current_day.input"); + while (getline(file, line)) { + + } + } +} diff --git a/2021/misc/main.cpp b/2021/misc/main.cpp new file mode 100644 index 0000000..c4752db --- /dev/null +++ b/2021/misc/main.cpp @@ -0,0 +1,36 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include "types.hpp" + +extern auto current_day() -> void; + +auto main(i32 argc, char * argv[]) -> i32 { + current_day(); + + return 0; +} + diff --git a/2021/misc/main_test.cpp b/2021/misc/main_test.cpp new file mode 100644 index 0000000..0d8954d --- /dev/null +++ b/2021/misc/main_test.cpp @@ -0,0 +1,66 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include +#include +#include + +#include "types.hpp" + +extern auto current_day() -> void; + +auto main(i32 argc, char * argv[]) -> i32 { + auto TEST_CYCLES = 1; + if (argc >= 2) { + TEST_CYCLES = std::stoi(argv[1]); + } + + std::cout << "Starting test with " << TEST_CYCLES << " iterations..." << std::endl; + auto begin1 = std::chrono::high_resolution_clock::now(); + + for (auto i = usize(0); i < TEST_CYCLES; ++i) { + current_day(); + } + + auto end1 = std::chrono::high_resolution_clock::now(); + + if (argc >= 3) { + if (argv[2] == std::string("millis")) { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " milliseconds"<< std::endl; + } else if (argv[2] == std::string("nanos")) { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " nanoseconds"<< std::endl; + } else if (argv[2] == std::string("micros")) { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " microsenconds"<< std::endl; + } else { + std::cout << "Unkown time scale '" << argv[2] << "'" << std::endl; + } + } else { + std::cout << "Tests completed in " << std::chrono::duration_cast(end1 - begin1).count() << " microseconds"<< std::endl; + } + + return 0; +} + diff --git a/2021/misc/print.hpp b/2021/misc/print.hpp new file mode 100644 index 0000000..5960cd8 --- /dev/null +++ b/2021/misc/print.hpp @@ -0,0 +1,31 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#ifndef TEST_BUILD +#define print(x) std::cout << (x) << std::endl +#else +#define print(x) +#endif diff --git a/2021/misc/types.cpp b/2021/misc/types.cpp new file mode 100644 index 0000000..cc4d3da --- /dev/null +++ b/2021/misc/types.cpp @@ -0,0 +1,47 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#include "types.hpp" + +constexpr auto operator "" _u8 (unsigned long long int num) noexcept -> u8 { return u8(num); } +constexpr auto operator "" _i8 (unsigned long long int num) noexcept -> i8 { return u8(num); } +constexpr auto operator "" _u16 (unsigned long long int num) noexcept -> u16 { return u16(num); } +constexpr auto operator "" _i16 (unsigned long long int num) noexcept -> i16 { return i16(num); } +constexpr auto operator "" _u32 (unsigned long long int num) noexcept -> u32 { return u32(num); } +constexpr auto operator "" _i32 (unsigned long long int num) noexcept -> i32 { return i32(num); } +constexpr auto operator "" _u64 (unsigned long long int num) noexcept -> u64 { return u64(num); } +constexpr auto operator "" _i64 (unsigned long long int num) noexcept -> i64 { return i64(num); } +constexpr auto operator "" _usize(unsigned long long int num) noexcept -> usize { return usize(num); } + +constexpr auto operator "" _c8 (char c) noexcept -> c8 { return c8(c); } +constexpr auto operator "" _c16(char c) noexcept -> c16 { return c16(c); } +constexpr auto operator "" _c32(char c) noexcept -> c32 { return c32(c); } +constexpr auto operator "" _c8 (unsigned long long int c) noexcept -> c8 { return c8(c); } +constexpr auto operator "" _c16(unsigned long long int c) noexcept -> c16 { return c16(c); } +constexpr auto operator "" _c32(unsigned long long int c) noexcept -> c32 { return c32(c); } + +constexpr auto operator "" _f32(long double num) noexcept -> f32 { return (f32) num; } +constexpr auto operator "" _f64(long double num) noexcept -> f64 { return (f64) num; } diff --git a/2021/misc/types.hpp b/2021/misc/types.hpp new file mode 100644 index 0000000..bc94dab --- /dev/null +++ b/2021/misc/types.hpp @@ -0,0 +1,70 @@ +/******************************************************************************* + * + * Copyright (c) 2020 Gnarwhal + * + * ----------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files(the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + *******************************************************************************/ + +#ifndef GNARWHAL_REDWOOD_TYPES +#define GNARWHAL_REDWOOD_TYPES + +#include +#include + +using u8 = std::uint8_t; +using i8 = std::int8_t; +using u16 = std::uint16_t; +using i16 = std::int16_t; +using u32 = std::uint32_t; +using i32 = std::int32_t; +using u64 = std::uint64_t; +using i64 = std::int64_t; +using usize = std::size_t; + +constexpr auto operator "" _u8 (unsigned long long int num) noexcept -> u8; +constexpr auto operator "" _i8 (unsigned long long int num) noexcept -> i8; +constexpr auto operator "" _u16 (unsigned long long int num) noexcept -> u16; +constexpr auto operator "" _i16 (unsigned long long int num) noexcept -> i16; +constexpr auto operator "" _u32 (unsigned long long int num) noexcept -> u32; +constexpr auto operator "" _i32 (unsigned long long int num) noexcept -> i32; +constexpr auto operator "" _u64 (unsigned long long int num) noexcept -> u64; +constexpr auto operator "" _i64 (unsigned long long int num) noexcept -> i64; +constexpr auto operator "" _usize(unsigned long long int num) noexcept -> usize; + +using c8 = u8; +using c16 = u16; +using c32 = u32; + +constexpr auto operator "" _c8 (char c) noexcept -> c8; +constexpr auto operator "" _c16(char c) noexcept -> c16; +constexpr auto operator "" _c32(char c) noexcept -> c32; +constexpr auto operator "" _c8 (unsigned long long int c) noexcept -> c8; +constexpr auto operator "" _c16(unsigned long long int c) noexcept -> c16; +constexpr auto operator "" _c32(unsigned long long int c) noexcept -> c32; + +using f32 = float; +using f64 = double; + +constexpr auto operator "" _f32(long double num) noexcept -> f32; +constexpr auto operator "" _f64(long double num) noexcept -> f64; + +#endif // GNARWHAL_REDWOOD_TYPES