Pagini recente » Cod sursa (job #1137412) | Cod sursa (job #326625) | Cod sursa (job #2706535) | Cod sursa (job #944678) | Cod sursa (job #1163790)
#include<fstream>
using namespace std;
ifstream cin("lgput.in");
ofstream cout("lgput.out");
unsigned long long n,p;
unsigned long long exp(unsigned long long n,unsigned long long p){
if(p==0){
return 1;
}else{
if(p==1){
return n%1999999973;
}else{
if(p%2){
return (n%1999999973)*exp(n%1999999973*n%1999999973,p/2)%1999999973;
}else{
return exp(n%1999999973*n%1999999973,p/2)%1999999973;
}
}
}
}
int main() {
cin>>n>>p;
cout<<exp(n%1999999973,p);
return 0;
}