Pagini recente » Cod sursa (job #1634425) | Cod sursa (job #2257650) | Cod sursa (job #2399122) | Cod sursa (job #3251780) | Cod sursa (job #1522028)
#include <fstream>
#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;
}
long long n, p;
int main()
{
ifstream f("lgput.in");
ofstream g("lgput.out");
f >> n >> p;
g << expRap(n, p);
return 0;
}