Pagini recente » Profil mirceamaierean41 | Statistici Andreea Juravle (Andreea_Juravle) | Cod sursa (job #285714) | Cod sursa (job #766856) | Cod sursa (job #562714)
Cod sursa(job #562714)
#include <stdio.h>
using namespace std;
const int mod = 1999999973;
unsigned long long N, P, rez, next;
int main()
{
freopen ("lgput.in","r",stdin);
freopen ("lgput.out","w",stdout);
scanf("%llu %llu",&N,&P);
rez = 1;
while(P)
{
if(P & 1)
rez = (rez * N) % mod;
N = (N * N) % mod;
P >>= 1;
}
printf("%llu\n",rez);
return 0;
}