Pagini recente » Istoria paginii runda/leulloe4 | Autentificare | Profil oancea_horatiu | Statistici Ilie Denis (denisilie94) | Cod sursa (job #1989969)
#include <iostream>
#include <fstream>
#define MOD 1999999973
long long unsigned pow(long long nV, long long p) {
if (p == 0) return 1;
int aux = nV % MOD;
if (p == 1) return aux;
if (p % 2) return (aux * pow(aux * aux, (p - 1) / 2)) % MOD;
return pow(aux * aux, p / 2) % MOD;
}
int main() {
std::ifstream fileIn("lgput.in");
std::ofstream fileOut("lgput.out");
long long unsigned nV, p;
fileIn >> nV >> p;
fileOut << pow(nV, p) % MOD;
fileIn.close();
fileOut.close();
return 0;
}