洛谷P2485 [SDOI2011]计算器

case 1 :快速幂取模 ; case 2:exgcd求乘法逆元,注意y%p的逆元存在条件为gcd(y,p) = 1 ,即y 与 p 互质; case 3:扩展BSGS (由于题中没说y 与 p 互质)。ios 源码:web #include <iostream> #include <algorithm> #include <map> #include <cmath> using namespa
相关文章
相关标签/搜索