Pagini recente » Cod sursa (job #536581) | Cod sursa (job #213021) | Cod sursa (job #1890673) | Sandbox (cutiuţa cu năsip) | Cod sursa (job #1244680)
#include <stdio.h>
#define IN "lgput.in"
#define OUT "lgput.out"
typedef unsigned long Int;
static const Int mod = 1999999973;
static Int lgput(Int n, Int p)
{
Int l;
if (p == 0)
return 1;
if (p == 1)
return n;
if (p % 2)
return (n * lgput(n, p - 1)) % mod;
else
return ((l = lgput(n, p >> 1)) * l) % mod;
}
int main(void)
{
Int p, n;
freopen(IN, "r", stdin);
freopen(OUT, "w", stdout);
scanf("%llu %llu", &n, &p);
printf("%llu\n", lgput(n, p) % mod);
return 0;
}