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