Pagini recente » Cod sursa (job #1854871) | Cod sursa (job #806422) | Cod sursa (job #2519768) | Cod sursa (job #1280009) | Cod sursa (job #3172536)
#include <iostream>
#include <fstream>
using namespace std;
const long long Mod = 1999999973;
long long putere(int p,long long n){
if(p == 0){
return 1;
}else if(p == 1){
return n%Mod;
}else{
long long x = putere(p/2,n);
if (p%2 == 0){
return x*x%Mod;
}else{
return x*x%Mod*n%Mod;
}
}
}
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int main()
{
int n,x;
fin>>n>>x;
fout<<putere(x,n);
return 0;
}