Pagini recente » Cod sursa (job #1125139) | Cod sursa (job #1848000) | Diferente pentru concursuri intre reviziile 119 si 182 | Cod sursa (job #2507184) | Cod sursa (job #492752)
Cod sursa(job #492752)
#include<stdio.h>
long long modulo(long long a, long long b, long long c){
long long aux;
if(b==0)
return 1;
if(b==1)
return a%c;
else
if(b%2==0){
aux=modulo(a, b/2, c);
return ((aux%c)*(aux%c))%c;
}
else{
aux=modulo(a, b/2, c);
return ((aux%c)*(aux%c)*(a%c))%c;
}
}
int main(){
freopen ("lgput.in", "r", stdin);
freopen ("lgput.out", "w", stdout);
long long a, b, c;
scanf("%lld %lld ", &a, &b);
c=1999999973;
//printf("%d %d %d ", a, b, c);
printf("%lld ", modulo (a, b, c));
return 0;
}