Ejemplo n.º 1
0
def main() -> None:
    my_aocd.print_header(2015, 16)

    inputs = my_aocd.get_input(2015, 16, 500)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 2
0
def main() -> None:
    my_aocd.print_header(2021, 2)

    assert part_1(TEST) == 150
    assert part_2(TEST) == 900

    inputs = my_aocd.get_input(2021, 2, 1000)
    print(f"Part 1: {part_1(inputs)}")
    print(f"Part 2: {part_2(inputs)}")
Ejemplo n.º 3
0
def main() -> None:
    my_aocd.print_header(2020, 20)

    assert part_1(TEST) == 1951 * 3079 * 2971 * 1171
    assert part_2(TEST) == 0

    inputs = my_aocd.get_input(2020, 20, 1727)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
Ejemplo n.º 4
0
def main() -> None:
    puzzle = aocd.models.Puzzle(2021, 24)
    my_aocd.print_header(puzzle.year, puzzle.day)

    inputs = my_aocd.get_input(puzzle.year, puzzle.day, 252)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
    my_aocd.check_results(puzzle, result1, result2)
Ejemplo n.º 5
0
def main() -> None:
    my_aocd.print_header(2015, 10)

    assert _look_and_say_iterations(TEST, 5) == "312211"

    inputs = my_aocd.get_input(2015, 10, 1)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 6
0
def main() -> None:
    my_aocd.print_header(2016, 25)

    assert _solve(TEST) == 182

    inputs = my_aocd.get_input(2016, 25, 30)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 7
0
def main() -> None:
    my_aocd.print_header(2016, 4)

    assert part_1(TEST) == 1514

    inputs = my_aocd.get_input(2016, 4, 935)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 8
0
def main() -> None:
    my_aocd.print_header(2017, 8)

    assert part_1(TEST) == 1

    inputs = my_aocd.get_input(2017, 8, 1000)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 9
0
def main() -> None:
    my_aocd.print_header(2015, 13)

    assert part_1(TEST) == 330

    inputs = my_aocd.get_input(2015, 13, 56)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 10
0
def main() -> None:
    my_aocd.print_header(2020, 25)

    assert part_1(TEST) == 14897079

    inputs = my_aocd.get_input(2020, 25, 2)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 11
0
def main() -> None:
    my_aocd.print_header(2019, 8)

    assert _get_image(TEST, 2, 2) == "0110"

    inputs = my_aocd.get_input(2019, 8, 1)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 12
0
def main() -> None:
    my_aocd.print_header(2020, 23)

    assert part_1(TEST) == 67384529
    assert part_2(TEST) == 149245887792

    inputs = my_aocd.get_input(2020, 23, 1)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 13
0
def main() -> None:
    my_aocd.print_header(2016, 2)

    assert part_1(TEST) == "1985"
    assert part_2(TEST) == "5DB3"

    inputs = my_aocd.get_input(2016, 2, 5)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 14
0
def main() -> None:
    my_aocd.print_header(2020, 8)

    assert part_1(TEST) == 5
    assert part_2(TEST) == 8

    inputs = my_aocd.get_input(2020, 8, 608)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 15
0
def main() -> None:
    my_aocd.print_header(2015, 15)

    assert part_1(TEST) == 62842880
    assert part_2(TEST) == 57600000

    inputs = my_aocd.get_input(2015, 15, 4)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 16
0
def main() -> None:
    my_aocd.print_header(2016, 7)

    assert part_1(TEST1) == 2
    assert part_2(TEST2) == 3

    inputs = my_aocd.get_input(2016, 7, 2000)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 17
0
def main() -> None:
    my_aocd.print_header(2020, 11)

    assert part_1(TEST) == 37
    assert part_2(TEST) == 26

    inputs = my_aocd.get_input(2020, 11, 94)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 18
0
def main() -> None:
    my_aocd.print_header(2020, 5)

    assert part_1(TEST1) == 820
    assert part_2(TEST2) == 3

    inputs = my_aocd.get_input(2020, 5, 839)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 19
0
def main() -> None:
    my_aocd.print_header(2021, 1)

    assert part_1(TEST) == 7
    assert part_2(TEST) == 5

    inputs = my_aocd.get_input(2021, 1, 2000)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 20
0
def main() -> None:
    my_aocd.print_header(2015, 11)

    assert _get_next(TEST1) == "abcdffaa"
    assert _get_next(TEST2) == "ghjaabcc"

    inputs = my_aocd.get_input(2015, 11, 1)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 21
0
def main() -> None:
    my_aocd.print_header(2021, 4)

    assert part_1(TEST) == 4512
    assert part_2(TEST) == 1924

    inputs = my_aocd.get_input(2021, 4, 601)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 22
0
def main() -> None:
    my_aocd.print_header(2016, 18)

    assert _solve("..^^.", 3) == 6
    assert _solve(".^^.^.^^^^", 10) == 38

    inputs = my_aocd.get_input(2016, 18, 1)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 23
0
def main() -> None:
    my_aocd.print_header(2016, 6)

    assert part_1(TEST) == "easter"
    assert part_2(TEST) == "advent"

    inputs = my_aocd.get_input(2016, 6, 624)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 24
0
def main() -> None:
    my_aocd.print_header(2015, 17)

    assert _do_part_1(TEST, 25) == 4
    assert _do_part_2(TEST, 25) == 3

    inputs = my_aocd.get_input(2015, 17, 20)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 25
0
def main() -> None:
    my_aocd.print_header(2015, 4)

    assert part_1(TEST1) == 609043
    assert part_1(TEST2) == 1048970

    inputs = my_aocd.get_input(2015, 4, 1)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 26
0
def main() -> None:
    my_aocd.print_header(2020, 22)

    assert part_1(TEST) == 306
    assert part_2(TEST) == 291

    inputs = my_aocd.get_input(2020, 22, 53)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 27
0
def main() -> None:
    my_aocd.print_header(2015, 9)

    assert part_1(TEST) == 605
    assert part_2(TEST) == 982

    inputs = my_aocd.get_input(2015, 9, 28)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 28
0
def main() -> None:
    my_aocd.print_header(2020, 4)

    assert part_1(TEST) == 10
    assert part_2(TEST) == 6

    inputs = my_aocd.get_input(2020, 4, 1009)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 29
0
def main() -> None:
    my_aocd.print_header(2021, 6)

    assert part_1(TEST) == 5_934
    assert part_2(TEST) == 26_984_457_539

    inputs = my_aocd.get_input(2021, 6, 1)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    result2 = part_2(inputs)
    print(f"Part 2: {result2}")
Ejemplo n.º 30
0
def main() -> None:
    my_aocd.print_header(2015, 25)

    assert part_1(TEST1) == 20151125
    assert part_1(TEST2) == 21345942
    assert part_1(TEST3) == 15514188

    inputs = my_aocd.get_input(2015, 25, 1)
    result1 = part_1(inputs)
    print(f"Part 1: {result1}")
    print("Part 2: None")