Files
aocpy/2015/d25.py
2024-05-08 18:29:48 -04:00

20 lines
398 B
Python

import sys
from lib import str_to_ints
with open("i25.txt", "r") as f:
target_row, target_col = str_to_ints(f.read())
x = 20151125
m = 252533
d = 33554393
for start_row in range(1, 10000):
row, col = start_row, 1
while row > 0:
if row == target_row and col == target_col:
print(x)
sys.exit(0)
x = (x * m) % d
row -= 1
col += 1