标签:return its cout clu std ret int bsp amp
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
void exgcd(int a,int b,LL &x,LL &y){
if(b==0){x=1, y=0; return;}
LL tx,ty;
exgcd(b,a%b,tx,ty);
x=ty;
y=tx-(a/b)*ty;
}
int main(){
LL a,b,x,y;
cin>>a>>b;
exgcd(a,b,x,y);
x=(x%b+b)%b;
cout<<x<<endl;
return 0;
}
标签:return its cout clu std ret int bsp amp
原文地址:http://www.cnblogs.com/codetogether/p/7214140.html