diff options
Diffstat (limited to '25')
-rw-r--r-- | 25/solution.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/25/solution.py b/25/solution.py new file mode 100644 index 0000000..6322ee4 --- /dev/null +++ b/25/solution.py @@ -0,0 +1,19 @@ +def part1(row, col): + row -= 1 + col -= 1 + + n = row + col + n = n * (n + 1) // 2 + col + + code = 20151125 + for i in range(n): + code = code * 252533 % 33554393 + return code + +if __name__ == '__main__': + row = 2978 + col = 3083 + + print(part1(1, 1)) + print(part1(3, 4)) + print(part1(row, col)) |