Pagini recente » Cod sursa (job #1475470) | Cod sursa (job #1354054) | Cod sursa (job #1341255) | Cod sursa (job #3209039) | Cod sursa (job #1229450)
#include <stdio.h>
#define LL long long
#define mod 1999999973
#define FIN "lgput.in"
#define FOUT "lgput.out"
unsigned int base, expo;
LL r;
//function prototypes
void read();
void solve();
int main() {
read();
solve();
return 0;
};
void read() {
freopen(FIN, "r", stdin);
scanf("%d %d", &base, &expo);
fclose( stdin );
}
LL mypow(base, exp) {
int i = 0;
LL sol = 1, base1, exp1;
base1 = base;
exp1 = exp;
while( (1<<i) <= exp1 ) {
if (((1<<i) & exp1)) sol = (sol * base1 ) % mod;
base1 = (base1 * base1 ) % mod;
i++;
}
return sol;
};
void solve() {
freopen(FOUT, "w", stdout);
r = mypow(base, expo);
printf("%lld", r);
fclose( stdout );
}