Pagini recente » Borderou de evaluare (job #364012) | Borderou de evaluare (job #1545323) | Monitorul de evaluare | Cod sursa (job #2701554) | Cod sursa (job #2373151)
#include <cstdio>
#define MOD 1999999973
using namespace std;
int n, p;
int putere(int n, int p)
{
int rez=1;
while(p)
{
if(p&1)
{
p--;
rez=(rez*n)%MOD;
}
p>>=1;
n=(n*n)%MOD;
}
return rez%MOD;
}
int main()
{
freopen("lgput.in", "r", stdin);
freopen("lgput.out", "w", stdout);
scanf("%d %d",&n, &p);
printf("%d", putere(n, p));
return 0;
}