Pagini recente » Cod sursa (job #2745448) | Cod sursa (job #2156351) | Cod sursa (job #1266790) | Cod sursa (job #1681411) | Cod sursa (job #1168572)
#include <iostream>
#include <fstream>
using namespace std;
long long c = 1999999973;
int exp_sqr(long long x, long long n)
{
long long t;
if (n == 0)
{
return 1;
}
if (n == 1)
{
return x;
}
if (n % 2 == 0)
{
t = exp_sqr(x, n / 2) % c;
return (t * t) % c;
}
return ((exp_sqr(x,(n-1))%c)*(x%c))%c;
}
int main()
{
long long a, b;
ifstream in("lgput.in");
ofstream out("lgput.out");
in >> a >> b;
out << exp_sqr(a, b);
in.close();
out.close();
}