Pagini recente » Cod sursa (job #1571273) | Cod sursa (job #1145729) | Cod sursa (job #3280190) | Cod sursa (job #299708) | Cod sursa (job #1648206)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int a,n;
void Rezolvare()
{
int rez,pow;
int k=0,m,i;
while((1<<k)<=n) k++;
pow=1;
rez=a;
m=(1<<k);
while(rez<m)
{
rez=(1LL*rez*rez)%1999999973;
pow*=2;
}
m=n-m;
for(i=1;i<=m;i++)
rez=(1LL*rez*a)%1999999973;
fout<<rez<<"\n";
fout.close();
}
int main()
{
fin>>a>>n;
fin.close();
Rezolvare();
return 0;
}