Pagini recente » Cod sursa (job #3153952) | Cod sursa (job #3209009) | Cod sursa (job #1464331) | Cod sursa (job #379848) | Cod sursa (job #147260)
Cod sursa(job #147260)
#include<stdio.h>
#define MOD 1999999973
int main()
{
freopen("lgput.in", "r", stdin);
freopen("lgput.out", "w", stdout);
long long a, b, sol=1;
int i=0;
scanf("%d %d", &a, &b);
while (1<<i <= b) ++i;
--i;
for (; i>=0; i--)
{
sol*=sol;
sol%=MOD;
if (b& (1<<i))
sol*=a;
sol*=MOD;
}
sol%=MOD;
printf("%d", sol);
fclose(stdout);
return 0;
}