Pagini recente » Monitorul de evaluare | Cod sursa (job #166479) | Cod sursa (job #2234871) | Cod sursa (job #2234664) | Cod sursa (job #1218745)
#include <cstdio>
#define MOD 1999999973
using namespace std;
long long lgput(long long a,long long b)
{
if(b == 0) return 1;
if(b == 1) return a % MOD;
long long x1 = a,x2 = 1;
while(b > 1)
{
if(b & 1){
x2 = (x1 * x2)%MOD;
b ^= 1;
}
else
{
x1 = (x1 * x1)%MOD;
b >>= 1;
}
}
return ((x1 * x2) % MOD + MOD ) % MOD;
}
void read( void )
{
long long a,b;
scanf("%lld%lld",&a,&b);
printf("%lld\n",lgput(a,b));
}
int main()
{
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
read();
return 0;
}