Pagini recente » Monitorul de evaluare | Cod sursa (job #2978333) | Cod sursa (job #2530422) | Diferente pentru problema/ecu2 intre reviziile 1 si 2 | Cod sursa (job #3235782)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long lgpow(long long b,long long exp){
if(exp == 0){
return 1 % 1999999973;
}
if(exp % 2 == 0){
return lgpow(b * b, exp / 2) % 1999999973;
}
return b * lgpow(b, exp - 1) % 1999999973;
}
int main()
{
long long n, p;
fin>>n>>p;
fout<<lgpow(n, p) % 1999999973;
return 0;
}