Pagini recente » Cod sursa (job #2797549) | Cod sursa (job #2796335) | Borderou de evaluare (job #2483394) | Cod sursa (job #3288319) | Cod sursa (job #1644204)
#include<iostream>
#include<fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int MOD = 1999999973;
int lgput(long long x,int y)
{
int z=1;
while (y!=0)
{
if (y%2==0)
{
x=(x*x)%MOD;
y=y/2;
}
if (y%2==1)
{
z=(z*x)%MOD;
y=y-1;
}
}
return z;
}
int main ()
{
int a,b;
fin>>a>>b;
int x=lgput(a,b);
fout<<x;
}