Pagini recente » Cod sursa (job #1147498) | Cod sursa (job #1892575) | Cod sursa (job #1333567) | Cod sursa (job #700656) | Cod sursa (job #3227489)
#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);
return (half*half)%1999999973;
}
return (base*lgput(base,exp-1))%1999999973;
}
int main() {
int n,p;
fin >> n >> p;
fout << lgput(n,p);
}