namespace math
{
struct eg{ll x,y,r;eg(ll x,ll y,ll r):x(x),y(y),r(r){}};
eg exgcd(ll a,ll b)
{
if(!b)return eg(1,0,a);
eg t=exgcd(b,a%b);
return eg(t.y,t.x-a/b*t.y,t.r);
}
}
using math::eg;
using math::exgcd;
namespace math
{
struct eg{ll x,y,r;eg(ll x,ll y,ll r):x(x),y(y),r(r){}};
eg exgcd(ll a,ll b)
{
if(!b)return eg(1,0,a);
eg t=exgcd(b,a%b);
return eg(t.y,t.x-a/b*t.y,t.r);
}
}
using math::eg;
using math::exgcd;
本文标题:Extended Euclidean Algorithm
本文链接:https://www.haomeiwen.com/subject/gsbrgttx.html
网友评论