Pagini recente » Cod sursa (job #2788721) | Cod sursa (job #1538995) | Cod sursa (job #1781979) | Cod sursa (job #2739643) | Cod sursa (job #1526340)
#include <bits/stdc++.h>
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
int timplogaritmic(long long int x,long long int n)
{
if(n<0) return timplogaritmic(1/x, -n);
else if(n == 0) return 1;
else if(n == 1) return x;
else if(n%2 == 0) return timplogaritmic(x*x , n/2);
else if(n%2 != 0) return x*timplogaritmic(x*x , (n-1)/2);
}
int main()
{
long long int n,x;
in>>x>>n;
out<<timplogaritmic(x,n) % 1999999973;
return 0;
}