Pagini recente » Borderou de evaluare (job #717595) | Diferente pentru articole/solutii intre reviziile 4 si 9 | Cod sursa (job #567878) | Zeul | Cod sursa (job #2257258)
#include <fstream>
#include <iostream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int MOD = 1999999973;
long long power(int x, int y) {
if (y == 0) {
return 1;
}
int r = power(x, y / 2);
if (y % 2 == 0) {
return (1LL * r * r) % MOD;
} else {
return (1LL * x * r * r) % MOD;
}
}
int main() {
int N, P;
fin >> N >> P;
fout << power(N, P);
}