This commit is contained in:
Juan José Gutiérrez de Quevedo Pérez 2020-12-26 20:08:22 +01:00
parent 99bf948419
commit 0eb5656a9b

25
25/1.py Normal file
View file

@ -0,0 +1,25 @@
key1 = 12092626
key2 = 4707356
def get_loop_size(key):
result = 1
loop = 1
while True:
result *= 7
result = result % 20201227
if key == result:
return loop
loop += 1
def get_key(subject, loop_size):
result = 1
for __ in range(loop_size):
result *= subject
result = result % 20201227
return result
key1_loopsize = get_loop_size(key1)
key2_loopsize = get_loop_size(key2)
print(get_key(key2, key1_loopsize))
print(get_key(key1, key2_loopsize))