Pagini recente » Cod sursa (job #984666) | Cod sursa (job #2540042) | Cod sursa (job #1305975) | Cod sursa (job #2197228) | Cod sursa (job #3225171)
#include <iostream>
#include <fstream>
#define mod 1999999973
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long recursiv(int x,int n)
{
x=x%mod;
if(n ==0)
return 1;
else
if(n%2==0)
return recursiv(x*x,n/2);
else
return x*recursiv(x*x,(n-1)/2);
}
int main()
{
long long P=1;
int baza,exp;
fin>>baza>>exp;
P = recursiv(baza,exp);
fout<<P;
return 0;
}