Cod sursa(job #145541)
Utilizator | Data | 28 februarie 2008 22:06:20 | |
---|---|---|---|
Problema | Ridicare la putere in timp logaritmic | Scor | Ascuns |
Compilator | cpp | Status | done |
Runda | Marime | 0.34 kb |
#include<stdio.h>
#include<stdlib.h>
int main()
{
int m=1999999973;
unsigned int n,p,d=1;
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
scanf("%d%d",&n,&p);
for (int i=1;i<=p;++i)
d=(d*n)%m;
//printf("D=%d\n",d)
printf("%d\n",d);
//system("pause");
return 0;
}