Pagini recente » Cod sursa (job #1712789) | Cod sursa (job #22155) | Cod sursa (job #947002) | Cod sursa (job #1674514) | Cod sursa (job #2793282)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int logput(int n, int p)
{
int r = 1;
while (p)
{
if (p % 2 == 1)
r = (1LL * r * n) % mod;
n = (1LL * n * n) % mod;
p = p / 2;
}
return r;
}
const int mod = 1999999973;
int main()
{
int n, p;
fin >> n >> p;
fout << logput(n, p);
return 0;
}