Pagini recente » Cod sursa (job #247037) | Cod sursa (job #2208693) | Cod sursa (job #1072532) | Cod sursa (job #2854124) | Cod sursa (job #2665740)
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long int n, p;
void citire()
{
fin >> n >> p;
}
void exponentiere_rapida(int x, int putere)
{
long long int p = 1;
while(putere)
{
if(putere % 2 == 1)
p = ((p%1999999973) * (x%1999999973))%1999999973;
x = ((x%1999999973) * (x%1999999973))%1999999973;
putere /= 2;
}
fout << p;
}
int main()
{
citire();
exponentiere_rapida(n,p);
return 0;
}