Pagini recente » preoni_nicu | Cod sursa (job #597581) | Cod sursa (job #1416393) | Cod sursa (job #2383605) | Cod sursa (job #641222)
Cod sursa(job #641222)
#include<stdio.h>
#include<iostream.h>
#define q 1999999973
int power(int x , int n){
int buff;
if(n == 0)
return 1;
buff = power(x, n/2);
if(n%2)
return ((x%q)*buff*buff)%q;
else
return (buff*buff)%q;
}
int main(){
int N, P;
freopen("lgput.in","r",stdin);
freopen("lgput.out", "w", stdout);
scanf("%d %d",&N, &P);
printf("%d", power(N, P));
return 0;
}