Pagini recente » Cod sursa (job #3311736) | Statistici Boita David Andrei (Boita_David) | Cod sursa (job #2424990) | Cod sursa (job #1727611) | Cod sursa (job #3302714)
#include <iostream>
#include <fstream>
using namespace std;
const int MOD = 1999999973;
int logpow(int a, int b) {
if (b == 0) return 1;
if (b % 2 == 0) {
int half = logpow(a, b / 2);
return (1LL * half * half) % MOD;
} else {
return (1LL * a * logpow(a, b - 1)) % MOD;
}
}
int main() {
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int a, b;
fin >> a >> b;
fout << logpow(a, b) << endl;
return 0;
}