Pagini recente » Cod sursa (job #358140) | Cod sursa (job #2354895) | Cod sursa (job #3186126) | Cod sursa (job #1768474) | Cod sursa (job #1590316)
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long putere(int, int);
int a, b;
int main()
{
fin >> a >> b;
fout << putere(a, b);
return 0;
}
long long putere(int a, int exp)
{
if(exp == 1)
return 2;
else
{
b = putere(a, exp/2);
if(exp%2 == 0)
return b*b%1999999973;
else
return b*b*a%1999999973;
}
}