Skip to main content

洛谷 P3846 【模板】BSGS / [TJOI2007] 可爱的质数

给定质数 pp 与整数 b,nb,n,求最小的非负整数 ll,使 bln(modp)b^l\equiv n\pmod p;无解则报告。