Pagini recente » Cod sursa (job #1256236) | Cod sursa (job #2039301) | Borderou de evaluare (job #1636699) | Cod sursa (job #1129262) | Cod sursa (job #2330256)
#include <iostream>
#include <fstream>
#define modulo 1999999973
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long rez,nlaputere,n,p,cf;
int main()
{
fin>>n>>p;
rez=1;
nlaputere=n;
while(p>0)
{
cf=p%2;
p=p/2;
if(cf==1)
rez=(nlaputere*rez)%modulo;
nlaputere=(nlaputere*nlaputere)%modulo;
}
fout<<rez;
return 0;
}