Pagini recente » Cod sursa (job #3182416) | Cod sursa (job #1988742) | Cod sursa (job #2459407) | Cod sursa (job #1881910) | 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;
}