Pagini recente » Cod sursa (job #1841295) | Cod sursa (job #37231) | Cod sursa (job #1667027) | Cod sursa (job #536926) | Cod sursa (job #3030441)
// ex 1.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <fstream>
#define MOD 1999999973
#define ll long long
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
ll modpow(ll x,ll p)
{
ll r = 1;
if (p == 0)
return 1;
for (; p; p >>= 1)
{
if (p & 1)//p impar
r = (r * x) % MOD;
x = (x * x) % MOD;
}
return r % MOD;
}
int main()
{
ll n, p;
fin >> n >> p;
fout << modpow(n, p);
}