Pagini recente » Cod sursa (job #544099) | Cod sursa (job #2021773) | Cod sursa (job #405536) | Diferente pentru documentatie/textile intre reviziile 107 si 53 | Cod sursa (job #268043)
Cod sursa(job #268043)
#include<stdio.h>
long n,p;
long putere(int n,int p)
{
long x;
if(p==1)
return n;
if(p%2==0)
{
x=putere(n,p/2);
return (x*x)%1999999973;
}
else
return (n*putere(n,(p-1)/2))%1999999973;
}
int main()
{
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
scanf("%d%d",&n,&p);
printf("%ld",putere(n,p));
return 0;
}