Pagini recente » Cod sursa (job #2607930) | Diferente pentru problema/graf2 intre reviziile 26 si 25 | Cod sursa (job #2543627) | Cod sursa (job #2705311) | Cod sursa (job #1026195)
#include<stdio.h>
#define nr 1999999973
long long putere(int x,int y)
{
if(y==1)
return x;
long long aux=putere(x,y/2);
if(y%2==0)
return (aux*aux)%nr;
else
return ((aux*aux)%nr*x)%nr;
}
int main()
{
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
int n,p;
scanf("%d %d",&n,&p);
printf("%lld",putere(n,p));
return 0;
}