Pagini recente » tema_1_l2023____ | Cod sursa (job #2565609) | Cod sursa (job #2109889) | Cod sursa (job #826372) | Cod sursa (job #2665752)
#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(long long int x, long long 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;
}