Pagini recente » Istoria paginii runda/tabaraichbiahoufosfadasd | Istoria paginii runda/dpsim1/clasament | Cod sursa (job #2006454) | Cod sursa (job #1963353)
#include <iostream>
#include <cstdio>
#include <cstring>
#define MOD 1999999973
#define lint long long
using namespace std;
lint n, p;
lint putLog(lint x, lint y)
{
if (y == 1)
return x;
else if (y % 2 == 0)
return putLog((x * x) % MOD, (y / 2) % MOD) % MOD;
else
return x * putLog((x * x) % MOD, (y / 2) % MOD) % MOD;
}
int main()
{
freopen("lgput.in", "r", stdin);
freopen("lgput.out", "w", stdout);
scanf("%lld %lld", &n, &p);
printf("%lld", putLog(n, p));
return 0;
}