Beispiel #1
0
def main():
    if not display_tests:
        puzzle_input = adventofcode.read_input(17)
        scans = parse_input(puzzle_input)
        a1, a2 = part1(scans)
        adventofcode.answer(1, 39162, a1)
        adventofcode.answer(2, 32047, a2)
Beispiel #2
0
def main():
    puzzle_input = adventofcode.read_input(3)
    puzzle_input = [parse_input_line(x) for x in puzzle_input]
    claim_map = build_claim_map(puzzle_input)
    adventofcode.answer(1, 104241, find_multi_claimed_area(claim_map))
    adventofcode.answer(2, 806,
                        find_non_overlapped_claim(claim_map, puzzle_input))
Beispiel #3
0
def main():
    puzzle_input = adventofcode.read_input(1)
    adventofcode.answer(1, 1144, inverse_captcha(puzzle_input))
    adventofcode.answer(1, 1144, inverse_captcha_skip(puzzle_input, 1))
    adventofcode.answer(1, 1144, inverse_captcha_fun(puzzle_input, 1))
    adventofcode.answer(
        2, 1194, inverse_captcha_skip(puzzle_input,
                                      len(puzzle_input) / 2))
    adventofcode.answer(
        2, 1194, inverse_captcha_fun(puzzle_input,
                                     len(puzzle_input) / 2))
Beispiel #4
0
def main():
    #puzzle_input = adventofcode.read_input(12)
    # <x=14, y=9, z=14>
    # <x=9, y=11, z=6>
    # <x=-6, y=14, z=-4>
    # <x=4, y=-4, z=-3>

    moon1 = Moon(14, 9, 14)
    moon2 = Moon(9, 11, 6)
    moon3 = Moon(-6, 14, -4)
    moon4 = Moon(4, -4, -3)
    adventofcode.answer(1, 9999, part1([moon1, moon2, moon3, moon4], 1000))
Beispiel #5
0
def main():
    puzzle_input = adventofcode.read_input(23)
    puzzle_input = '925176834'
    adventofcode.answer(1, 69852437, part1(puzzle_input, 100))
    adventofcode.answer(1, 69852437, part1_dict(puzzle_input, 100))
    adventofcode.answer(1, 69852437, part1_a(puzzle_input, 100))
    adventofcode.answer(2, 91408386135, part2_a(puzzle_input))
Beispiel #6
0
def main():
    puzzle_input = adventofcode.read_input(17)
    adventofcode.answer(1, 267, part1(puzzle_input))
    adventofcode.answer(2, 1812, part2(puzzle_input))
Beispiel #7
0
def main():
    puzzle_input = adventofcode.read_input(4)
    pass_range = puzzle_input.split('-')
    adventofcode.answer(1, 460, part1(pass_range))
    adventofcode.answer(2, 290, part2(pass_range))
Beispiel #8
0
def main():
    puzzle_input = adventofcode.read_input(14)
    adventofcode.answer(1, 1052903161, part1(int(puzzle_input)))
    adventofcode.answer(2, 20165504, part2(puzzle_input))
Beispiel #9
0
def main():
    puzzle_input = adventofcode.read_input(10)
    adventofcode.answer(1, 288, part1(puzzle_input))
    adventofcode.answer(1, 616, part2(puzzle_input, (17, 22)))
Beispiel #10
0
def main():
    puzzle_input = adventofcode.read_input(15)
    seeds = [parse_input_line(x) for x in puzzle_input]
    adventofcode.answer(1, 573, part1(seeds))
    adventofcode.answer(2, 294, part2(seeds))
Beispiel #11
0
def main():
    puzzle_input = adventofcode.read_input(21)
    puzzle_input = [int(x) for x in puzzle_input.split(',')]
    adventofcode.answer(1, 19361414, part1(puzzle_input))
    adventofcode.answer(2, 1139205618, part2(puzzle_input))
Beispiel #12
0
def main():
    puzzle_input = adventofcode.read_input(20)
    a1, a2 = part1(puzzle_input)
    adventofcode.answer(1, 4239, a1)
    adventofcode.answer(2, 8205, a2)
Beispiel #13
0
def main():
    puzzle_input = adventofcode.read_input(16)
    adventofcode.answer(1, 977, part1(puzzle_input))
    adventofcode.answer(2, 101501020883, part2(puzzle_input))
