Guest User

Untitled

a guest
Dec 24th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. from adventlib import *
  2. from collections import defaultdict, deque
  3. import copy
  4. import re
  5. def main(f): data = lines_int(f) c, d = data[0], data[1]
  6. # c, d = 5764801, 17807724
  7. v = 1
  8. i = 0
  9. while v != c:
  10. v *= 7
  11. v %= 20201227
  12. i += 1
  13. v = 1
  14. i2 = 0
  15. while v != d: v *= 7 v %= 20201227 i2 += 1
  16. print(i, i2)
  17. v = 1
  18. for _ in range(i2):
  19. v *= c
  20. v %= 20201227
  21. print(v)
  22.  
  23. run_main(main)
Advertisement
Add Comment
Please, Sign In to add comment