Pagini recente » Monitorul de evaluare | Diferente pentru problema/cameras intre reviziile 10 si 11 | Cod sursa (job #1307636) | Diferente pentru utilizator/stigma intre reviziile 14 si 19 | Cod sursa (job #2785450)
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
#define PRIME 1999999973
#define ll long long
ifstream fin("lgput.in");
ofstream fout("lgput.out");
ll pow(ll n, ll k)
{
if (k == 0)
{
return 1;
}
if (k % 2 == 0)
{
return pow((n * n) % PRIME, k >> 1);
}
else
{
return (n * pow(n, --k)) % PRIME;
}
}
ll n, k;
int main()
{
fin >> n >> k;
fout << pow(n, k);
return 0;
}