Pagini recente » Cod sursa (job #181760) | Borderou de evaluare (job #1530644) | Borderou de evaluare (job #1629841) | Atasamentele paginii Profil MacraAlexandru | Cod sursa (job #2118347)
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int a, b;
long long exp(long long x, long long y);
int main()
{
fin>>a>>b;
fout<<exp(a, b);
return 0;
}
long long exp(long long x, long long y)
{
if (y<=1)
return x;
else if (y%2==0)
return exp(x*x, y/2);
else return x*exp(x*x, y/2);
}