SuoNi

19

SuoNi
1个月前
//这里填你的代码^^
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


SuoNi
1个月前
//这里填你的代码^^
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~



# include[HTML_REMOVED]

using namespace std;
typedef long long ll;
int x,y;

int exGcd(int a,int b,int &x,int &y){
if(b==0){
x=1;
y=0;
return a;
}
int g=exGcd(b,a%b,x,y);
int temp =x;//x is here
x=y;//x=y(old)
y=temp-a/by;//renew y=x(old)-a/by(old);
return g;//g is gcd
// cout<<(x%b+b)%b<[HTML_REMOVED]0)
}

ll binaryPow(ll a,ll b,ll p)
{
if(b==0) return 1%p;
a%=p;
ll res=binaryPow(a,b>>1,p);
if(b&1) return resres%pa%p;
return res*res%p;
}

int main(){

return 0;


}

SuoNi
1个月前

# include[HTML_REMOVED]

using namespace std;
typedef long long ll;
int x,y;

int exGcd(int a,int b,int &x,int &y){
if(b==0){
x=1;
y=0;
return a;
}
int g=exGcd(b,a%b,x,y);
int temp =x;//x is here
x=y;//x=y(old)
y=temp-a/by;//renew y=x(old)-a/by(old);
return g;//g is gcd
// cout<<(x%b+b)%b<[HTML_REMOVED]0)
}

ll binaryPow(ll a,ll b,ll p)
{
if(b==0) return 1%p;
a%=p;
ll res=binaryPow(a,b>>1,p);
if(b&1) return resres%pa%p;
return res*res%p;
}

int main(){

int a,b,p;
cin>>a>>b>>p;
cout<<binaryPow(a,b,p);

return 0;


}