Pagini recente » Cod sursa (job #1050746) | Cod sursa (job #2334105) | Diferente pentru utilizator/devilkind intre reviziile 29 si 30 | Cod sursa (job #1054790) | Cod sursa (job #3227485)
#include <fstream>
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;
}
return base*lgput(base,exp-1);
}
int main() {
int n,p;
fin >> n >> p;
fout << lgput(n,p)%1999999973;
}