-
Notifications
You must be signed in to change notification settings - Fork 3
/
day25.py
39 lines (32 loc) · 843 Bytes
/
day25.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python
"""
Advent Of Code 2015 Day 25
https://adventofcode.com/2015/day/25
"""
from typing import List
from aoc.parsers import all_lines
from itertools import combinations
from functools import reduce
from operator import mul
def part1(target_x: int, target_y: int) -> int:
x = 1
y = 1
val = 20151125
while y != target_y or x != target_x:
if y == 1:
y = x + 1
x = 1
else:
x += 1
y -= 1
val = (val * 252533) % 33554393
return val
class Day25:
""" AoC 2015 Day 25 """
@staticmethod
def part1(_filename: str) -> int:
""" Given a filename, solve 2015 day 25 part 1 """
# Too lazy to parse: These come from input.txt
target_x = 3075
target_y = 2981
return part1(target_x, target_y)