Pagini recente » Cod sursa (job #1942237) | Cod sursa (job #3286466) | Diferente pentru problema/robotei intre reviziile 5 si 15 | Cod sursa (job #1241724) | Cod sursa (job #2576749)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int n,m,p;
int rid(int a,int b)
{
if(b==0)
{
return 1;
}
else
{
if(b%2==1)
{
return (a*rid(a,b-1))%m;
}
else
{
return (rid(a,b/2)*rid(a,b/2))%m;
}
}
}
int main()
{
fin>>n>>p;
m=1999999973;
cout<<rid(n,p);
return 0;
}