Pagini recente » Cod sursa (job #2547553) | Cod sursa (job #290437) | Cod sursa (job #2011409) | Cod sursa (job #2476774) | Cod sursa (job #616964)
Cod sursa(job #616964)
#include<stdio.h>
using namespace std;
long long int putere(long long int n,long long int p)
{
if(p==0)
return 1;
else
{
if(p%2==0)
return putere((n*n)%1999999973,p/2)%1999999973;
else
return (n*putere((n*n)%1999999973,p/2)%1999999973)%1999999973;
}
}
int main()
{
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
long long n, p;
scanf("%lld %lld",&n,&p);
printf("%lld\n",putere(n,p));
return 0;
}