Pagini recente » Cod sursa (job #2838825) | Cod sursa (job #941481) | Cod sursa (job #145809) | Cod sursa (job #1527678) | Cod sursa (job #1526325)
#include <bits/stdc++.h>
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
int timplogaritmic(int x,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 timplogaritmic(x*x , (n-1)/2);
}
int main()
{
int n,x;
in>>x>>n;
out<<timplogaritmic(x,n) % 1999999973;
return 0;
}