Pagini recente » Cod sursa (job #797893) | Cod sursa (job #2103748) | Cod sursa (job #1363515) | Cod sursa (job #3129027) | Cod sursa (job #2732387)
#include <bits/stdc++.h>
#define M 1999999973
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long N, P;
int ridic(long long x, long long p, int m)
{
int rez = 1;
while(p > 0)
{
if(p % 2 == 1)
rez = ((rez % m) * (x % m) )% m;
x = (x % m) * (x % m) % m;
p /= 2;
}
return rez;
}
void citire()
{
fin>>N>>P;
fout<<ridic(N, P, M);
}
int main()
{
citire();
return 0;
}