Pagini recente » Cod sursa (job #939071) | Cod sursa (job #222102) | Cod sursa (job #282897) | Cod sursa (job #2352603) | Cod sursa (job #2989587)
#include <fstream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
ifstream cin("lgput.in");
ofstream cout("lgput.out");
const int mod=1999999973;
int LogP(int a,int b)
{
if(b==0)
{
return 1;
}
if(b==1)
{
return a%mod;
}
if(b%2==1)
{
return a*LogP((a*a)%mod,b/2)%mod;
}
else
{
return LogP((a*a)%mod,b/2)%mod;
}
}
int main()
{
long long int a,b;
cin>>a>>b;
cout<<LogP(a,b);
return 0;
}