Pagini recente » Cod sursa (job #479173) | Cod sursa (job #2937704) | Cod sursa (job #501788) | Cod sursa (job #70905) | Cod sursa (job #2311107)
#include<fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int modulo=1999999973;
void power(long long n,long long p,long long &solution){
if(p){
if(p%1){
solution=solution*n%modulo;
}
n=n*n%modulo;
p=p/2;
power(n,p,solution);
}
}
int main(){
long long n,p,solution;
fin>>n>>p;
solution=1;
power(n,p,solution);
fout<<solution;
return 0;
}