Pagini recente » Cod sursa (job #311460) | Cod sursa (job #573816) | Cod sursa (job #2670839) | Cod sursa (job #834115) | Cod sursa (job #2940748)
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int MOD = 1999999973;
int n, p;
int exp(int n, int p)
{
int sol = 1;
while(p)
{
if(p & 1)
{
sol = (1LL * sol * n) % MOD;
}
n = (1LL * n * n) % MOD;
p = p >> 1;
}
return sol;
}
int main()
{
fin >> n >> p;
fout << exp(n, p);
return 0;
}