Pagini recente » Cod sursa (job #495449) | Cod sursa (job #2343855) | Cod sursa (job #989031) | Borderou de evaluare (job #2664311) | Cod sursa (job #2147122)
#include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
int main()
{
int n,p = 1,x;
in >> x >> n;
while (n != 0)
{
if (n%2 == 0)
{
x = (x%1999999973 * x%1999999973)%1999999973;
n /= 2;
}
else
{
p = (p%1999999973 * x%1999999973)%1999999973;
n--;
}
}
out << p;
return 0;
}