Pagini recente » Statistici edfgtrewq (edfgtrewq) | Cod sursa (job #3124158) | Cod sursa (job #2059289) | Cod sursa (job #2951266) | Cod sursa (job #3204371)
#include <iostream>
#include <fstream>
using namespace std;
const int MOD = 1999999973;
long long modularExponentiation(long long base, long long exponent) {
long long result = 1;
base %= MOD;
while (exponent > 0) {
if (exponent % 2 == 1) {
result = (result * base) % MOD;
}
base = (base * base) % MOD;
exponent /= 2;
}
return result;
}
int main() {
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long N, P;
fin >> N >> P;
long long result = modularExponentiation(N, P);
fout << result;
fin.close();
fout.close();
return 0;
}