Pagini recente » Cod sursa (job #557852) | Istoria paginii runda/vlad | Istoria paginii runda/antrenament-de-primavara/clasament | Istoria paginii runda/simulare_oji_dinamica | Cod sursa (job #2919218)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int DIV = 1999999973;
int power(int base, int 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 / 2 - 1) % DIV) % DIV;
}
}
int main() {
int n, p;
fin >> n >> p;
fout << power(n, p);
}