Pagini recente » Monitorul de evaluare | Statistici Stingaciu Petru Sebastian (StingaciuSebastian) | Rating Selin Robert (SelinRobert) | Borderou de evaluare (job #2546585) | Cod sursa (job #2509444)
#include <fstream>
using namespace std;
ifstream g("lgput.in");
ofstream o("lgput.out");
long long n,m=1999999973,p;
long long putere(long long p)
{
long long r;
if(p==0)
return 1;
else
if(p%2==0)
{
r=putere(p/2)%m;
return (r*r)%m;
}
else
{
return n*putere(p-1)%m;
}
}
int main()
{
g>>n>>p;
o<<putere(p);
return 0;
}