Beispiel #14
0
def main():
    puzzle_input = adventofcode.read_input(18)
    adventofcode.answer(1, 645946, part1(puzzle_input, 50))
    adventofcode.answer(2, 227688, part2(puzzle_input, 50, 1000000000))
Beispiel #15
0
def main():
    puzzle_input = adventofcode.read_input(22)
    adventofcode.answer(1, 2939, part1(puzzle_input))
Beispiel #16
0
def main():
    puzzle_input = adventofcode.read_input(21)
    adventofcode.answer(1, 604998, part1([1, 6]))
    adventofcode.answer(2, 157253621231420, part2([1, 6]))
Beispiel #17
0
def main():
    puzzle_input = adventofcode.read_input(22)
    adventofcode.answer(1, 34255, part1(puzzle_input))
    adventofcode.answer(2, 33369, part2(puzzle_input))
Beispiel #18
0
def main():
    puzzle_input = adventofcode.read_input(21)
    adventofcode.answer(1, 2874, part1(puzzle_input))
    adventofcode.answer(2, 'gfvrr,ndkkq,jxcxh,bthjz,sgzr,mbkbn,pkkg,mjbtz',
                        part2(puzzle_input))
Beispiel #19
0
def main():
    puzzle_input = adventofcode.read_input(1)
    adventofcode.answer(1, 3154112, sum_of_fuel(puzzle_input, fuel_required))
    adventofcode.answer(2, 4728317,
                        sum_of_fuel(puzzle_input, fuel_required_extra))
Beispiel #20
0
def main():
    puzzle_input = adventofcode.read_input(24)
    adventofcode.answer(1, 28615131, part1(puzzle_input))
    adventofcode.answer(2, 1926, part2(puzzle_input, 200))
Beispiel #21
0
def main():
    lines = adventofcode.read_input(19)
    adventofcode.answer(1, 'GEPYAWTMLK', part1(lines))
    adventofcode.answer(2, 17628, part2(lines))
Beispiel #22
0
def main():
    puzzle_input = adventofcode.read_input(25)
    puzzle_input = [int(x) for x in puzzle_input.split(',')]
    adventofcode.answer(1, 2155873288, part1(puzzle_input))
Beispiel #23
0
def main():
    puzzle_input = adventofcode.read_input(23)
    puzzle_input = [int(x) for x in puzzle_input.split(',')]
    adventofcode.answer(1, 18982, part1(puzzle_input))
    adventofcode.answer(2, 11088, part2(puzzle_input))
Beispiel #24
0
def main():
    puzzle_input = adventofcode.read_input(2)
    codes = [int(code) for code in puzzle_input.split(',')]
    adventofcode.answer(1, 4945026, run_program(codes, 12, 2)[0])
    adventofcode.answer(2, 5296, brute_force(codes, 19690720))
Beispiel #25
0
def main():
    lines = adventofcode.read_input(21)
    rules = [parse_line(line) for line in lines]
    adventofcode.answer(1, 125, part1(rules))
    adventofcode.answer(2, 1782917, part2(rules))
Beispiel #26
0
def main():
    puzzle_input = adventofcode.read_input(7)
    programs = [parse_input_line(x) for x in puzzle_input]
    adventofcode.answer(1, 'hlhomy', find_bottom(programs))
    adventofcode.answer(2, 1505, find_incorrect_weight(programs))
Beispiel #27
0
def main():
    puzzle_input = adventofcode.read_input(2)
    adventofcode.answer(1, 39126, checksum_by_row(puzzle_input))
    adventofcode.answer(2, 258, only_divisible(puzzle_input))
Beispiel #28
0
def main():
    puzzle_input = adventofcode.read_input(3)
    wire1, wire2 = puzzle_input[0].split(','), puzzle_input[1].split(',')
    adventofcode.answer(1, 709, intersect_distance(wire1, wire2))
    adventofcode.answer(2, 13836, intersect_min_steps(wire1, wire2))
Beispiel #29
0
def main():
    puzzle_input = adventofcode.read_input(8)
    adventofcode.answer(1, 1744, part1(puzzle_input))
    adventofcode.answer(2, 1174, part2(puzzle_input))
Beispiel #30
0
def main():
    puzzle_input = adventofcode.read_input(15)
    # puzzle_input = '16,12,1,0,15,7,11'
    adventofcode.answer(1, 403, part1(puzzle_input))
    adventofcode.answer(2, 6823, part2(puzzle_input))