day 25
This commit is contained in:
parent
99bf948419
commit
0eb5656a9b
25
25/1.py
Normal file
25
25/1.py
Normal 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))
|
Loading…
Reference in a new issue