hdu 2815 Mod Tree 模方程a^x=b(mod n),n为任意正整数+模板题(扩展Baby Step Giant Step)
//hdu2815ModTree#include#include#include#include#include#includeusingnamespacestd;#defineLL__int64LLgcd(LLa,LLb){returnb==0?a:gcd(b,a%b);}//拓展欧几里得定理,求ax+by=gcd(a,b)的一组解(x,y),d=gcd(a,b)voidgcd_mod(LLa,