Pagini recente » Cod sursa (job #2736225) | Cod sursa (job #2154537) | Cod sursa (job #1835058) | Cod sursa (job #2720575) | Cod sursa (job #688900)
Cod sursa(job #688900)
#include <cstdio>
#define M 1999999973
#define LL long long
using namespace std;
int a, b;
int 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;
}