求助dalao,为何会RE
查看原帖
求助dalao,为何会RE
774307
StarlitDreams楼主2025/7/31 17:47
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll a , b , x , y;
ll exgcd(ll a , ll b)
{
	if(b == 0) 
	{
		x = 1;
		y = 0;
		return a;
	}
	exgcd( b , a % b );
	ll ans = x;
	x = y;
	y = ans - a / b * y;
}


int main()
{
	cin >> a >> b;
	exgcd( a , b );
	x = ( x % b + b ) % b;
	cout << x;
	return 0;
}
2025/7/31 17:47
加载中...