警示后人(exgcd逆元40分WA)
查看原帖
警示后人(exgcd逆元40分WA)
37789
wutiruo楼主2022/10/8 22:17
void exgcd(ll a,ll b,ll &x,ll &y){
	if(!b)
		return x=1,y=0,void();
	exgcd(b,a%b,y,x),y-=x*(a/b);
}

千万不能把 x×abx \times \frac{a}{b} 写错, 一定要记得给 ab\frac{a}{b} 加括号,不然 int128 也救不了你。

2022/10/8 22:17
加载中...