Pagini recente » Cod sursa (job #2366824) | Cod sursa (job #2371925) | Cod sursa (job #1619736) | Cod sursa (job #426497) | Cod sursa (job #2147125)
#include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
int main()
{
long long 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;
}