Pagini recente » Cod sursa (job #3123009) | Cod sursa (job #1627354) | Diferente pentru problema/plimbare3 intre reviziile 2 si 3 | Cod sursa (job #1570829) | Cod sursa (job #1145714)
/*
Keep It Simple!
*/
#include<stdio.h>
#define MOD 1999999973
int N,P;
int LgPow(int nr,int power)
{
int aux = 1;
while(power)
{
if(power%2)
aux = (aux*nr) % MOD;
nr = (nr*nr)%MOD;
power/=2;
}
return aux;
}
int main()
{
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
scanf("%d%d",&N,&P);
printf("%d",LgPow(N,P));
}