Pagini recente » Cod sursa (job #1348942) | Cod sursa (job #3165245) | Cod sursa (job #1162082) | Cod sursa (job #1508309) | Cod sursa (job #688901)
Cod sursa(job #688901)
#include <cstdio>
#define M 1999999973
#define LL long long
using namespace std;
int a, b;
LL lgput(LL a , LL b){
LL p = 1;
while ( b > 1 ){
if ( b % 2 == 1 ) p = ( p * a ) % M;
a = ( a * a ) % M;
b = b / 2;
}
return ( a * p ) % M;
}
int main(){
freopen("lgput.in","r",stdin); freopen("lgput.out","w",stdout);
scanf("%d%d", &a, &b);
printf("%lld\n", lgput(a,b));
return 0;
}