Pagini recente » Cod sursa (job #835443) | Borderou de evaluare (job #1500098) | Cod sursa (job #3242271) | Cod sursa (job #766153) | Cod sursa (job #615529)
Cod sursa(job #615529)
#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;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;
}