Pagini recente » Diferente pentru problema/arbore3 intre reviziile 11 si 3 | Cod sursa (job #1514052) | Cod sursa (job #1540204) | Cod sursa (job #1522024) | Cod sursa (job #1522023)
#include <iostream>
#define mod 1999999973
using namespace std;
long long expRap(long long a, long long b)
{
if (b == 0) return 1;
int aux = 1;
while (b > 1
)
{
if (b % 2 == 0)
{
a *= a % mod;
b /= 2;
}
else
{
aux *= a % mod;
b--;
}
}
return (a * aux) % mod;
}
int main()
{
long long n, p;
cin >> n >> p;
cout << expRap(n, p);
return 0;
}