Pagini recente » Cod sursa (job #1441712) | Cod sursa (job #2559068) | Cod sursa (job #910754) | Cod sursa (job #2304409) | Cod sursa (job #3198476)
#include <fstream>
using namespace std;
int mod = 1999999973;
int exp(int x, int y)
{
if(y == 0)
return 1;
if(y % 2 == 1)
return x * exp(x, y - 1) % mod;
else
{
int pow = exp(x, y / 2) % mod;
return ((pow % mod) * (pow % mod)) % mod;
}
}
int main()
{
ifstream cin("lgput.in");
ofstream cout("lgput.out");
int n, p;
cin >> n >> p;
cout << exp(n, p);
return 0;
}