Pagini recente » Cod sursa (job #1945689) | Cod sursa (job #591964) | Cod sursa (job #116277) | Cod sursa (job #1339450) | Cod sursa (job #3227493)
#include <fstream>
#include <iostream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int lgput(int base, int exp) {
if (exp==0) {
return 1;
}
if (exp%2==0) {
int half=lgput(base,exp/2)%1999999973;
return (half%1999999973)*(half%1999999973);
}
return base*(lgput(base,exp-1)%1999999973);
}
int main() {
int n,p;
fin >> n >> p;
fout << lgput(n,p)%1999999973;
}