Pagini recente » Statistici contul cont (cont_frumos) | Rating Luc Zan (luczan) | Statistici Popescu Andrei Alexandru (PopescuAndreiAlexandru) | Profil 5sophiee7485yh5 | Cod sursa (job #1956089)
#include <iostream>
#include <fstream>
using namespace std;
int n,p,x,mod=1999999973;
int main()
{freopen("lgput.in", "r", stdin);
freopen("lgput.out", "w", stdout);
scanf("%d%d", &n, &p);
x=1;
while(p)
{
if(p==1)
{
printf("%d", (x*n)%mod);
return 0;
}
if(p%2)
{
x=(x*n)%mod;
}
p=p/2;
n=(n*n)%mod;
}
printf("%d", n);
return 0;
}