Pagini recente » Statistici Dorobantu Silviu (Sylvester) | Cod sursa (job #1689327) | Cod sursa (job #1910892) | Cod sursa (job #628890) | Cod sursa (job #896306)
Cod sursa(job #896306)
#include<cstdio>
long long putere(long long a, long long b)
{int p,N=1999999973;
p=1;
while(b)
{if(b%2==1)
{p=(p*a)%N;
b--;
}
a=(a*a)%N;
b=b/2;
}
return p;
}
int main()
{
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
long long a,b,p;
scanf("%lld%lld",&a,&b);
p=putere(a,b);
printf("%lld",p);
return 0;
}