Pagini recente » Cod sursa (job #2731612) | Rezultatele filtrării | Cod sursa (job #1527451) | Rezultatele filtrării | Cod sursa (job #641225)
Cod sursa(job #641225)
#include<stdio.h>
#define q 1999999973
long power(long x , long n){
long buff;
if(n == 0)
return 1;
buff = power(x, n/2)%q;
if(n%2)
return ((x%q)*(buff*buff)%q)%q;
else
return (buff*buff)%q;
}
int main(){
long N, P;
freopen("lgput.in","r",stdin);
freopen("lgput.out", "w", stdout);
scanf("%ld %ld",&N, &P);
printf("%ld", power(N, P));
return 0;
}