Pagini recente » Cod sursa (job #1761089) | Cod sursa (job #3245576) | Cod sursa (job #72318) | Statistici Diana Ion (diana_ion) | Cod sursa (job #1639976)
#include<iostream>
#include<fstream>
#define MOD 1999999973
using namespace std;
ifstream fin ("lgput.in");
ofstream fout ("lgput.out");
int main ()
{
long long int x, n, p;
fin >> x >> n;
p = 1;
while (n > 0)
{
if (n%2 == 0)
{
n /= 2;
x = ((x%MOD)*(x%MOD))%MOD;
}
else
{
n--;
p = ((p%MOD)*(x%MOD))%MOD;
}
}
fout << p << "\n";
fin.close();
fout.close();
return 0;
}