Pagini recente » Cod sursa (job #1293776) | Diferente pentru preoni-2007/runda-finala/solutii intre reviziile 20 si 19 | Statistici Palaga Vicentiu-Octavian (otto1) | Cod sursa (job #181539) | Cod sursa (job #3130607)
#include <fstream>
#include <iostream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int main()
{
const unsigned long long MOD = 1999999973;
unsigned long long n, p, result = 1;
fin>>p>>n;
while (n) {
if (n%2) result = (1ll*result*p)%MOD;
p = (1ll*p*p)%MOD;
n /= 2;
}
fout<<result%MOD;
return 0;
}