Pagini recente » Cod sursa (job #1254008) | Cod sursa (job #756466) | Cod sursa (job #791809) | Cod sursa (job #2318896) | Cod sursa (job #2869708)
#include <bits/stdc++.h>
#define P 1999999973
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long LogP(int n, int p)
{
long long rez = 1;
while (p > 0)
{
if (p % 2 == 1)
rez = 1LL * n * rez % P;
p /= 2;
n = 1LL * n * n % P;
}
return rez;
}
int main()
{
long long n, p;
fin >> n >> p;
fout << LogP(n, p) << "\n";
fin.close();
fout.close();
return 0;
}