Pagini recente » Profil M@2Te4i | Cod sursa (job #773269) | Cod sursa (job #721118) | Rating snycwing (snycwing) | Cod sursa (job #1462584)
#include <iostream>
#include <fstream>
#define m 1999999973;
using namespace std;
long long lg_pow(int x, int n){
if(n == 0)
return 1;
else
if(n == 1)
return x;
else
if(n%2 == 0)
return lg_pow(x*x, n/2);
else
return x*lg_pow(x*x, (n-1)/2);
}
long long x, n;
int main()
{
ifstream f("lgput.in");
ofstream g("lgput.out");
f >> x >> n;
g << lg_pow(x, n) % m;
return 0;
}