Pagini recente » Cod sursa (job #1128666) | Simulare #3 | Diferente pentru problema/algoritm intre reviziile 80 si 13 | Cod sursa (job #2262526) | Cod sursa (job #2262519)
#include <iostream>
#include <fstream>
#define MOD 1999999973
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long rezolva(long long n,long long p)
{
long long b=1;
while(p)
{
if(p%2)
{
b=(b*n)%MOD;
p--;
}
else
{ n=(n*n)%MOD;
p/=2;
}
}
return b%MOD;
}
int main()
{ int n,p;
fin>>n>>p;
fout<<rezolva(n,p);
return 0;
}