Pagini recente » Cod sursa (job #1705935) | Cod sursa (job #548936) | Cod sursa (job #603321) | Cod sursa (job #1672843) | Cod sursa (job #2573312)
#include <fstream>
#define N 1999999973
#define ios ios_base::sync_with_stdio(false);
using namespace std;
ifstream cin("lgput.in");
ofstream cout("lgput.out");
unsigned b,exp,i;
unsigned long long rez,a;
int main()
{
ios;
cin.tie(0);
cout.tie(0);
cin>>b>>exp;
rez=1;
a=b;
for (i=0;(1<<i)<=exp;i++){
if ((1<<i)&exp) rez=(rez*a)%N;
a=(a*a)%N;
}
cout<<rez;
return 0;
}