Pagini recente » Monitorul de evaluare | Cod sursa (job #585155) | Istoria paginii utilizator/android009 | Cod sursa (job #522937) | Cod sursa (job #2190273)
#include <iostream>
#include <fstream>
using namespace std;
long long n,x;
long long fpow(int x,int n){
if(n<0)
return fpow(1/x,-n);
else if(n==0)
return 1;
else if(n==1)
return x;
else if(n%2==0)
return fpow(x*x,n/2);
else if(n%2==1)
return x*fpow(x*x,(n-1)/2);
}
int main(){
ifstream f("lgput.in");
ofstream o("lgput.out");
f>>x>>n;
o<<fpow(x,n)%1999999973;
return 0;
}