Pagini recente » Cod sursa (job #332179) | Cod sursa (job #2219299) | Cod sursa (job #3036734) | Cod sursa (job #1690298) | Cod sursa (job #2443512)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int mdl = 1999999973;
int b, ex;
#define ll long long
int lgput(int b, int ex)
{
if(ex == 0) return 1;
if(ex == 1) return b;
if(ex % 2)
return b * lgput(b * b * 1LL % mdl, (ex - 1) / 2) * 1LL % mdl;
return lgput(b * b * 1LL % mdl, ex / 2);
}
int main()
{
fin >> b >> ex;
fout << lgput(b, ex);
return 0;
}