Pagini recente » Cod sursa (job #2284927) | Cod sursa (job #661580) | Diferente pentru problema/asfalt intre reviziile 3 si 2 | Cod sursa (job #864202) | Cod sursa (job #2169819)
#include <fstream>
#define k 1999999973
using namespace std;
ifstream fin ("lgput.in");
ofstream fout ("lgput.out");
int a, b;
long long putere (long long n, long long p)
{
int x;
if(p==0)
return 1;
else
{
x = putere (n, p/2);
if(p%2 == 0)
return (x*x)%k;
else
return ((x*x)%k)*n %k;
}
}
int main ()
{
fin >> a >> b;
fout << putere (a,b);
}