Pagini recente » Cod sursa (job #1383799) | Cod sursa (job #3343890) | Cod sursa (job #3328198) | Cod sursa (job #3317756) | Cod sursa (job #3356254)
#include <iostream>
#include <fstream>
#include <cstdint>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long exponent_log(int n, int p){
if(p == 0){
return 1;
}
if(p % 2 == 0){
return exponent_log(n * n, p / 2);
}
if(p % 2 == 1){
return n * exponent_log(n * n, p / 2);
}
return 0;
}
int main (){
int n, p;
long long r = 1;
fin >> n >> p;
r = exponent_log(n, p);
fout << r % 1999999973;
fin.close();
fout.close();
return 0;
}