Finish 2015.
This commit is contained in:
19
2015/d25.py
Normal file
19
2015/d25.py
Normal file
@@ -0,0 +1,19 @@
|
||||
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
|
||||
Reference in New Issue
Block a user