Pagini recente » Cod sursa (job #1784207) | Cod sursa (job #1037559) | Cod sursa (job #2802047) | Cod sursa (job #1497283) | 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;
}