Pagini recente » Cod sursa (job #2424420) | Cod sursa (job #2500132) | Cod sursa (job #2561411) | Cod sursa (job #2821888) | Cod sursa (job #2919253)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int DIV = 1999999973;
long long power(long long base, long long pow) {
if (pow == 0) {
return 1;
}
if (pow % 2 == 0) {
return (power(base, pow / 2) % DIV * (power(base, pow / 2) % DIV)) % DIV;
} else {
return (base % DIV * (power(base, pow - 1) % DIV)) % DIV;
}
}
int main() {
long long n, p;
fin >> n >> p;
fout << power(n, p);
}