Pagini recente » Cod sursa (job #2511541) | Cod sursa (job #584795) | Cod sursa (job #1689928) | Cod sursa (job #3037849) | Cod sursa (job #1291772)
#include <iostream>
#include <cstdio>
#define MOD 1999999973
using namespace std;
int a;
int put(int b)
{
int p=1,x=1;
while(p<=b)
p*=2;
p/=2;
while(p)
{
if(p<=b)
{
x=(((x*x)%MOD)*a)%MOD;
b-=p;
}
else
{
x=(x*x)%MOD;
}
p/=2;
}
return x;
}
int main()
{
//freopen("lgput.in","r",stdin);
//freopen("lgput.out","w",stdout);
long long n;
cin>>a>>n;
cout<<put(n);
return 0;
}