Discrete Logging 题目: Given a prime P, 2 <= P < 231, an integer B, 2 <= B < P, and an integer N, 1 <= N < P, compute the discrete logarithm of N, base B, m
This way 题意: 告诉你B,N,P,让你求最小的L使得 题解: BSGS模板,大致意思是将L变成ax+b的形式,定下x之后,式子就变成了这样: B b = = N B − a x ( m o d P ) B^b==NB^{-ax}(mod P) Bb==NB−ax(modP) 那么我们只需要先枚举b(0<=b<=x),将所有值都记下来,再枚举a,同时查询即可。 这道题如果将x