Pagini recente » Diferente pentru problema/royfloyd intre reviziile 21 si 22 | Cod sursa (job #2619180) | Cod sursa (job #1856390) | Diferente pentru problema/royfloyd intre reviziile 11 si 12 | Cod sursa (job #2141356)
#include <iostream>
#include <fstream>
#define MOD 1999999973
using namespace std;
typedef unsigned long long int lint;
lint N, P;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
unsigned long long int DEIPower(lint x, lint P) {
if (P == 1) return x % MOD;
if (P % 2 == 0) {
return DEIPower((x * x) % MOD, P / 2);
}
return x * DEIPower((x * x) % MOD, P / 2);
}
int main()
{
fin >> N >> P;
N %= MOD;
fout << DEIPower(N, P) % MOD;
return 0;
}