Pagini recente » Cod sursa (job #1029186) | Cod sursa (job #1779734) | Cod sursa (job #3250963) | Cod sursa (job #832253) | Cod sursa (job #1524948)
#include <fstream>
using namespace std;
int p = 1999999973;
int power(long long a, int b)
{
if(b == 1)
return a;
if(b%2==1)
{
long long temp = a*power(a,b-1);
return temp%p;
}
else{
long long ab2 = power(a, b/2);
ab2 = ab2*ab2;
return ab2%p;
}
}
int main()
{
ofstream out("lgput.out");
ifstream in("lgput.in");
int a, b;
in >> a >> b;
out << power(a,b);
return 0;
}