Pagini recente » Cod sursa (job #1056936) | Cod sursa (job #2773232) | Cod sursa (job #2718475) | Cod sursa (job #2486020) | Cod sursa (job #280896)
Cod sursa(job #280896)
#include <stdio.h>
long rez,n,p;
long putere(long x,long y)
{if(y==1)return x%1999999973;
if(y%2)return (putere(x,1)*putere(x,y/2)*putere(x,y/2))%1999999973;
else return (putere(x,y/2)*putere(x,y/2))%1999999973;
}
int main()
{freopen("lgput.in","r",stdin);freopen("lgput.out","w",stdout);
scanf("%ld%ld",&n,&p);
rez=putere(n,p);
printf("%ld",rez);
fclose(stdin);fclose(stdout);
return 0;
}