Pagini recente » Cod sursa (job #1885079) | Cod sursa (job #2551094) | Monitorul de evaluare | Cod sursa (job #719186) | Cod sursa (job #2008315)
#include<fstream>
#include<iostream>
#define MOD 1999999973
using namespace std;
ifstream fin ("lgput.in");
ofstream fout ("lgput.out");
long long int x, n, p;
void Ridica()
{
while (n!=0)
{
if (n%2==0)
{
n=n/2;
x=((x%MOD)*(x%MOD))%MOD;
}
if (n%2!=0)
{
n--;
p=((p%MOD)*(x%MOD))%MOD;
}
}
}
int main ()
{
int i,j;
p=1;
fin >> x >> n;
Ridica();
fout << p;
return 0;
}