Pagini recente » Cod sursa (job #3203835) | Cod sursa (job #992245) | Cod sursa (job #2848854) | Borderou de evaluare (job #2754217) | Cod sursa (job #615528)
Cod sursa(job #615528)
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int M = 1999999973;
int lgpow(int x,int y)
{
int ans = 1;
for(;y>1;y>>=1)
{
if(y % 2)
ans = (1LL * ans * x) % M , y--;
x = (1LL * x * x) % M;
}
return ans;
}
int main()
{
int n , p;
fin>>n>>p;
fout<<lgpow(n,p)<<'\n';
return 0;
}