Pagini recente » Cod sursa (job #2770735) | Cod sursa (job #1190704) | Cod sursa (job #1103988) | Diferente pentru problema/ordonare intre reviziile 40 si 9 | Cod sursa (job #624206)
Cod sursa(job #624206)
#include <cstdio>
int pow(int a, int b)
{
if (!b) return 1;
int sq = a*a % 1999999973;
if ( b%2 )
return pow( sq, b/2 );
else
return a*pow( sq, (b-1)/2 ) % 1999999973;
}
int main()
{
int x, y, z;
freopen("lgput.in", "r", stdin);
freopen("lgput.out", "w", stdout);
scanf("%d%d", &x, &y);
z = pow(x, y);
printf("%d", z);
}