Pagini recente » Cod sursa (job #1574879) | Cod sursa (job #145418) | Cod sursa (job #1484927) | Cod sursa (job #303090) | Cod sursa (job #1291773)
#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;
}