ECC
from __future__ import print_function from random import randint from sys import argv, stdout import collections import random def mulInv(n, q): return extEuclid(n, q)[0] % q def extEuclid(a, b): s0, s1, t0, t1 = 1, 0, 0, 1 while b > 0: q, r = divmod(a, b) a, b = b, r s0, s1, t0, t1 = s1, s0 - q * s1, t1, t0 - q * t1 pass return s0, t0, a def sqrRoot(n, q): r = pow(n,(q+1)/4,q) return r, q - r P..
2022. 4. 24.