Pagini recente » Diferente pentru happy-coding-2007/solutii intre reviziile 37 si 38 | Cod sursa (job #1118688) | Cod sursa (job #1385429) | Cod sursa (job #1062237) | Cod sursa (job #1965369)
#include <fstream>
#define MOD 1999999973
using namespace std;
int p(int a , int b)
{
if(b==0)return 1;
if(b%2==1)return ((a%MOD)*(p(a,b-1)%MOD))%MOD;
else return ((p(a,b/2)%MOD)*(p(a,b/2)%MOD))%MOD;
}
long long a,b;
int main()
{
ifstream fin ("lgput.in");
ofstream fout("lgput.out");
fin>>a>>b;
fout<<p(a,b);
return 0;
}