Pagini recente » Cod sursa (job #2226105) | Cod sursa (job #1438273) | Cod sursa (job #2184786) | Infoarena Monthly 2012 - Runda 9, Clasament | Cod sursa (job #2573326)
#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;
}