Pagini recente » Cod sursa (job #2528675) | Cod sursa (job #1613403) | Cod sursa (job #2231567) | Cod sursa (job #2440273) | Cod sursa (job #1018336)
#include <iostream>
#include<stdio.h>
using namespace std;
int n,p;
int putere(int x,int y)
{
int aux;
if(y==1)
return x;
aux=putere(x,y/2)%1999999973;
if(y%2==0)
return aux*aux%1999999973;
else
return aux*aux*x%1999999973;
}
int main()
{
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
scanf("%d %d",&n,&p);
printf("%d",putere(n,p));
return 0;
}