Pagini recente » Cod sursa (job #2784428) | Cod sursa (job #808826) | Cod sursa (job #298360) | Cod sursa (job #1543398) | Cod sursa (job #766779)
Cod sursa(job #766779)
#include <stdio.h>
#include <math.h>
#define D 1999999973
using namespace std;
long long int power(long long int b, long long int e) {
if (e == 1) {
return b % D;
}
long long temp = power(b, e/2);
if (e % 2 == 0) {
return ((temp * temp) % D);
}
return ((temp * temp * b) % D);
}
void read_(long long int & b, long long int & e) {
scanf("%lld%lld", &b, &e);
}
int main() {
freopen("lgput.in", "r", stdin);
freopen("lgput.out", "w", stdout);
long long int r, b, e;
read_(b, e);
r = power(b, e);
printf("%lld", r);
return 0;
}