Pagini recente » Cod sursa (job #2806247) | Cod sursa (job #101835) | Cod sursa (job #1710793) | Cod sursa (job #489595) | Cod sursa (job #624165)
Cod sursa(job #624165)
#include <cstdio>
using namespace std;
const int mod = 1999999973;
long long power(int x, int y)
{
if(y == 1)
return x;
if(y % 2 == 0) {
long long a = power(x, y / 2);
return (a * a) % mod;
}
if(y % 2 != 0) {
long long a = power(x,y-1);
return (a * x) % mod;
}
}
int main()
{
int a, b;
freopen ("lgput.in","r",stdin);
freopen ("lgput.out", "w", stdout);
scanf ("%d %d", &a, &b);
printf("%lld", power(a, b));
return 0;
}