Pagini recente » Cod sursa (job #546278) | Cod sursa (job #3216671) | Cod sursa (job #2763455) | Sandbox (cutiuţa cu năsip) | Cod sursa (job #2812303)
#include <iostream>
#include <fstream>
#define mod 1999999973
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long fast_exp(unsigned int a, unsigned int b)
{
long long ans = 1;
while(b)
{
if(b & 1)
ans = (ans * a) % mod;
a = (a * a) % mod;
b >>= 1;
}
return ans;
}
int main()
{
unsigned int n, p;
fin>>n>>p;
fout<<fast_exp(n, p);
return 0;
}