Pagini recente » Diferente pentru problema/kami intre reviziile 6 si 7 | Cod sursa (job #2867633) | Cod sursa (job #2568580) | Cod sursa (job #2486715) | Cod sursa (job #941979)
Cod sursa(job #941979)
#include <fstream>
using namespace std;
ifstream in ("lgput.in");
ofstream out ("lgput.out");
const int R=1999999973;
long long putere(long long x, long long p)
{
if(p==1)
return x;
if(p%2==1)
return putere(x*x,p/2)*x%R;
return putere(x*x,p/2)%R;
}
int main()
{
long long x,p,rez;
in>>x>>p;
//out<<x<<" "<<p<<"\n";
out<<putere(x,p);
return 0;
}