Pagini recente » Cod sursa (job #1643690) | Diferente pentru problema/tequila intre reviziile 75 si 74 | Cod sursa (job #2436308) | Monitorul de evaluare | Cod sursa (job #1644194)
#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;
cin>>a>>b;
int x=lgput(a,b);
cout<<x;
}