Pagini recente » Rating popescu bogdan (Zz3uU) | Cod sursa (job #1375395) | Cod sursa (job #1213114) | Cod sursa (job #2127542) | Cod sursa (job #2705582)
#include <fstream>
#include <cmath>
using namespace std;
int power(int n,int p)
{
if(p==0)
return 1;
if(p%2==0)
return power(1LL * n * n%1999999973, p/2);
if(p%2!=0)
return 1LL * n * power(1LL*n*n%1999999973,(p-1)/2)%1999999973;
}
int main()
{
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int n, p;
fin>>n>>p;
fout<<power(n,p);
return 0;
}